]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/regions-infer-invariance-due-to-decl.stderr
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / regions / regions-infer-invariance-due-to-decl.stderr
1 error: lifetime may not live long enough
2   --> $DIR/regions-infer-invariance-due-to-decl.rs:12:5
3    |
4 LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
5    |                       -- lifetime `'r` defined here
6 LL |     b_isize
7    |     ^^^^^^^ returning this value requires that `'r` must outlive `'static`
8    |
9    = note: requirement occurs because of the type `Invariant<'_>`, which makes the generic argument `'_` invariant
10    = note: the struct `Invariant<'a>` is invariant over the parameter `'a`
11    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
12
13 error: aborting due to previous error
14