diff options
Diffstat (limited to 'tests/ui/async-await/issue-74072-lifetime-name-annotations.rs')
| -rw-r--r-- | tests/ui/async-await/issue-74072-lifetime-name-annotations.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/ui/async-await/issue-74072-lifetime-name-annotations.rs b/tests/ui/async-await/issue-74072-lifetime-name-annotations.rs index 2d453e7891e..904d28fb0a7 100644 --- a/tests/ui/async-await/issue-74072-lifetime-name-annotations.rs +++ b/tests/ui/async-await/issue-74072-lifetime-name-annotations.rs @@ -12,7 +12,8 @@ pub async fn async_fn(x: &mut i32) -> &i32 { pub fn async_closure(x: &mut i32) -> impl Future<Output=&i32> { (async move || { - //~^ captured variable cannot escape `FnMut` closure body + //~^ ERROR lifetime may not live long enough + //~| ERROR temporary value dropped while borrowed let y = &*x; *x += 1; //~ ERROR cannot assign to `*x` because it is borrowed y @@ -21,7 +22,8 @@ pub fn async_closure(x: &mut i32) -> impl Future<Output=&i32> { pub fn async_closure_explicit_return_type(x: &mut i32) -> impl Future<Output=&i32> { (async move || -> &i32 { - //~^ captured variable cannot escape `FnMut` closure body + //~^ ERROR lifetime may not live long enough + //~| ERROR temporary value dropped while borrowed let y = &*x; *x += 1; //~ ERROR cannot assign to `*x` because it is borrowed y |
