rust/tests/ui/mir/issue-76803-branches-not-same.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
233 B
Rust
Raw Normal View History

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