Skip to content

Commit 9f230ba

Browse files
authored
Upgrade toolchain to 2024-07-19 (rust-lang#3364)
Resolves rust-lang#3358 Related upstream commits: - rust-lang@21dc49c587 ptr::metadata: avoid references to extern types
1 parent 0367992 commit 9f230ba

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

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

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,10 @@ impl<'tcx> GotocCtx<'tcx> {
703703
if meta.typ().sizeof(&self.symbol_table) == 0 {
704704
data_cast
705705
} else {
706-
let vtable_expr =
707-
meta.member("_vtable_ptr", &self.symbol_table).cast_to(
706+
let vtable_expr = meta
707+
.member("_vtable_ptr", &self.symbol_table)
708+
.member("pointer", &self.symbol_table)
709+
.cast_to(
708710
typ.lookup_field_type("vtable", &self.symbol_table).unwrap(),
709711
);
710712
dynamic_fat_ptr(typ, data_cast, vtable_expr, &self.symbol_table)
@@ -835,13 +837,29 @@ impl<'tcx> GotocCtx<'tcx> {
835837
dst_goto_typ.lookup_components(&self.symbol_table).unwrap();
836838
assert_eq!(dst_components.len(), 2);
837839
assert_eq!(dst_components[0].name(), "_vtable_ptr");
838-
assert!(dst_components[0].typ().is_pointer());
840+
assert!(dst_components[0].typ().is_struct_like());
839841
assert_eq!(dst_components[1].name(), "_phantom");
840842
self.assert_is_rust_phantom_data_like(&dst_components[1].typ());
843+
// accessing pointer type of _vtable_ptr, which is wrapped in NonNull
844+
let vtable_ptr_typ = dst_goto_typ
845+
.lookup_field_type("_vtable_ptr", &self.symbol_table)
846+
.unwrap()
847+
.lookup_components(&self.symbol_table)
848+
.unwrap()[0]
849+
.typ();
841850
Expr::struct_expr(
842-
dst_goto_typ,
851+
dst_goto_typ.clone(),
843852
btree_string_map![
844-
("_vtable_ptr", vtable_expr.cast_to(dst_components[0].typ())),
853+
(
854+
"_vtable_ptr",
855+
Expr::struct_expr_from_values(
856+
dst_goto_typ
857+
.lookup_field_type("_vtable_ptr", &self.symbol_table)
858+
.unwrap(),
859+
vec![vtable_expr.clone().cast_to(vtable_ptr_typ)],
860+
&self.symbol_table
861+
)
862+
),
845863
(
846864
"_phantom",
847865
Expr::struct_expr(

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-2024-07-18"
5+
channel = "nightly-2024-07-19"
66
components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]

0 commit comments

Comments
 (0)