diff options
| author | bors <bors@rust-lang.org> | 2025-07-06 19:58:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-07-06 19:58:07 +0000 |
| commit | a84ab0ce6c4557a2f01a3a6c3fdb0f92098db78d (patch) | |
| tree | 6d4af5e6246009b37138160c05c8196af0c71b2b /compiler/rustc_mir_transform/src | |
| parent | de031bbcb161b0b7fc0eb16f77b02ce9fbdf4c9e (diff) | |
| parent | b1fdb4bdc8818aced53e46a34a3e92cfcfcc8ece (diff) | |
| download | rust-a84ab0ce6c4557a2f01a3a6c3fdb0f92098db78d.tar.gz rust-a84ab0ce6c4557a2f01a3a6c3fdb0f92098db78d.zip | |
Auto merge of #143509 - cjgillot:copy-prop-noborrow, r=tmiasko
Do not unify borrowed locals in CopyProp. Instead of trying yet another scheme to unify borrowed locals in CopyProp, let's just stop trying. We had already enough miscompilations because of this. I'm convinced it's possible to have both unification of some borrowed locals and soundness, but I don't have a simple and convincing formulation yet. Fixes https://github.com/rust-lang/rust/issues/143491
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/ssa.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/ssa.rs b/compiler/rustc_mir_transform/src/ssa.rs index 03b6f9b7ff3..d3b4b99e932 100644 --- a/compiler/rustc_mir_transform/src/ssa.rs +++ b/compiler/rustc_mir_transform/src/ssa.rs @@ -322,8 +322,8 @@ fn compute_copy_classes(ssa: &mut SsaLocals, body: &Body<'_>) { // visited before `local`, and we just have to copy the representing local. let head = copies[rhs]; - // Do not unify two borrowed locals. - if borrowed_classes.contains(local) && borrowed_classes.contains(head) { + // Do not unify borrowed locals. + if borrowed_classes.contains(local) || borrowed_classes.contains(head) { continue; } |
