rust/src/test/ui/impl-trait/region-escape-via-bound.stderr
2018-06-10 14:04:48 +02:00

21 lines
726 B
Plaintext

error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
--> $DIR/region-escape-via-bound.rs:26:29
|
LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
| ^^^^^^^^^^^^^^
|
note: hidden type `std::cell::Cell<&'x u32>` captures the lifetime 'x as defined on the function body at 26:1
--> $DIR/region-escape-via-bound.rs:26:1
|
LL | / fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
LL | | //~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds [E0700]
LL | | where 'x: 'y
LL | | {
LL | | x
LL | | }
| |_^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0700`.