]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr
Pin panic-in-drop=abort test to old pass manager
[rust.git] / src / test / ui / self / arbitrary_self_types_pin_lifetime_impl_trait.stderr
1 error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
2   --> $DIR/arbitrary_self_types_pin_lifetime_impl_trait.rs:6:44
3    |
4 LL |     fn f(self: Pin<&Self>) -> impl Clone { self }
5    |                ----------                  ^^^^ ...is captured here...
6    |                |
7    |                this data with an anonymous lifetime `'_`...
8    |
9 note: ...and is required to live as long as `'static` here
10   --> $DIR/arbitrary_self_types_pin_lifetime_impl_trait.rs:6:31
11    |
12 LL |     fn f(self: Pin<&Self>) -> impl Clone { self }
13    |                               ^^^^^^^^^^
14 help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound
15    |
16 LL |     fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
17    |                                          ++++
18
19 error: aborting due to previous error
20
21 For more information about this error, try `rustc --explain E0759`.