2019-10-06 08:57:23 -05:00
|
|
|
// edition:2018
|
2019-10-06 08:58:32 -05:00
|
|
|
// run-rustfix
|
|
|
|
|
2020-04-07 16:57:26 -05:00
|
|
|
fn test_boxed() -> Box<impl std::future::Future<Output = u32>> {
|
2019-10-06 08:57:23 -05:00
|
|
|
let x = 0u32;
|
|
|
|
Box::new(async { x } )
|
|
|
|
//~^ ERROR E0373
|
|
|
|
}
|
|
|
|
|
2020-04-07 16:57:26 -05:00
|
|
|
fn test_ref(x: &u32) -> impl std::future::Future<Output = u32> + '_ {
|
|
|
|
async { *x }
|
|
|
|
//~^ ERROR E0373
|
|
|
|
}
|
|
|
|
|
2019-10-06 08:58:32 -05:00
|
|
|
fn main() {
|
2020-04-07 16:57:26 -05:00
|
|
|
let _ = test_boxed();
|
|
|
|
let _ = test_ref(&0u32);
|
2019-10-06 08:58:32 -05:00
|
|
|
}
|