Skip to content

Commit c301120

Browse files
authored
Upgrade Rust toolchain to 2025-10-03 (#4393)
Relevant upstream PR: - rust-lang/rust#147055 (Turn ProjectionElem::Subtype into CastKind::Subtype) Resolves: #4392 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 ac33225 commit c301120

File tree

8 files changed

+12
-18
lines changed

8 files changed

+12
-18
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -627,15 +627,13 @@ impl GotocCtx<'_, '_> {
627627
self,
628628
)
629629
}
630-
ProjectionElem::OpaqueCast(ty) | ProjectionElem::Subtype(ty) => {
631-
ProjectedPlace::try_new(
632-
before.goto_expr.cast_to(self.codegen_ty_stable(*ty)),
633-
TypeOrVariant::Type(*ty),
634-
before.fat_ptr_goto_expr,
635-
before.fat_ptr_mir_typ,
636-
self,
637-
)
638-
}
630+
ProjectionElem::OpaqueCast(ty) => ProjectedPlace::try_new(
631+
before.goto_expr.cast_to(self.codegen_ty_stable(*ty)),
632+
TypeOrVariant::Type(*ty),
633+
before.fat_ptr_goto_expr,
634+
before.fat_ptr_mir_typ,
635+
self,
636+
),
639637
}
640638
}
641639

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ impl GotocCtx<'_, '_> {
794794
Rvalue::Cast(CastKind::PointerCoercion(k), e, t) => {
795795
self.codegen_pointer_cast(k, e, *t, loc)
796796
}
797-
Rvalue::Cast(CastKind::Transmute, operand, ty) => {
797+
Rvalue::Cast(CastKind::Transmute | CastKind::Subtype, operand, ty) => {
798798
let src_ty = operand.ty(self.current_fn().locals()).unwrap();
799799
// Transmute requires sized types.
800800
let src_sz = LayoutOf::new(src_ty).size_of().unwrap();

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ impl<'tcx> PointsToGraph<'tcx> {
163163
| ProjectionElem::Subslice { .. }
164164
| ProjectionElem::Downcast(..)
165165
| ProjectionElem::OpaqueCast(..)
166-
| ProjectionElem::Subtype(..)
167166
| ProjectionElem::UnwrapUnsafeBinder(..) => {
168167
/* There operations are no-ops w.r.t aliasing since we are tracking it on per-object basis. */
169168
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,6 @@ impl MirVisitor for CheckUninitVisitor {
488488
}
489489
ProjectionElem::Downcast(_) => {}
490490
ProjectionElem::OpaqueCast(_) => {}
491-
ProjectionElem::Subtype(_) => {}
492491
}
493492
}
494493
self.super_place(place, ptx, location)

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,6 @@ impl MirVisitor for CheckValueVisitor<'_, '_> {
549549
}
550550
ProjectionElem::Downcast(_) => {}
551551
ProjectionElem::OpaqueCast(_) => {}
552-
ProjectionElem::Subtype(_) => {}
553552
ProjectionElem::Index(_)
554553
| ProjectionElem::ConstantIndex { .. }
555554
| ProjectionElem::Subslice { .. } => { /* safe */ }
@@ -619,7 +618,7 @@ impl MirVisitor for CheckValueVisitor<'_, '_> {
619618
})
620619
}
621620
}
622-
CastKind::Transmute => {
621+
CastKind::Transmute | CastKind::Subtype => {
623622
debug!(?dest_ty, "transmute");
624623
// For transmute, we care about the destination type only.
625624
// This could be optimized to only add a check if the requirements of the
@@ -777,8 +776,7 @@ fn assignment_check_points(
777776
| ProjectionElem::ConstantIndex { .. }
778777
| ProjectionElem::Subslice { .. }
779778
| ProjectionElem::Downcast(_)
780-
| ProjectionElem::OpaqueCast(_)
781-
| ProjectionElem::Subtype(_) => ty = proj.ty(ty).unwrap(),
779+
| ProjectionElem::OpaqueCast(_) => ty = proj.ty(ty).unwrap(),
782780
};
783781
}
784782
invalid_ranges

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ impl RustcInternalMir for CastKind {
146146
CastKind::PtrToPtr => rustc_middle::mir::CastKind::PtrToPtr,
147147
CastKind::FnPtrToPtr => rustc_middle::mir::CastKind::FnPtrToPtr,
148148
CastKind::Transmute => rustc_middle::mir::CastKind::Transmute,
149+
CastKind::Subtype => rustc_middle::mir::CastKind::Subtype,
149150
}
150151
}
151152
}

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# SPDX-License-Identifier: Apache-2.0 OR MIT
33

44
[toolchain]
5-
channel = "nightly-2025-10-02"
5+
channel = "nightly-2025-10-03"
66
components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]

tools/scanner/src/analysis.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,6 @@ impl MirVisitor for BodyVisitor<'_> {
528528
}
529529
ProjectionElem::Downcast(_) => {}
530530
ProjectionElem::OpaqueCast(_) => {}
531-
ProjectionElem::Subtype(_) => {}
532531
ProjectionElem::Index(_)
533532
| ProjectionElem::ConstantIndex { .. }
534533
| ProjectionElem::Subslice { .. } => { /* safe */ }

0 commit comments

Comments
 (0)