]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/region-invariant-static-error-reporting.base.stderr
Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha
[rust.git] / src / test / ui / regions / region-invariant-static-error-reporting.base.stderr
1 error[E0308]: `if` and `else` have incompatible types
2   --> $DIR/region-invariant-static-error-reporting.rs:21:9
3    |
4 LL |       let bad = if x.is_some() {
5    |  _______________-
6 LL | |         x.unwrap()
7    | |         ---------- expected because of this
8 LL | |     } else {
9 LL | |         mk_static()
10    | |         ^^^^^^^^^^^ lifetime mismatch
11 LL | |     };
12    | |_____- `if` and `else` have incompatible types
13    |
14    = note: expected struct `Invariant<'a>`
15               found struct `Invariant<'static>`
16 note: the lifetime `'a` as defined here...
17   --> $DIR/region-invariant-static-error-reporting.rs:17:10
18    |
19 LL | fn unify<'a>(x: Option<Invariant<'a>>, f: fn(Invariant<'a>)) {
20    |          ^^
21    = note: ...does not necessarily outlive the static lifetime
22
23 error: aborting due to previous error
24
25 For more information about this error, try `rustc --explain E0308`.