blob: fb02a15b079d766ebba16e03563340b9e368312d [file] [log] [blame]
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