fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.7 KiB35 linesraw
1error[E0106]: missing lifetime specifier
2  --> $DIR/impl-trait-missing-lifetime.rs:9:54
3   |
4LL | fn g(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() }
5   |                                                      ^^ expected named lifetime parameter
6   |
7   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
8help: consider using the `'static` lifetime
9   |
10LL | fn g(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'static ()> { x.next() }
11   |                                                      ~~~~~~~
12
13error[E0106]: missing lifetime specifier
14  --> $DIR/impl-trait-missing-lifetime.rs:16:60
15   |
16LL | async fn i(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() }
17   |                                                            ^^ expected named lifetime parameter
18   |
19   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
20help: consider using the `'static` lifetime
21   |
22LL | async fn i(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'static ()> { x.next() }
23   |                                                            ~~~~~~~
24
25error: lifetime may not live long enough
26  --> $DIR/impl-trait-missing-lifetime.rs:16:69
27   |
28LL | async fn i(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() }
29   | -----------------------------------------------------------------   ^^^^^^^^ returning this value requires that `'1` must outlive `'static`
30   | |
31   | return type `impl Future<Output = Option<&'static ()>>` contains a lifetime `'1`
32
33error: aborting due to 3 previous errors
34
35For more information about this error, try `rustc --explain E0106`.