fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
1.0 KiB20 linesraw
1error[E0491]: in type `&'x (dyn for<'z> Trait1<<T as Trait2<'y, 'z>>::Foo> + 'x)`, reference has a longer lifetime than the data it references
2  --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:25
3   |
4LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
5   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6   |
7note: the pointer is valid for the lifetime `'x` as defined on the function body at 21:11
8  --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:11
9   |
10LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
11   |           ^^
12note: but the referenced data is only valid for the lifetime `'y` as defined on the function body at 21:15
13  --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:15
14   |
15LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
16   |               ^^
17
18error: aborting due to previous error
19
20For more information about this error, try `rustc --explain E0491`.