We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc4242d commit ebbaf46Copy full SHA for ebbaf46
src/librustc_mir/transform/simplify_try.rs
@@ -52,6 +52,8 @@ impl<'tcx> MirPass<'tcx> for SimplifyArmIdentity {
52
Some(x) => x,
53
};
54
if local_tmp_s0 != local_tmp_s1
55
+ // Avoid moving into ourselves.
56
+ || local_0 == local_1
57
// The field-and-variant information match up.
58
|| vf_s0 != vf_s1
59
// Source and target locals have the same type.
@@ -64,6 +66,7 @@ impl<'tcx> MirPass<'tcx> for SimplifyArmIdentity {
64
66
}
65
67
68
// Right shape; transform!
69
+ s0.source_info = s2.source_info;
70
match &mut s0.kind {
71
StatementKind::Assign(box (place, rvalue)) => {
72
*place = local_0.into();
0 commit comments