blob: 1990d0ffe2a3f4b9d249598083e0037446c1c2f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
//@ 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() {
}
|