]> git.lizzy.rs Git - rust.git/blob - src/test/ui/variance/variance-use-contravariant-struct-1.stderr
Rollup merge of #59328 - koalatux:iter-nth-back, r=scottmcm
[rust.git] / src / test / ui / variance / variance-use-contravariant-struct-1.stderr
1 error[E0308]: mismatched types
2   --> $DIR/variance-use-contravariant-struct-1.rs:12:5
3    |
4 LL |     v
5    |     ^ lifetime mismatch
6    |
7    = note: expected type `SomeStruct<&'min ()>`
8               found type `SomeStruct<&'max ()>`
9 note: the lifetime 'min as defined on the function body at 8:8...
10   --> $DIR/variance-use-contravariant-struct-1.rs:8:8
11    |
12 LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
13    |        ^^^^
14 note: ...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    |
17 LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
18    |             ^^^^
19
20 error: aborting due to previous error
21
22 For more information about this error, try `rustc --explain E0308`.