]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/regions/regions-close-over-type-parameter-multiple.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / ui / regions / regions-close-over-type-parameter-multiple.rs
index fc7696e7e03201e3e9b8fdcaaef36dc1ffc9f056..3d5f4e12665b8f0c818204e1c7ed4905e8310ed7 100644 (file)
@@ -1,6 +1,9 @@
 // Various tests where we over type parameters with multiple lifetime
 // bounds.
 
+// revisions: base nll
+// ignore-compare-mode-nll
+//[nll] compile-flags: -Z borrowck=mir
 
 trait SomeTrait { fn get(&self) -> isize; }
 
@@ -17,7 +20,9 @@ fn make_object_good2<'a,'b,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'b> {
 
 fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> {
     // A outlives 'a AND 'b...but not 'c.
-    Box::new(v) as Box<dyn SomeTrait + 'a> //~ ERROR cannot infer an appropriate lifetime
+    Box::new(v) as Box<dyn SomeTrait + 'a>
+    //[base]~^ ERROR cannot infer an appropriate lifetime
+    //[nll]~^^ ERROR lifetime may not live long enough
 }
 
 fn main() {