]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/76803_regression.rs
Rollup merge of #106928 - bvanjoi:print-keyword-raw-identifier, r=petrochenkov
[rust.git] / tests / mir-opt / 76803_regression.rs
1 // compile-flags: -Z mir-opt-level=1
2 // EMIT_MIR 76803_regression.encode.SimplifyBranchSame.diff
3
4 #[derive(Debug, Eq, PartialEq)]
5 pub enum Type {
6     A,
7     B,
8 }
9
10 pub fn encode(v: Type) -> Type {
11     match v {
12         Type::A => Type::B,
13         _ => v,
14     }
15 }
16
17 fn main() {
18     assert_eq!(Type::B, encode(Type::A));
19 }