mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
13 lines
295 B
Rust
13 lines
295 B
Rust
//@ edition:2018
|
|
|
|
#![feature(async_closure)]
|
|
fn foo() -> Box<dyn std::future::Future<Output = u32>> {
|
|
let x = 0u32;
|
|
Box::new((async || x)())
|
|
//~^ ERROR cannot return value referencing local variable `x`
|
|
//~| ERROR cannot return value referencing temporary value
|
|
}
|
|
|
|
fn main() {
|
|
}
|