fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
838 B24 linesraw
1error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
2  --> $DIR/issue-63388-1.rs:12:10
3   |
4LL |     ) -> &dyn Foo
5   |          ^^^^^^^^
6   |
7   = note: hidden type `impl std::future::Future` captures lifetime '_#22r
8
9error: lifetime may not live long enough
10  --> $DIR/issue-63388-1.rs:13:5
11   |
12LL |       async fn do_sth<'a>(
13   |                       -- lifetime `'a` defined here
14LL |           &'a self, foo: &dyn Foo
15   |                          - let's call the lifetime of this reference `'1`
16LL |       ) -> &dyn Foo
17LL | /     {
18LL | |         foo
19LL | |     }
20   | |_____^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
21
22error: aborting due to 2 previous errors
23
24For more information about this error, try `rustc --explain E0700`.