2022-07-26 01:19:58 -05:00
|
|
|
error[E0700]: hidden type for `impl Trait<'y>` captures lifetime that does not appear in bounds
|
2022-02-14 10:10:22 -06:00
|
|
|
--> $DIR/region-escape-via-bound.rs:17:5
|
2018-03-15 04:10:42 -05:00
|
|
|
|
|
2022-02-09 20:42:32 -06:00
|
|
|
LL | fn foo<'x, 'y>(x: Cell<&'x u32>) -> impl Trait<'y>
|
2022-02-14 10:10:22 -06:00
|
|
|
| -- hidden type `Cell<&'x u32>` captures the lifetime `'x` as defined here
|
|
|
|
...
|
|
|
|
LL | x
|
|
|
|
| ^
|
2021-10-05 08:32:03 -05:00
|
|
|
|
|
2022-10-22 16:38:05 -05:00
|
|
|
help: to declare that `impl Trait<'y>` captures `'x`, you can add an explicit `'x` lifetime bound
|
2021-10-05 08:32:03 -05:00
|
|
|
|
|
2022-02-09 20:42:32 -06:00
|
|
|
LL | fn foo<'x, 'y>(x: Cell<&'x u32>) -> impl Trait<'y> + 'x
|
|
|
|
| ++++
|
2018-03-15 04:10:42 -05:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2018-06-10 07:04:48 -05:00
|
|
|
For more information about this error, try `rustc --explain E0700`.
|