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