summaryrefslogtreecommitdiffstats
path: root/src/test/ui/mir/issue-76803-branches-not-same.rs
blob: a6a57622005482df640ecc47c5e62f523300cce8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// run-pass

#[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));
}