mirror of
https://git.proxmox.com/git/rustc
synced 2025-10-15 03:43:33 +00:00
18 lines
742 B
Plaintext
18 lines
742 B
Plaintext
error: lifetime may not live long enough
|
|
--> $DIR/higher-ranked.rs:6:34
|
|
|
|
|
LL | let x = async move |x: &str| {
|
|
| ____________________________-___-_^
|
|
| | | |
|
|
| | | return type of closure `{async closure body@$DIR/higher-ranked.rs:6:34: 11:6}` contains a lifetime `'2`
|
|
| | let's call the lifetime of this reference `'1`
|
|
LL | |
|
|
LL | | // This error is proof that the `&str` type is higher-ranked.
|
|
LL | | // This won't work until async closures are fully impl'd.
|
|
LL | | println!("{x}");
|
|
LL | | };
|
|
| |_____^ returning this value requires that `'1` must outlive `'2`
|
|
|
|
error: aborting due to 1 previous error
|
|
|