rust/src/test/ui/variance/variance-invariant-arg-obje...

42 lines
1.4 KiB
Plaintext
Raw Normal View History

2018-08-08 14:28:26 +02:00
error[E0308]: mismatched types
2018-12-25 16:56:47 +01:00
--> $DIR/variance-invariant-arg-object.rs:11:5
2018-08-08 14:28:26 +02:00
|
2019-03-09 13:03:44 +01:00
LL | v
2018-08-08 14:28:26 +02:00
| ^ lifetime mismatch
|
= note: expected type `dyn Get<&'min i32>`
found type `dyn Get<&'max i32>`
2018-12-25 16:56:47 +01:00
note: the lifetime 'min as defined on the function body at 7:21...
--> $DIR/variance-invariant-arg-object.rs:7:21
2018-08-08 14:28:26 +02:00
|
LL | fn get_min_from_max<'min, 'max>(v: Box<Get<&'max i32>>)
| ^^^^
2018-12-25 16:56:47 +01:00
note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 7:27
--> $DIR/variance-invariant-arg-object.rs:7:27
2018-08-08 14:28:26 +02:00
|
LL | fn get_min_from_max<'min, 'max>(v: Box<Get<&'max i32>>)
| ^^^^
error[E0308]: mismatched types
2018-12-25 16:56:47 +01:00
--> $DIR/variance-invariant-arg-object.rs:18:5
2018-08-08 14:28:26 +02:00
|
2019-03-09 13:03:44 +01:00
LL | v
2018-08-08 14:28:26 +02:00
| ^ lifetime mismatch
|
= note: expected type `dyn Get<&'max i32>`
found type `dyn Get<&'min i32>`
2018-12-25 16:56:47 +01:00
note: the lifetime 'min as defined on the function body at 14:21...
--> $DIR/variance-invariant-arg-object.rs:14:21
2018-08-08 14:28:26 +02:00
|
LL | fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>)
| ^^^^
2018-12-25 16:56:47 +01:00
note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 14:27
--> $DIR/variance-invariant-arg-object.rs:14:27
2018-08-08 14:28:26 +02:00
|
LL | fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>)
| ^^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.