cleanup fixup · rust-lang/rust@91e5a0e (original) (raw)
File tree
1 file changed
lines changed
- src/librustc_mir/transform
1 file changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -40,26 +40,21 @@ impl<'tcx> MirPass<'tcx> for SimplifyArmIdentity { | ||
40 | 40 | [s0, s1, s2] => (s0, s1, s2), |
41 | 41 | _ => continue, |
42 | 42 | }; |
43 | -debug!("SimplifyArmIdentity - found three stmts"); | |
44 | 43 | |
45 | 44 | // Pattern match on the form we want: |
46 | 45 | let (local_tmp_s0, local_1, vf_s0) = match match_get_variant_field(s0) { |
47 | 46 | None => continue, |
48 | 47 | Some(x) => x, |
49 | 48 | }; |
50 | -debug!("SimplifyArmIdentity - get"); | |
51 | 49 | let (local_tmp_s1, local_0, vf_s1) = match match_set_variant_field(s1) { |
52 | 50 | None => continue, |
53 | 51 | Some(x) => x, |
54 | 52 | }; |
55 | -debug!("SimplifyArmIdentity - set"); | |
56 | -if local_tmp_s0 != local_tmp_s1 | | |
53 | +if (local_tmp_s0, vf_s0) != (local_tmp_s1, vf_s1) | |
54 | + | | |
55 | +{ | |
57 | 56 | continue; |
58 | 57 | } |
59 | -if Some((local_0, vf_s0.var_idx)) != match_set_discr(s2) { | |
60 | -continue; | |
61 | -} | |
62 | -debug!("SimplifyArmIdentity - set_discr"); | |
63 | 58 | |
64 | 59 | // Right shape; transform! |
65 | 60 | match &mut s0.kind { |