Files
rust/tests/ui/regions/region-invariant-static-error-reporting.stderr

16 lines
663 B
Plaintext
Raw Normal View History

error: lifetime may not live long enough
--> $DIR/region-invariant-static-error-reporting.rs:16:9
|
LL | fn unify<'a>(x: Option<Invariant<'a>>, f: fn(Invariant<'a>)) {
| -- lifetime `'a` defined here
...
LL | mk_static()
| ^^^^^^^^^^^ assignment requires that `'a` must outlive `'static`
|
2022-04-02 15:32:39 -07:00
= note: requirement occurs because of the type `Invariant<'_>`, which makes the generic argument `'_` invariant
= note: the struct `Invariant<'a>` is invariant over the parameter `'a`
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
error: aborting due to 1 previous error