]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr
Update ui tests
[rust.git] / src / test / ui / self / arbitrary_self_types_pin_lifetime_impl_trait.stderr
1 error: cannot infer an appropriate lifetime
2   --> $DIR/arbitrary_self_types_pin_lifetime_impl_trait.rs:8:44
3    |
4 LL |     fn f(self: Pin<&Self>) -> impl Clone { self }
5    |                               ----------   ^^^^ ...but this borrow...
6    |                               |
7    |                               this return type evaluates to the `'static` lifetime...
8    |
9 note: ...can't outlive the anonymous lifetime #1 defined on the method body at 8:5
10   --> $DIR/arbitrary_self_types_pin_lifetime_impl_trait.rs:8:5
11    |
12 LL |     fn f(self: Pin<&Self>) -> impl Clone { self }
13    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 help: you can add a constraint to the return type to make it last less than `'static` and match the anonymous lifetime #1 defined on the method body at 8:5
15    |
16 LL |     fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
17    |                               ^^^^^^^^^^^^^^^
18
19 error: aborting due to previous error
20