Skip to content

Commit ae2aa18

Browse files
committed
Auto merge of #97993 - lengyijun:clean-variance, r=compiler-errors
clean variance test Remove unnecessary generic parameter.
2 parents 37a4225 + 4bb0965 commit ae2aa18

6 files changed

+9
-9
lines changed

src/test/ui/variance/variance-contravariant-arg-object.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
1515
//~^ ERROR lifetime may not live long enough
1616
}
1717

18-
fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
19-
-> Box<dyn Get<&'max i32>>
18+
fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
19+
-> Box<dyn Get<&'max i32>>
2020
where 'max : 'min
2121
{
2222
// Previously OK:

src/test/ui/variance/variance-contravariant-arg-object.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | v
1414
error: lifetime may not live long enough
1515
--> $DIR/variance-contravariant-arg-object.rs:23:5
1616
|
17-
LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
17+
LL | fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
1818
| ---- ---- lifetime `'max` defined here
1919
| |
2020
| lifetime `'min` defined here

src/test/ui/variance/variance-covariant-arg-object.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
1616
//~^ ERROR lifetime may not live long enough
1717
}
1818

19-
fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
20-
-> Box<dyn Get<&'max i32>>
19+
fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
20+
-> Box<dyn Get<&'max i32>>
2121
where 'max : 'min
2222
{
2323
v

src/test/ui/variance/variance-covariant-arg-object.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | v
1414
error: lifetime may not live long enough
1515
--> $DIR/variance-covariant-arg-object.rs:23:5
1616
|
17-
LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
17+
LL | fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
1818
| ---- ---- lifetime `'max` defined here
1919
| |
2020
| lifetime `'min` defined here

src/test/ui/variance/variance-invariant-arg-object.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
1212
//~^ ERROR lifetime may not live long enough
1313
}
1414

15-
fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
16-
-> Box<dyn Get<&'max i32>>
15+
fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
16+
-> Box<dyn Get<&'max i32>>
1717
where 'max : 'min
1818
{
1919
v

src/test/ui/variance/variance-invariant-arg-object.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | v
1414
error: lifetime may not live long enough
1515
--> $DIR/variance-invariant-arg-object.rs:19:5
1616
|
17-
LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
17+
LL | fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
1818
| ---- ---- lifetime `'max` defined here
1919
| |
2020
| lifetime `'min` defined here

0 commit comments

Comments
 (0)