Open CraftSpider opened 2 years ago
I may be wrong, but while looking for duplicate issues, this looks somewhat similar to some prior issues related to higher-ranked bounds with lifetimes. This would make sense to me, as I think this is attempting to require rustc prove a bound like for<T> Foo<()> == Bar<()>
@rustbot label +T-compiler +F-generic_associated_types
I tried this code:
I expected to see this happen: This compiles successfully, as the bound is true -
GatBar::Bar<()> == HasGeneric<()>
.Instead, this happened: The compile fails with E0271, type mismatch during resolution
Meta
Tested on the playground with:
and
Backtrace
``` Compiling playground v0.0.1 (/playground) error[[E0271]](https://doc.rust-lang.org/beta/error-index.html#E0271): type mismatch resolving ` as GatBar>::Bar<()> == HasGeneric`
--> src/lib.rs:17:19
|
17 | type Foo = HasGeneric;
| - ^^^^^^^^^^^^^ type mismatch resolving ` as GatBar>::Bar<()> == HasGeneric`
| |
| this type parameter
|
note: expected this to be `HasGeneric`
--> src/lib.rs:13:19
|
13 | type Bar = HasGeneric;
| ^^^^^^^^^^^^^
= note: expected struct `HasGeneric`
found struct `HasGeneric<()>`
note: required by a bound in `GatFoo::Foo`
--> src/lib.rs:5:25
|
5 | type Foo: GatBar = Self::Foo<()>>;
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `GatFoo::Foo`
For more information about this error, try `rustc --explain E0271`.
error: could not compile `playground` due to previous error
```