fork/rust

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

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

1.44.0
764 B22 linesraw
1error[E0308]: mismatched types
2  --> $DIR/variance-use-contravariant-struct-1.rs:12:5
3   |
4LL |     v
5   |     ^ lifetime mismatch
6   |
7   = note: expected struct `SomeStruct<&'min ()>`
8              found struct `SomeStruct<&'max ()>`
9note: the lifetime `'min` as defined on the function body at 8:8...
10  --> $DIR/variance-use-contravariant-struct-1.rs:8:8
11   |
12LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
13   |        ^^^^
14note: ...does not necessarily outlive the lifetime `'max` as defined on the function body at 8:13
15  --> $DIR/variance-use-contravariant-struct-1.rs:8:13
16   |
17LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
18   |             ^^^^
19
20error: aborting due to previous error
21
22For more information about this error, try `rustc --explain E0308`.