]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/region-escape-via-bound.stderr
Rollup merge of #93728 - JulianKnodt:toterm, r=oli-obk
[rust.git] / src / test / ui / impl-trait / region-escape-via-bound.stderr
1 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
2   --> $DIR/region-escape-via-bound.rs:18:5
3    |
4 LL | where 'x: 'y
5    |       -- hidden type `Cell<&'x u32>` captures the lifetime `'x` as defined here
6 LL | {
7 LL |     x
8    |     ^
9    |
10 help: to declare that the `impl Trait` captures `'x`, you can add an explicit `'x` lifetime bound
11    |
12 LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y> + 'x
13    |                                            ++++
14
15 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0700`.