]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mir/issue-78496.rs
Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se
[rust.git] / src / test / ui / mir / issue-78496.rs
1 // run-pass
2 // compile-flags: -Z mir-opt-level=3 -C opt-level=0
3
4 // example from #78496
5 pub enum E<'a> {
6     Empty,
7     Some(&'a E<'a>),
8 }
9
10 fn f(e: &E) -> u32 {
11    if let E::Some(E::Some(_)) = e { 1 } else { 2 }
12 }
13
14 fn main() {
15    assert_eq!(f(&E::Empty), 2);
16 }