1 error[E0308]: `if` and `else` have incompatible types
2 --> $DIR/region-invariant-static-error-reporting.rs:21:9
4 LL | let bad = if x.is_some() {
7 | | ---------- expected because of this
10 | | ^^^^^^^^^^^ lifetime mismatch
12 | |_____- `if` and `else` have incompatible types
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
19 LL | fn unify<'a>(x: Option<Invariant<'a>>, f: fn(Invariant<'a>)) {
21 = note: ...does not necessarily outlive the static lifetime
23 error: aborting due to previous error
25 For more information about this error, try `rustc --explain E0308`.