Skip to content

Commit 91e5a0e

Browse files
committed
cleanup fixup
1 parent 2ae4287 commit 91e5a0e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/librustc_mir/transform/simplify_try.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,21 @@ impl<'tcx> MirPass<'tcx> for SimplifyArmIdentity {
4040
[s0, s1, s2] => (s0, s1, s2),
4141
_ => continue,
4242
};
43-
debug!("SimplifyArmIdentity - found three stmts");
4443

4544
// Pattern match on the form we want:
4645
let (local_tmp_s0, local_1, vf_s0) = match match_get_variant_field(s0) {
4746
None => continue,
4847
Some(x) => x,
4948
};
50-
debug!("SimplifyArmIdentity - get");
5149
let (local_tmp_s1, local_0, vf_s1) = match match_set_variant_field(s1) {
5250
None => continue,
5351
Some(x) => x,
5452
};
55-
debug!("SimplifyArmIdentity - set");
56-
if local_tmp_s0 != local_tmp_s1 || vf_s0 != vf_s1 {
53+
if (local_tmp_s0, vf_s0) != (local_tmp_s1, vf_s1)
54+
|| Some((local_0, vf_s0.var_idx)) != match_set_discr(s2)
55+
{
5756
continue;
5857
}
59-
if Some((local_0, vf_s0.var_idx)) != match_set_discr(s2) {
60-
continue;
61-
}
62-
debug!("SimplifyArmIdentity - set_discr");
6358

6459
// Right shape; transform!
6560
match &mut s0.kind {

0 commit comments

Comments
 (0)