Skip to content

Commit 731dbe3

Browse files
Fix rebase fallout
1 parent 97d49ef commit 731dbe3

File tree

4 files changed

+34
-31
lines changed

4 files changed

+34
-31
lines changed

src/librustc_mir/transform/dest_prop.rs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -571,12 +571,17 @@ impl Conflicts<'a> {
571571

572572
fn record_terminator_conflicts(&mut self, term: &Terminator<'_>) {
573573
match &term.kind {
574-
TerminatorKind::DropAndReplace { location, value, target: _, unwind: _ } => {
574+
TerminatorKind::DropAndReplace {
575+
place: dropped_place,
576+
value,
577+
target: _,
578+
unwind: _,
579+
} => {
575580
if let Some(place) = value.place() {
576-
if !place.is_indirect() && !location.is_indirect() {
581+
if !place.is_indirect() && !dropped_place.is_indirect() {
577582
self.record_local_conflict(
578583
place.local,
579-
location.local,
584+
dropped_place.local,
580585
"DropAndReplace operand overlap",
581586
);
582587
}
@@ -599,6 +604,7 @@ impl Conflicts<'a> {
599604
destination: Some((dest_place, _)),
600605
cleanup: _,
601606
from_hir_call: _,
607+
fn_span: _,
602608
} => {
603609
// No arguments may overlap with the destination.
604610
for arg in args.iter().chain(Some(func)) {
@@ -687,7 +693,7 @@ impl Conflicts<'a> {
687693
InlineAsmOperand::Out { reg: _, late: _, place: None }
688694
| InlineAsmOperand::Const { value: _ }
689695
| InlineAsmOperand::SymFn { value: _ }
690-
| InlineAsmOperand::SymStatic { value: _ } => {}
696+
| InlineAsmOperand::SymStatic { def_id: _ } => {}
691697
}
692698
}
693699
}
@@ -703,7 +709,7 @@ impl Conflicts<'a> {
703709
| InlineAsmOperand::In { reg: _, value: _ }
704710
| InlineAsmOperand::Out { reg: _, late: _, place: None }
705711
| InlineAsmOperand::SymFn { value: _ }
706-
| InlineAsmOperand::SymStatic { value: _ } => {}
712+
| InlineAsmOperand::SymStatic { def_id: _ } => {}
707713
}
708714
}
709715
}
@@ -718,7 +724,7 @@ impl Conflicts<'a> {
718724
| TerminatorKind::Drop { .. }
719725
| TerminatorKind::Assert { .. }
720726
| TerminatorKind::GeneratorDrop
721-
| TerminatorKind::FalseEdges { .. }
727+
| TerminatorKind::FalseEdge { .. }
722728
| TerminatorKind::FalseUnwind { .. } => {}
723729
}
724730
}
@@ -745,7 +751,7 @@ impl Conflicts<'a> {
745751
}
746752

747753
/// Merges the conflicts of `a` and `b`, so that each one inherits all conflicts of the other.
748-
///
754+
///
749755
/// `can_unify` must have returned `true` for the same locals, or this may panic or lead to
750756
/// miscompiles.
751757
///
@@ -963,15 +969,15 @@ fn ever_borrowed_locals(body: &Body<'_>) -> BitSet<Local> {
963969
self.super_terminator(terminator, location);
964970

965971
match terminator.kind {
966-
TerminatorKind::Drop { location: dropped_place, .. }
967-
| TerminatorKind::DropAndReplace { location: dropped_place, .. } => {
972+
TerminatorKind::Drop { place: dropped_place, .. }
973+
| TerminatorKind::DropAndReplace { place: dropped_place, .. } => {
968974
self.locals.insert(dropped_place.local);
969975
}
970976

971977
TerminatorKind::Abort
972978
| TerminatorKind::Assert { .. }
973979
| TerminatorKind::Call { .. }
974-
| TerminatorKind::FalseEdges { .. }
980+
| TerminatorKind::FalseEdge { .. }
975981
| TerminatorKind::FalseUnwind { .. }
976982
| TerminatorKind::GeneratorDrop
977983
| TerminatorKind::Goto { .. }

src/test/mir-opt/dest-prop/simple/rustc.nrvo.DestinationPropagation.diff

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,18 @@
2828
StorageLive(_3); // scope 1 at $DIR/simple.rs:6:5: 6:19
2929
StorageLive(_4); // scope 1 at $DIR/simple.rs:6:5: 6:9
3030
_4 = _1; // scope 1 at $DIR/simple.rs:6:5: 6:9
31-
- StorageLive(_5); // scope 1 at $DIR/simple.rs:6:10: 6:18
32-
- StorageLive(_6); // scope 1 at $DIR/simple.rs:6:10: 6:18
31+
StorageLive(_5); // scope 1 at $DIR/simple.rs:6:10: 6:18
32+
StorageLive(_6); // scope 1 at $DIR/simple.rs:6:10: 6:18
3333
- _6 = &mut _2; // scope 1 at $DIR/simple.rs:6:10: 6:18
34-
- _5 = move _6; // scope 1 at $DIR/simple.rs:6:10: 6:18
35-
+ nop; // scope 1 at $DIR/simple.rs:6:10: 6:18
36-
+ nop; // scope 1 at $DIR/simple.rs:6:10: 6:18
37-
+ _5 = &mut _0; // scope 1 at $DIR/simple.rs:6:10: 6:18
38-
+ nop; // scope 1 at $DIR/simple.rs:6:10: 6:18
34+
+ _6 = &mut _0; // scope 1 at $DIR/simple.rs:6:10: 6:18
35+
_5 = &mut (*_6); // scope 1 at $DIR/simple.rs:6:10: 6:18
3936
_3 = move _4(move _5) -> bb1; // scope 1 at $DIR/simple.rs:6:5: 6:19
4037
}
4138

4239
bb1: {
43-
- StorageDead(_5); // scope 1 at $DIR/simple.rs:6:18: 6:19
44-
+ nop; // scope 1 at $DIR/simple.rs:6:18: 6:19
40+
StorageDead(_5); // scope 1 at $DIR/simple.rs:6:18: 6:19
4541
StorageDead(_4); // scope 1 at $DIR/simple.rs:6:18: 6:19
46-
- StorageDead(_6); // scope 1 at $DIR/simple.rs:6:19: 6:20
47-
+ nop; // scope 1 at $DIR/simple.rs:6:19: 6:20
42+
StorageDead(_6); // scope 1 at $DIR/simple.rs:6:19: 6:20
4843
StorageDead(_3); // scope 1 at $DIR/simple.rs:6:19: 6:20
4944
- _0 = _2; // scope 1 at $DIR/simple.rs:7:5: 7:8
5045
- StorageDead(_2); // scope 0 at $DIR/simple.rs:8:1: 8:2

src/test/mir-opt/nrvo-simple/rustc.nrvo.RenameReturnPlace.diff

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- // MIR for `nrvo` before RenameReturnPlace
22
+ // MIR for `nrvo` after RenameReturnPlace
3-
3+
44
fn nrvo(_1: for<'r> fn(&'r mut [u8; 1024])) -> [u8; 1024] {
55
debug init => _1; // in scope 0 at $DIR/nrvo-simple.rs:4:9: 4:13
66
- let mut _0: [u8; 1024]; // return place in scope 0 at $DIR/nrvo-simple.rs:4:39: 4:49
@@ -14,7 +14,7 @@
1414
- debug buf => _2; // in scope 1 at $DIR/nrvo-simple.rs:5:9: 5:16
1515
+ debug buf => _0; // in scope 1 at $DIR/nrvo-simple.rs:5:9: 5:16
1616
}
17-
17+
1818
bb0: {
1919
- StorageLive(_2); // scope 0 at $DIR/nrvo-simple.rs:5:9: 5:16
2020
- _2 = [const 0u8; 1024]; // scope 0 at $DIR/nrvo-simple.rs:5:19: 5:28
@@ -32,10 +32,10 @@
3232
StorageLive(_6); // scope 1 at $DIR/nrvo-simple.rs:6:10: 6:18
3333
- _6 = &mut _2; // scope 1 at $DIR/nrvo-simple.rs:6:10: 6:18
3434
+ _6 = &mut _0; // scope 1 at $DIR/nrvo-simple.rs:6:10: 6:18
35-
_5 = move _6; // scope 1 at $DIR/nrvo-simple.rs:6:10: 6:18
35+
_5 = &mut (*_6); // scope 1 at $DIR/nrvo-simple.rs:6:10: 6:18
3636
_3 = move _4(move _5) -> bb1; // scope 1 at $DIR/nrvo-simple.rs:6:5: 6:19
3737
}
38-
38+
3939
bb1: {
4040
StorageDead(_5); // scope 1 at $DIR/nrvo-simple.rs:6:18: 6:19
4141
StorageDead(_4); // scope 1 at $DIR/nrvo-simple.rs:6:18: 6:19
@@ -46,3 +46,4 @@
4646
return; // scope 0 at $DIR/nrvo-simple.rs:8:2: 8:2
4747
}
4848
}
49+

src/test/mir-opt/simplify_try/rustc.try_identity.SimplifyArmIdentity.diff

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- // MIR for `try_identity` before SimplifyArmIdentity
22
+ // MIR for `try_identity` after SimplifyArmIdentity
3-
3+
44
fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i32> {
55
debug x => _1; // in scope 0 at $DIR/simplify_try.rs:6:17: 6:18
66
let mut _0: std::result::Result<u32, i32>; // return place in scope 0 at $DIR/simplify_try.rs:6:41: 6:57
@@ -37,7 +37,7 @@
3737
scope 6 {
3838
debug self => _4; // in scope 6 at $SRC_DIR/libcore/result.rs:LL:COL
3939
}
40-
40+
4141
bb0: {
4242
StorageLive(_2); // scope 0 at $DIR/simplify_try.rs:7:9: 7:10
4343
StorageLive(_3); // scope 0 at $DIR/simplify_try.rs:7:13: 7:15
@@ -48,7 +48,7 @@
4848
_5 = discriminant(_3); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15
4949
switchInt(move _5) -> [0isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:7:14: 7:15
5050
}
51-
51+
5252
bb1: {
5353
- StorageLive(_10); // scope 0 at $DIR/simplify_try.rs:7:13: 7:15
5454
- _10 = ((_3 as Ok).0: u32); // scope 0 at $DIR/simplify_try.rs:7:13: 7:15
@@ -64,7 +64,7 @@
6464
StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:9:1: 9:2
6565
goto -> bb3; // scope 0 at $DIR/simplify_try.rs:9:2: 9:2
6666
}
67-
67+
6868
bb2: {
6969
- StorageLive(_6); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15
7070
- _6 = ((_3 as Err).0: i32); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15
@@ -83,10 +83,11 @@
8383
+ _0 = move _3; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
8484
StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:7:15: 7:16
8585
StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:9:1: 9:2
86-
goto -> bb3; // scope 0 at $DIR/simplify_try.rs:9:2: 9:2
86+
goto -> bb3; // scope 0 at $DIR/simplify_try.rs:7:14: 7:15
8787
}
88-
88+
8989
bb3: {
9090
return; // scope 0 at $DIR/simplify_try.rs:9:2: 9:2
9191
}
9292
}
93+

0 commit comments

Comments
 (0)