]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/async-borrowck-escaping-block-error.fixed
Auto merge of #83152 - guswynn:jemallocator_part2, r=Mark-Simulacrum
[rust.git] / src / test / ui / async-await / async-borrowck-escaping-block-error.fixed
1 // edition:2018
2 // run-rustfix
3
4 fn test_boxed() -> Box<impl std::future::Future<Output = u32>> {
5     let x = 0u32;
6     Box::new(async move { x } )
7     //~^ ERROR E0373
8 }
9
10 fn test_ref(x: &u32) -> impl std::future::Future<Output = u32> + '_ {
11     async move { *x }
12     //~^ ERROR E0373
13 }
14
15 fn main() {
16     let _ = test_boxed();
17     let _ = test_ref(&0u32);
18 }