Remove manual normalization in compare_projection_bounds

This commit is contained in:
Tyler Mandry 2020-07-25 13:48:29 -07:00
parent 83a9dc92d5
commit 31a3bb59ce
3 changed files with 25 additions and 54 deletions

View file

@ -7,7 +7,7 @@ trait ATy {
impl<'b> ATy for &'b () {
type Item<'a> = &'b ();
//~^ ERROR does not fulfill the required lifetime
//~^ ERROR cannot infer an appropriate lifetime
}
trait StaticTy {

View file

@ -1,14 +1,31 @@
error[E0477]: the type `&'b ()` does not fulfill the required lifetime
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
--> $DIR/unsatisfied-outlives-bound.rs:9:5
|
LL | type Item<'a> = &'b ();
| ^^^^^^^^^^^^^^^^^^^^^^^
|
note: type must outlive the lifetime `'a` as defined on the associated item at 9:15
note: first, the lifetime cannot outlive the lifetime `'b` as defined on the impl at 8:6...
--> $DIR/unsatisfied-outlives-bound.rs:8:6
|
LL | impl<'b> ATy for &'b () {
| ^^
note: ...so that the types are compatible
--> $DIR/unsatisfied-outlives-bound.rs:9:5
|
LL | type Item<'a> = &'b ();
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: expected `ATy`
found `ATy`
note: but, the lifetime must be valid for the lifetime `'a` as defined on the associated item at 9:15...
--> $DIR/unsatisfied-outlives-bound.rs:9:15
|
LL | type Item<'a> = &'b ();
| ^^
note: ...so that the type `&()` will meet its required lifetime bounds
--> $DIR/unsatisfied-outlives-bound.rs:9:5
|
LL | type Item<'a> = &'b ();
| ^^^^^^^^^^^^^^^^^^^^^^^
error[E0477]: the type `&'a ()` does not fulfill the required lifetime
--> $DIR/unsatisfied-outlives-bound.rs:18:5
@ -20,4 +37,5 @@ LL | type Item<'a> = &'a ();
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0477`.
Some errors have detailed explanations: E0477, E0495.
For more information about an error, try `rustc --explain E0477`.