Skip to content

Commit d77bb0f

Browse files
committed
Update toolchain to 2/1 - functionality changes
- vtable changes: rust-lang/rust#135318 - NullPointerDereference changes: rust-lang/rust#134424
1 parent 1c0db81 commit d77bb0f

File tree

7 files changed

+19
-12
lines changed

7 files changed

+19
-12
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,8 +1505,10 @@ impl GotocCtx<'_> {
15051505
|ctx, var| {
15061506
// Build the vtable, using Rust's vtable_entries to determine field order
15071507
let vtable_entries = if let Some(principal) = trait_type.kind().trait_principal() {
1508-
let trait_ref_binder = principal.with_self_ty(src_mir_type);
1509-
ctx.tcx.vtable_entries(rustc_internal::internal(ctx.tcx, trait_ref_binder))
1508+
let trait_ref =
1509+
rustc_internal::internal(ctx.tcx, principal.with_self_ty(src_mir_type));
1510+
let trait_ref = ctx.tcx.instantiate_bound_regions_with_erased(trait_ref);
1511+
ctx.tcx.vtable_entries(trait_ref)
15101512
} else {
15111513
TyCtxt::COMMON_VTABLE_ENTRIES
15121514
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ impl<'tcx> GotocCtx<'tcx> {
371371
// The virtual methods on the trait ref. Some auto traits have no methods.
372372
if let Some(principal) = binder.principal() {
373373
let poly = principal.with_self_ty(self.tcx, t);
374+
let poly = self.tcx.instantiate_bound_regions_with_erased(poly);
374375
let poly = self.tcx.erase_regions(poly);
375376
let mut flds = self
376377
.tcx

kani-compiler/src/kani_middle/reachability.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ impl MonoItemsFnCollector<'_, '_> {
256256
// A trait object type can have multiple trait bounds but up to one non-auto-trait
257257
// bound. This non-auto-trait, named principal, is the only one that can have methods.
258258
// https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
259-
let poly_trait_ref = principal.with_self_ty(concrete_ty);
259+
let trait_ref = rustc_internal::internal(self.tcx, principal.with_self_ty(concrete_ty));
260+
let trait_ref = self.tcx.instantiate_bound_regions_with_erased(trait_ref);
260261

261262
// Walk all methods of the trait, including those of its supertraits
262-
let entries =
263-
self.tcx.vtable_entries(rustc_internal::internal(self.tcx, &poly_trait_ref));
263+
let entries = self.tcx.vtable_entries(trait_ref);
264264
let methods = entries.iter().filter_map(|entry| match entry {
265265
VtblEntry::MetadataAlign
266266
| VtblEntry::MetadataDropInPlace

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,9 @@ impl RustcInternalMir for AssertMessage {
558558
found: found.internal_mir(tcx),
559559
}
560560
}
561+
AssertMessage::NullPointerDereference => {
562+
rustc_middle::mir::AssertMessage::NullPointerDereference
563+
}
561564
}
562565
}
563566
}

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-01-29"
5+
channel = "nightly-2025-02-01"
66
components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]

tests/expected/uninit/multiple-instrumentations.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
multiple_instrumentations_different_vars.assertion.3\
1+
multiple_instrumentations_different_vars.assertion\
22
- Status: FAILURE\
33
- Description: "Undefined Behavior: Reading from an uninitialized pointer of type `u128`"
44

5-
multiple_instrumentations_different_vars.assertion.4\
5+
multiple_instrumentations_different_vars.assertion\
66
- Status: FAILURE\
77
- Description: "Undefined Behavior: Reading from an uninitialized pointer of type `u64`"
88

9-
multiple_instrumentations.assertion.2\
9+
multiple_instrumentations.assertion\
1010
- Status: FAILURE\
1111
- Description: "Undefined Behavior: Reading from an uninitialized pointer of type `u128`"
1212

13-
multiple_instrumentations.assertion.3\
13+
multiple_instrumentations.assertion\
1414
- Status: FAILURE\
1515
- Description: "Undefined Behavior: Reading from an uninitialized pointer of type `u128`"
1616

tests/expected/zst/expected

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Status: FAILURE\
2-
Description: "dereference failure: pointer NULL"
1+
assertion\
2+
- Status: FAILURE\
3+
- Description: "null pointer dereference occured"
34

45
VERIFICATION:- FAILED

0 commit comments

Comments
 (0)