]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/region-escape-via-bound.stderr
Rollup merge of #48270 - leodasvacas:refactor-casts, r=nikomatsakis
[rust.git] / src / test / ui / impl-trait / region-escape-via-bound.stderr
1 error[E0909]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
2   --> $DIR/region-escape-via-bound.rs:26:29
3    |
4 LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
5    |                             ^^^^^^^^^^^^^^
6    |
7 note: hidden type `std::cell::Cell<&'x u32>` captures the lifetime 'x as defined on the function body at 26:1
8   --> $DIR/region-escape-via-bound.rs:26:1
9    |
10 LL | / fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
11 LL | |     //~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds [E0909]
12 LL | | where 'x: 'y
13 LL | | {
14 LL | |     x
15 LL | | }
16    | |_^
17
18 error: aborting due to previous error
19
20 For more information about this error, try `rustc --explain E0909`.