fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
812 B18 linesraw
1error: lifetime may not live long enough
2  --> $DIR/regions-variance-invariant-use-contravariant.rs:20:12
3   |
4LL | fn use_<'short,'long>(c: Invariant<'long>,
5   |         ------ ----- lifetime `'long` defined here
6   |         |
7   |         lifetime `'short` defined here
8...
9LL |     let _: Invariant<'short> = c;
10   |            ^^^^^^^^^^^^^^^^^ type annotation requires that `'short` must outlive `'long`
11   |
12   = help: consider adding the following bound: `'short: 'long`
13   = note: requirement occurs because of the type `Invariant<'_>`, which makes the generic argument `'_` invariant
14   = note: the struct `Invariant<'a>` is invariant over the parameter `'a`
15   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
16
17error: aborting due to previous error
18