2024-02-16 14:02:50 -06:00
|
|
|
//@ edition:2018
|
2024-01-14 17:12:46 -06:00
|
|
|
|
2020-04-07 16:57:26 -05:00
|
|
|
#![feature(async_closure)]
|
2019-08-19 07:25:06 -05:00
|
|
|
fn foo() -> Box<dyn std::future::Future<Output = u32>> {
|
|
|
|
let x = 0u32;
|
|
|
|
Box::new((async || x)())
|
2024-01-24 21:50:23 -06:00
|
|
|
//~^ ERROR cannot return value referencing local variable `x`
|
|
|
|
//~| ERROR cannot return value referencing temporary value
|
2019-08-19 07:25:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|