]> git.lizzy.rs Git - rust.git/commitdiff
clean variance test
authorlengyijun <sjtu5140809011@gmail.com>
Sat, 11 Jun 2022 12:37:39 +0000 (12:37 +0000)
committerlengyijun <sjtu5140809011@gmail.com>
Sat, 11 Jun 2022 12:37:39 +0000 (12:37 +0000)
src/test/ui/variance/variance-contravariant-arg-object.rs
src/test/ui/variance/variance-contravariant-arg-object.stderr
src/test/ui/variance/variance-covariant-arg-object.rs
src/test/ui/variance/variance-covariant-arg-object.stderr
src/test/ui/variance/variance-invariant-arg-object.rs
src/test/ui/variance/variance-invariant-arg-object.stderr

index e7e24e16731cc44e657eaca3c3a395b41cde0daa..701fcaf692518242c44e1443a5cc0af171d838aa 100644 (file)
@@ -15,8 +15,8 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
     //~^ 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>>
+fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
+                                -> Box<dyn Get<&'max i32>>
     where 'max : 'min
 {
     // Previously OK:
index 162ec3a3f1e65cbb6b0b84bfc35513b88f742c1d..ab28315e11e5288cb31094611bf0e1913c5fb63e 100644 (file)
@@ -14,7 +14,7 @@ LL |     v
 error: lifetime may not live long enough
   --> $DIR/variance-contravariant-arg-object.rs:23:5
    |
-LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
+LL | fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
    |                     ----  ---- lifetime `'max` defined here
    |                     |
    |                     lifetime `'min` defined here
index 129cf054a3ca7813ccbf08f5763defcc584cf230..89cf3117afebfb016f58f612a1ade00dbd0b07a5 100644 (file)
@@ -16,8 +16,8 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
     //~^ 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>>
+fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
+                                -> Box<dyn Get<&'max i32>>
     where 'max : 'min
 {
     v
index f73418509ba0326795059952500060532e29fb2d..51f8cb3ec750b35ede989b5ea4a52265ecbe5054 100644 (file)
@@ -14,7 +14,7 @@ LL |     v
 error: lifetime may not live long enough
   --> $DIR/variance-covariant-arg-object.rs:23:5
    |
-LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
+LL | fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
    |                     ----  ---- lifetime `'max` defined here
    |                     |
    |                     lifetime `'min` defined here
index 4a470cc646a741ab65404f52b4d41907c64bb6ff..7381b4130f8941877ad094c7ac6f7912f44e6ff3 100644 (file)
@@ -12,8 +12,8 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
     //~^ 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>>
+fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
+                                -> Box<dyn Get<&'max i32>>
     where 'max : 'min
 {
     v
index 8acd5417de76584c9ac48440217567c0a1d5c81c..9793a36be06ab1dd4fc4757f69571f3a4a991841 100644 (file)
@@ -14,7 +14,7 @@ LL |     v
 error: lifetime may not live long enough
   --> $DIR/variance-invariant-arg-object.rs:19:5
    |
-LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
+LL | fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
    |                     ----  ---- lifetime `'max` defined here
    |                     |
    |                     lifetime `'min` defined here