78013f296a
Once this anonymization has performed, we have no
way of recovering the original names during NLL
borrow checking. Keeping the original names allows
error messages in full NLL mode to contain the original
bound region names.
As a result, the typeck results may contain types that
differ only in the names used for their bound regions. However,
anonimization of bound regions does not guarantee that
all distinct types are unqual (e.g. not subtypes of each other).
For example, `for<'a> fn(&'a u32, &'a u32)` and
`for<'b, 'c> fn(&'b u32, &'c u32)` are subtypes of each other,
as explained here:
63cc2bb3d0/compiler/rustc_infer/src/infer/nll_relate/mod.rs (L682-L690)
Therefore, any code handling types with higher-ranked regions already
needs to handle the case where two distinct `Ty`s are 'actually'
equal.
22 lines
710 B
Plaintext
22 lines
710 B
Plaintext
error[E0308]: mismatched types
|
|
--> $DIR/old-lub-glb-object.rs:10:14
|
|
|
|
|
LL | _ => y,
|
|
| ^ one type is more general than the other
|
|
|
|
|
= note: expected trait object `dyn for<'a, 'b> Foo<&'a u8, &'b u8>`
|
|
found trait object `dyn for<'a> Foo<&'a u8, &'a u8>`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/old-lub-glb-object.rs:10:14
|
|
|
|
|
LL | _ => y,
|
|
| ^ one type is more general than the other
|
|
|
|
|
= note: expected trait object `dyn for<'a, 'b> Foo<&'a u8, &'b u8>`
|
|
found trait object `dyn for<'a> Foo<&'a u8, &'a u8>`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|