fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.5 KiB41 linesraw
1error[E0308]: mismatched types
2  --> $DIR/variance-invariant-arg-object.rs:11:5
3   |
4LL |     v
5   |     ^ lifetime mismatch
6   |
7   = note: expected trait object `dyn Get<&'min i32>`
8              found trait object `dyn Get<&'max i32>`
9note: the lifetime `'min` as defined on the function body at 7:21...
10  --> $DIR/variance-invariant-arg-object.rs:7:21
11   |
12LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
13   |                     ^^^^
14note: ...does not necessarily outlive the lifetime `'max` as defined on the function body at 7:27
15  --> $DIR/variance-invariant-arg-object.rs:7:27
16   |
17LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
18   |                           ^^^^
19
20error[E0308]: mismatched types
21  --> $DIR/variance-invariant-arg-object.rs:18:5
22   |
23LL |     v
24   |     ^ lifetime mismatch
25   |
26   = note: expected trait object `dyn Get<&'max i32>`
27              found trait object `dyn Get<&'min i32>`
28note: the lifetime `'min` as defined on the function body at 14:21...
29  --> $DIR/variance-invariant-arg-object.rs:14:21
30   |
31LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
32   |                     ^^^^
33note: ...does not necessarily outlive the lifetime `'max` as defined on the function body at 14:27
34  --> $DIR/variance-invariant-arg-object.rs:14:27
35   |
36LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
37   |                           ^^^^
38
39error: aborting due to 2 previous errors
40
41For more information about this error, try `rustc --explain E0308`.