]>
Commit | Line | Data |
---|---|---|
94b46f34 | 1 | error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds |
48663c56 | 2 | --> $DIR/region-escape-via-bound.rs:15:29 |
0531ce1d XL |
3 | | |
4 | LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y> | |
5 | | ^^^^^^^^^^^^^^ | |
c295e0f8 XL |
6 | LL | |
7 | LL | where 'x: 'y | |
8 | | -- hidden type `Cell<&'x u32>` captures the lifetime `'x` as defined here | |
0531ce1d | 9 | | |
c295e0f8 | 10 | help: to declare that the `impl Trait` captures 'x, you can add an explicit `'x` lifetime bound |
0531ce1d | 11 | | |
c295e0f8 XL |
12 | LL | fn foo(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`. |