rustc/tests/ui/async-await/async-closures/higher-ranked.rs
2024-06-19 10:24:51 +02:00

13 lines
315 B
Rust

// edition:2021
#![feature(async_closure)]
fn main() {
let x = async move |x: &str| {
//~^ ERROR lifetime may not live long enough
// This error is proof that the `&str` type is higher-ranked.
// This won't work until async closures are fully impl'd.
println!("{x}");
};
}