about summary refs log tree commit diff
path: root/src/test/ui/async-await/issues/issue-72312.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/async-await/issues/issue-72312.rs')
-rw-r--r--src/test/ui/async-await/issues/issue-72312.rs23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/test/ui/async-await/issues/issue-72312.rs b/src/test/ui/async-await/issues/issue-72312.rs
index eb7d12e290c..c1eceefd643 100644
--- a/src/test/ui/async-await/issues/issue-72312.rs
+++ b/src/test/ui/async-await/issues/issue-72312.rs
@@ -1,17 +1,28 @@
+// ignore-compare-mode-nll
+// revisions: base nll
+// [nll]compile-flags: -Zborrowck=mir
+
 // edition:2018
 fn require_static<T: 'static>(val: T) -> T {
-    //~^ NOTE 'static` lifetime requirement introduced by this bound
+    //[base]~^ NOTE 'static` lifetime requirement introduced by this bound
     val
 }
 
 struct Problem;
 
 impl Problem {
-    pub async fn start(&self) { //~ ERROR E0759
-        //~^ NOTE this data with an anonymous lifetime `'_`
-        //~| NOTE in this expansion of desugaring of `async` block or function
-        require_static(async move { //~ NOTE ...and is required to live as long as `'static` here
-            &self; //~ NOTE ...is used here...
+    pub async fn start(&self) {
+        //[base]~^ ERROR E0759
+        //[base]~| NOTE this data with an anonymous lifetime `'_`
+        //[base]~| NOTE in this expansion of desugaring of `async` block or function
+        //[nll]~^^^^ NOTE let's call
+        //[nll]~| NOTE `self` is a reference
+        require_static(async move {
+            //[base]~^ NOTE ...and is required to live as long as `'static` here
+            //[nll]~^^ ERROR borrowed data escapes
+            //[nll]~| NOTE `self` escapes
+            //[nll]~| NOTE argument requires
+            &self; //[base]~ NOTE ...is used here...
         });
     }
 }