Rollup merge of #69051 - Centril:st-fixes, r=eddyb
simplify_try: address some of eddyb's comments Addresses only https://github.com/rust-lang/rust/pull/66282#discussion_r376730986 and https://github.com/rust-lang/rust/pull/66282#discussion_r376730824. r? @eddyb cc @oli-obk
This commit is contained in:
commit
e0ea1e759f
@ -52,6 +52,8 @@ impl<'tcx> MirPass<'tcx> for SimplifyArmIdentity {
|
||||
Some(x) => x,
|
||||
};
|
||||
if local_tmp_s0 != local_tmp_s1
|
||||
// Avoid moving into ourselves.
|
||||
|| local_0 == local_1
|
||||
// The field-and-variant information match up.
|
||||
|| vf_s0 != vf_s1
|
||||
// Source and target locals have the same type.
|
||||
@ -64,6 +66,7 @@ impl<'tcx> MirPass<'tcx> for SimplifyArmIdentity {
|
||||
}
|
||||
|
||||
// Right shape; transform!
|
||||
s0.source_info = s2.source_info;
|
||||
match &mut s0.kind {
|
||||
StatementKind::Assign(box (place, rvalue)) => {
|
||||
*place = local_0.into();
|
||||
|
Loading…
x
Reference in New Issue
Block a user