rust/tests/ui/mir/issue-76803-branches-not-same.rs
2023-01-11 09:32:08 +00:00

20 lines
233 B
Rust

// 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));
}