]> git.proxmox.com Git - rustc.git/blame - src/test/ui/impl-trait/region-escape-via-bound.stderr
New upstream version 1.57.0+dfsg1
[rustc.git] / src / test / ui / impl-trait / region-escape-via-bound.stderr
CommitLineData
94b46f34 1error[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 |
4LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
5 | ^^^^^^^^^^^^^^
c295e0f8
XL
6LL |
7LL | where 'x: 'y
8 | -- hidden type `Cell<&'x u32>` captures the lifetime `'x` as defined here
0531ce1d 9 |
c295e0f8 10help: to declare that the `impl Trait` captures 'x, you can add an explicit `'x` lifetime bound
0531ce1d 11 |
c295e0f8
XL
12LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y> + 'x
13 | ++++
0531ce1d
XL
14
15error: aborting due to previous error
16
94b46f34 17For more information about this error, try `rustc --explain E0700`.