about summary refs log tree commit diff
path: root/src/test/ui/variance/variance-invariant-arg-object.rs
diff options
context:
space:
mode:
authorJack Huey <31162821+jackh726@users.noreply.github.com>2022-04-01 22:12:17 -0400
committerJack Huey <31162821+jackh726@users.noreply.github.com>2022-04-05 11:42:44 -0400
commit1c1d01eb495fb663f64766a5e7e1e23b9a2590e7 (patch)
treecb3ca5e7f17ded8fffccfdeea3707d86d1f51281 /src/test/ui/variance/variance-invariant-arg-object.rs
parent72e3e0e6f5fb72d5f947e07ef89455d71a6ff3ff (diff)
downloadrust-1c1d01eb495fb663f64766a5e7e1e23b9a2590e7.tar.gz
rust-1c1d01eb495fb663f64766a5e7e1e23b9a2590e7.zip
More nll revisions
Diffstat (limited to 'src/test/ui/variance/variance-invariant-arg-object.rs')
-rw-r--r--src/test/ui/variance/variance-invariant-arg-object.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/test/ui/variance/variance-invariant-arg-object.rs b/src/test/ui/variance/variance-invariant-arg-object.rs
index 886d263c457..cc8820fbac6 100644
--- a/src/test/ui/variance/variance-invariant-arg-object.rs
+++ b/src/test/ui/variance/variance-invariant-arg-object.rs
@@ -1,5 +1,9 @@
 #![allow(dead_code)]
 
+// revisions: base nll
+// ignore-compare-mode-nll
+//[nll] compile-flags: -Z borrowck=mir
+
 trait Get<T> : 'static {
     fn get(&self, t: T) -> T;
 }
@@ -8,14 +12,18 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
                                 -> Box<dyn Get<&'min i32>>
     where 'max : 'min
 {
-    v //~ ERROR mismatched types
+    v
+    //[base]~^ ERROR mismatched types
+    //[nll]~^^ ERROR lifetime may not live long enough
 }
 
 fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
                                    -> Box<dyn Get<&'max i32>>
     where 'max : 'min
 {
-    v //~ ERROR mismatched types
+    v
+    //[base]~^ ERROR mismatched types
+    //[nll]~^^ ERROR lifetime may not live long enough
 }
 
 fn main() { }