Skip to content

Commit 497537a

Browse files
translate bid into nop for stable mir
1 parent 5a663a9 commit 497537a

File tree

3 files changed

+4
-26
lines changed

3 files changed

+4
-26
lines changed

compiler/rustc_smir/src/rustc_smir/convert/mir.rs

+3-17
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,9 @@ impl<'tcx> Stable<'tcx> for mir::StatementKind<'tcx> {
151151
mir::StatementKind::ConstEvalCounter => {
152152
stable_mir::mir::StatementKind::ConstEvalCounter
153153
}
154-
mir::StatementKind::BackwardIncompatibleDropHint { place, reason } => {
155-
stable_mir::mir::StatementKind::BackwardIncompatibleDropHint {
156-
place: place.stable(tables),
157-
reason: reason.stable(tables),
158-
}
154+
// BackwardIncompatibleDropHint has no semantics, so it is translated to Nop.
155+
mir::StatementKind::BackwardIncompatibleDropHint { .. } => {
156+
stable_mir::mir::StatementKind::Nop
159157
}
160158
mir::StatementKind::Nop => stable_mir::mir::StatementKind::Nop,
161159
}
@@ -451,18 +449,6 @@ impl<'tcx> Stable<'tcx> for mir::NonDivergingIntrinsic<'tcx> {
451449
}
452450
}
453451

454-
impl<'tcx> Stable<'tcx> for mir::BackwardIncompatibleDropReason {
455-
type T = stable_mir::mir::BackwardIncompatibleDropReason;
456-
457-
fn stable(&self, _tables: &mut Tables<'_>) -> Self::T {
458-
match self {
459-
mir::BackwardIncompatibleDropReason::Edition2024 => {
460-
stable_mir::mir::BackwardIncompatibleDropReason::Edition2024
461-
}
462-
}
463-
}
464-
}
465-
466452
impl<'tcx> Stable<'tcx> for mir::AssertMessage<'tcx> {
467453
type T = stable_mir::mir::AssertMessage;
468454
fn stable(&self, tables: &mut Tables<'_>) -> Self::T {

compiler/stable_mir/src/mir/body.rs

-6
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,9 @@ pub enum StatementKind {
448448
Coverage(Coverage),
449449
Intrinsic(NonDivergingIntrinsic),
450450
ConstEvalCounter,
451-
BackwardIncompatibleDropHint { place: Place, reason: BackwardIncompatibleDropReason },
452451
Nop,
453452
}
454453

455-
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
456-
pub enum BackwardIncompatibleDropReason {
457-
Edition2024,
458-
}
459-
460454
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
461455
pub enum Rvalue {
462456
/// Creates a pointer with the indicated mutability to the place.

compiler/stable_mir/src/mir/visit.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,7 @@ pub trait MirVisitor {
224224
self.visit_operand(count, location);
225225
}
226226
},
227-
StatementKind::BackwardIncompatibleDropHint { .. }
228-
| StatementKind::ConstEvalCounter
229-
| StatementKind::Nop => {}
227+
StatementKind::ConstEvalCounter | StatementKind::Nop => {}
230228
}
231229
}
232230

0 commit comments

Comments
 (0)