summaryrefslogtreecommitdiffstats
path: root/src/test/mir-opt/76803_regression.rs
blob: 05dc3c97841099c6ff1741fcf55d5504eca1229a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// compile-flags: -Z mir-opt-level=1
// EMIT_MIR 76803_regression.encode.SimplifyBranchSame.diff

#[derive(Debug, Eq, PartialEq)]
pub enum Type {
    A,
    B,
}

pub fn encode(v: Type) -> Type {
    match v {
        Type::A => Type::B,
        _ => v,
    }
}

fn main() {
    assert_eq!(Type::B, encode(Type::A));
}