]>
Commit | Line | Data |
---|---|---|
064997fb | 1 | error[E0700]: hidden type for `impl Trait<'y>` captures lifetime that does not appear in bounds |
5e7ed085 | 2 | --> $DIR/region-escape-via-bound.rs:17:5 |
0531ce1d | 3 | | |
5e7ed085 FG |
4 | LL | fn foo<'x, 'y>(x: Cell<&'x u32>) -> impl Trait<'y> |
5 | | -- hidden type `Cell<&'x u32>` captures the lifetime `'x` as defined here | |
6 | ... | |
7 | LL | x | |
8 | | ^ | |
0531ce1d | 9 | | |
2b03887a | 10 | help: to declare that `impl Trait<'y>` captures `'x`, you can add an explicit `'x` lifetime bound |
0531ce1d | 11 | | |
5e7ed085 FG |
12 | LL | fn foo<'x, 'y>(x: Cell<&'x u32>) -> impl Trait<'y> + 'x |
13 | | ++++ | |
0531ce1d XL |
14 | |
15 | error: aborting due to previous error | |
16 | ||
94b46f34 | 17 | For more information about this error, try `rustc --explain E0700`. |