about summary refs log tree commit diff
path: root/tests/ui/async-await/async-borrowck-escaping-closure-error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/async-await/async-borrowck-escaping-closure-error.rs')
-rw-r--r--tests/ui/async-await/async-borrowck-escaping-closure-error.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/ui/async-await/async-borrowck-escaping-closure-error.rs b/tests/ui/async-await/async-borrowck-escaping-closure-error.rs
index c02bac2d7dd..2a3e382e118 100644
--- a/tests/ui/async-await/async-borrowck-escaping-closure-error.rs
+++ b/tests/ui/async-await/async-borrowck-escaping-closure-error.rs
@@ -4,7 +4,8 @@
 fn foo() -> Box<dyn std::future::Future<Output = u32>> {
     let x = 0u32;
     Box::new((async || x)())
-    //~^ ERROR closure may outlive the current function, but it borrows `x`, which is owned by the current function
+    //~^ ERROR cannot return value referencing local variable `x`
+    //~| ERROR cannot return value referencing temporary value
 }
 
 fn main() {