Skip to content

Commit d77fa4f

Browse files
authored
Upgrade Rust toolchain to 2025-10-12 (#4407)
Relevant upstream PR: - rust-lang/rust#147544 (Remove StatementKind::Deinit.) Resolves: #4406 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
1 parent f551d7b commit d77fa4f

File tree

11 files changed

+1
-57
lines changed

11 files changed

+1
-57
lines changed

cprover_bindings/src/goto_program/expr.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,11 +1687,6 @@ impl Expr {
16871687
Stmt::assign(self, rhs, loc)
16881688
}
16891689

1690-
/// Shorthand to build a `Deinit(self)` statement. See `StmtBody::Deinit`
1691-
pub fn deinit(self, loc: Location) -> Stmt {
1692-
Stmt::deinit(self, loc)
1693-
}
1694-
16951690
/// `if (self) { t } else { e }` or `if (self) { t }`
16961691
pub fn if_then_else(self, t: Stmt, e: Option<Stmt>, loc: Location) -> Stmt {
16971692
Stmt::if_then_else(self, t, e, loc)

cprover_bindings/src/goto_program/stmt.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ pub enum StmtBody {
6464
lhs: Expr, // SymbolExpr
6565
value: Option<Expr>,
6666
},
67-
/// Marks the target place as uninitialized.
68-
Deinit(Expr),
6967
/// `e;`
7068
Expression(Expr),
7169
// `for (init; cond; update) {body}`
@@ -252,11 +250,6 @@ impl Stmt {
252250
stmt!(Decl { lhs, value }, loc)
253251
}
254252

255-
/// `Deinit(place)`, see `StmtBody::Deinit`.
256-
pub fn deinit(place: Expr, loc: Location) -> Self {
257-
stmt!(Deinit(place), loc)
258-
}
259-
260253
/// `e;`
261254
pub fn code_expression(e: Expr, loc: Location) -> Self {
262255
stmt!(Expression(e), loc)

cprover_bindings/src/irep/to_irep.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -541,13 +541,6 @@ impl ToIrep for StmtBody {
541541
code_irep(IrepId::Decl, vec![lhs.to_irep(mm)])
542542
}
543543
}
544-
StmtBody::Deinit(place) => {
545-
// CBMC doesn't yet have a notion of poison (https://github.com/diffblue/cbmc/issues/7014)
546-
// So we translate identically to `nondet` here, but add a comment noting we wish it were poison
547-
// potentially for other backends to pick up and treat specially.
548-
code_irep(IrepId::Assign, vec![place.to_irep(mm), place.typ().nondet().to_irep(mm)])
549-
.with_comment("deinit")
550-
}
551544
StmtBody::Expression(e) => code_irep(IrepId::Expression, vec![e.to_irep(mm)]),
552545
StmtBody::For { init, cond, update, body } => code_irep(
553546
IrepId::For,

kani-compiler/src/codegen_cprover_gotoc/codegen/statement.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ impl GotocCtx<'_, '_> {
129129
.assign(self.codegen_rvalue_stable(rhs, location), location)
130130
}
131131
}
132-
StatementKind::Deinit(place) => self.codegen_deinit(place, location),
133132
StatementKind::SetDiscriminant { place, variant_index } => {
134133
let dest_ty = self.place_ty_stable(place);
135134
let dest_expr = unwrap_or_return_codegen_unimplemented_stmt!(
@@ -444,27 +443,6 @@ impl GotocCtx<'_, '_> {
444443
}
445444
}
446445

447-
/// From rustc doc: "This writes `uninit` bytes to the entire place."
448-
/// Our model of GotoC has a similar statement, which is later lowered
449-
/// to assigning a Nondet in CBMC, with a comment specifying that it
450-
/// corresponds to a Deinit.
451-
fn codegen_deinit(&mut self, place: &Place, loc: Location) -> Stmt {
452-
let dst_mir_ty = self.place_ty_stable(place);
453-
let dst_type = self.codegen_ty_stable(dst_mir_ty);
454-
let layout = self.layout_of_stable(dst_mir_ty);
455-
if layout.is_zst() || dst_type.sizeof_in_bits(&self.symbol_table) == 0 {
456-
// We ignore assignment for all zero size types
457-
Stmt::skip(loc)
458-
} else {
459-
unwrap_or_return_codegen_unimplemented_stmt!(
460-
self,
461-
self.codegen_place_stable(place, loc)
462-
)
463-
.goto_expr
464-
.deinit(loc)
465-
}
466-
}
467-
468446
/// A special case handler to codegen `return ();`
469447
fn codegen_ret_unit(&mut self, loc: Location) -> Stmt {
470448
let is_file_local = false;

kani-compiler/src/kani_middle/analysis.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ impl From<&Statement> for Key {
123123
fn from(value: &Statement) -> Self {
124124
match value.kind {
125125
StatementKind::Assign(..) => Key("Assign"),
126-
StatementKind::Deinit(_) => Key("Deinit"),
127126
StatementKind::Intrinsic(_) => Key("Intrinsic"),
128127
StatementKind::SetDiscriminant { .. } => Key("SetDiscriminant"),
129128
// For now, we don't care about the ones below.

kani-compiler/src/kani_middle/points_to/points_to_analysis.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ impl<'tcx> Analysis<'tcx> for PointsToAnalysis<'_, 'tcx> {
171171
}
172172
StatementKind::FakeRead(..)
173173
| StatementKind::SetDiscriminant { .. }
174-
| StatementKind::Deinit(..)
175174
| StatementKind::StorageLive(..)
176175
| StatementKind::StorageDead(..)
177176
| StatementKind::Retag(..)

kani-compiler/src/kani_middle/transform/body.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ pub trait MutMirVisitor {
569569
},
570570
StatementKind::FakeRead(_, _)
571571
| StatementKind::SetDiscriminant { .. }
572-
| StatementKind::Deinit(_)
573572
| StatementKind::StorageLive(_)
574573
| StatementKind::StorageDead(_)
575574
| StatementKind::Retag(_, _)

kani-compiler/src/kani_middle/transform/check_uninit/ptr_uninit/uninit_visitor.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,6 @@ impl MirVisitor for CheckUninitVisitor {
220220
}
221221
}
222222
}
223-
StatementKind::Deinit(place) => {
224-
self.super_statement(stmt, location);
225-
self.push_target(MemoryInitOp::Set {
226-
operand: Operand::Copy(place.clone()),
227-
value: false,
228-
position: InsertPosition::After,
229-
});
230-
}
231223
StatementKind::FakeRead(_, _)
232224
| StatementKind::SetDiscriminant { .. }
233225
| StatementKind::StorageLive(_)

kani-compiler/src/kani_middle/transform/check_values.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ impl MirVisitor for CheckValueVisitor<'_, '_> {
411411
}
412412
StatementKind::FakeRead(_, _)
413413
| StatementKind::SetDiscriminant { .. }
414-
| StatementKind::Deinit(_)
415414
| StatementKind::StorageLive(_)
416415
| StatementKind::StorageDead(_)
417416
| StatementKind::Retag(_, _)

kani-compiler/src/kani_middle/transform/internal_mir.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,6 @@ impl RustcInternalMir for StatementKind {
381381
variant_index: internal(tcx, variant_index),
382382
}
383383
}
384-
StatementKind::Deinit(place) => {
385-
rustc_middle::mir::StatementKind::Deinit(internal(tcx, place).into())
386-
}
387384
StatementKind::StorageLive(local) => rustc_middle::mir::StatementKind::StorageLive(
388385
rustc_middle::mir::Local::from_usize(*local),
389386
),

0 commit comments

Comments
 (0)