mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
Auto merge of #97993 - lengyijun:clean-variance, r=compiler-errors
clean variance test Remove unnecessary generic parameter.
This commit is contained in:
commit
ae2aa18d74
@ -15,8 +15,8 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
|
|||||||
//~^ ERROR lifetime may not live long enough
|
//~^ ERROR lifetime may not live long enough
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
|
fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
|
||||||
-> Box<dyn Get<&'max i32>>
|
-> Box<dyn Get<&'max i32>>
|
||||||
where 'max : 'min
|
where 'max : 'min
|
||||||
{
|
{
|
||||||
// Previously OK:
|
// Previously OK:
|
||||||
|
@ -14,7 +14,7 @@ LL | v
|
|||||||
error: lifetime may not live long enough
|
error: lifetime may not live long enough
|
||||||
--> $DIR/variance-contravariant-arg-object.rs:23:5
|
--> $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 `'max` defined here
|
||||||
| |
|
| |
|
||||||
| lifetime `'min` defined here
|
| lifetime `'min` defined here
|
||||||
|
@ -16,8 +16,8 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
|
|||||||
//~^ ERROR lifetime may not live long enough
|
//~^ ERROR lifetime may not live long enough
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
|
fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
|
||||||
-> Box<dyn Get<&'max i32>>
|
-> Box<dyn Get<&'max i32>>
|
||||||
where 'max : 'min
|
where 'max : 'min
|
||||||
{
|
{
|
||||||
v
|
v
|
||||||
|
@ -14,7 +14,7 @@ LL | v
|
|||||||
error: lifetime may not live long enough
|
error: lifetime may not live long enough
|
||||||
--> $DIR/variance-covariant-arg-object.rs:23:5
|
--> $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 `'max` defined here
|
||||||
| |
|
| |
|
||||||
| lifetime `'min` defined here
|
| lifetime `'min` defined here
|
||||||
|
@ -12,8 +12,8 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
|
|||||||
//~^ ERROR lifetime may not live long enough
|
//~^ ERROR lifetime may not live long enough
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
|
fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
|
||||||
-> Box<dyn Get<&'max i32>>
|
-> Box<dyn Get<&'max i32>>
|
||||||
where 'max : 'min
|
where 'max : 'min
|
||||||
{
|
{
|
||||||
v
|
v
|
||||||
|
@ -14,7 +14,7 @@ LL | v
|
|||||||
error: lifetime may not live long enough
|
error: lifetime may not live long enough
|
||||||
--> $DIR/variance-invariant-arg-object.rs:19:5
|
--> $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 `'max` defined here
|
||||||
| |
|
| |
|
||||||
| lifetime `'min` defined here
|
| lifetime `'min` defined here
|
||||||
|
Loading…
Reference in New Issue
Block a user