Skip to content

Commit 0ef3d20

Browse files
authored
Rollup merge of rust-lang#147544 - cjgillot:nodeinit, r=saethlin
Remove StatementKind::Deinit. It is a remnant from the time we deaggreated MIR. Now, it is only constructed by the `LargeEnums` MIR pass, which is disabled by default.
2 parents fce1bea + b7c2b3d commit 0ef3d20

File tree

43 files changed

+14
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+14
-109
lines changed

compiler/rustc_borrowck/src/dataflow.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ impl<'tcx> rustc_mir_dataflow::Analysis<'tcx> for Borrows<'_, 'tcx> {
577577

578578
mir::StatementKind::FakeRead(..)
579579
| mir::StatementKind::SetDiscriminant { .. }
580-
| mir::StatementKind::Deinit(..)
581580
| mir::StatementKind::StorageLive(..)
582581
| mir::StatementKind::Retag { .. }
583582
| mir::StatementKind::PlaceMention(..)

compiler/rustc_borrowck/src/def_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub(crate) fn categorize(context: PlaceContext) -> Option<DefUse> {
8080
// Backwards incompatible drop hint is not a use, just a marker for linting.
8181
PlaceContext::NonUse(NonUseContext::BackwardIncompatibleDropHint) => None,
8282

83-
PlaceContext::MutatingUse(MutatingUseContext::Deinit | MutatingUseContext::SetDiscriminant) => {
83+
PlaceContext::MutatingUse(MutatingUseContext::SetDiscriminant) => {
8484
bug!("These statements are not allowed in this MIR phase")
8585
}
8686
}

compiler/rustc_borrowck/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,6 @@ impl<'a, 'tcx> ResultsVisitor<'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<'a,
857857
}
858858
StatementKind::Nop
859859
| StatementKind::Retag { .. }
860-
| StatementKind::Deinit(..)
861860
| StatementKind::SetDiscriminant { .. } => {
862861
bug!("Statement not allowed in this MIR phase")
863862
}

compiler/rustc_borrowck/src/polonius/legacy/loan_invalidations.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LoanInvalidationsGenerator<'a, 'tcx> {
8484
StatementKind::ConstEvalCounter
8585
| StatementKind::Nop
8686
| StatementKind::Retag { .. }
87-
| StatementKind::Deinit(..)
8887
| StatementKind::BackwardIncompatibleDropHint { .. }
8988
| StatementKind::SetDiscriminant { .. } => {
9089
bug!("Statement not allowed in this MIR phase")

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,6 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
748748
| StatementKind::BackwardIncompatibleDropHint { .. }
749749
| StatementKind::Nop => {}
750750
StatementKind::Intrinsic(box NonDivergingIntrinsic::CopyNonOverlapping(..))
751-
| StatementKind::Deinit(..)
752751
| StatementKind::SetDiscriminant { .. } => {
753752
bug!("Statement not allowed in this MIR phase")
754753
}

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,6 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
932932
}
933933
StatementKind::StorageLive(_)
934934
| StatementKind::StorageDead(_)
935-
| StatementKind::Deinit(_)
936935
| StatementKind::ConstEvalCounter
937936
| StatementKind::Nop
938937
| StatementKind::FakeRead(..)

compiler/rustc_codegen_cranelift/src/constant.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,6 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
597597
StatementKind::Assign(_)
598598
| StatementKind::FakeRead(_)
599599
| StatementKind::SetDiscriminant { .. }
600-
| StatementKind::Deinit(_)
601600
| StatementKind::StorageLive(_)
602601
| StatementKind::StorageDead(_)
603602
| StatementKind::Retag(_, _)

compiler/rustc_codegen_ssa/src/mir/analyze.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ impl<'a, 'b, 'tcx, Bx: BuilderMethods<'b, 'tcx>> Visitor<'tcx> for LocalAnalyzer
229229

230230
PlaceContext::MutatingUse(
231231
MutatingUseContext::Store
232-
| MutatingUseContext::Deinit
233232
| MutatingUseContext::SetDiscriminant
234233
| MutatingUseContext::AsmOutput
235234
| MutatingUseContext::Borrow

compiler/rustc_codegen_ssa/src/mir/statement.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
5050
mir::StatementKind::SetDiscriminant { box ref place, variant_index } => {
5151
self.codegen_place(bx, place.as_ref()).codegen_set_discr(bx, variant_index);
5252
}
53-
mir::StatementKind::Deinit(..) => {
54-
// For now, don't codegen this to anything. In the future it may be worth
55-
// experimenting with what kind of information we can emit to LLVM without hurting
56-
// perf here
57-
}
5853
mir::StatementKind::StorageLive(local) => {
5954
if let LocalRef::Place(cg_place) = self.locals[local] {
6055
cg_place.storage_live(bx);

compiler/rustc_const_eval/src/check_consts/check.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,6 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
732732
match statement.kind {
733733
StatementKind::Assign(..)
734734
| StatementKind::SetDiscriminant { .. }
735-
| StatementKind::Deinit(..)
736735
| StatementKind::FakeRead(..)
737736
| StatementKind::StorageLive(_)
738737
| StatementKind::StorageDead(_)

0 commit comments

Comments
 (0)