diff --git a/kani-compiler/src/codegen_cprover_gotoc/codegen/typ.rs b/kani-compiler/src/codegen_cprover_gotoc/codegen/typ.rs index 22c7fe469020..ce027e53da22 100644 --- a/kani-compiler/src/codegen_cprover_gotoc/codegen/typ.rs +++ b/kani-compiler/src/codegen_cprover_gotoc/codegen/typ.rs @@ -808,7 +808,7 @@ impl<'tcx, 'r> GotocCtx<'tcx, 'r> { let flds: Vec<_> = tys.iter().enumerate().map(|(i, t)| (GotocCtx::tuple_fld_name(i), *t)).collect(); // tuple cannot have other initial offset - self.codegen_struct_fields(flds, &layout.layout.0, Size::ZERO) + self.codegen_struct_fields(flds, &layout.layout, Size::ZERO) } /// A closure is a struct of all its environments. That is, a closure is @@ -980,7 +980,7 @@ impl<'tcx, 'r> GotocCtx<'tcx, 'r> { } fields.extend(ctx.codegen_alignment_padding( offset, - &type_and_layout.layout.0, + &type_and_layout.layout, fields.len(), )); fields @@ -1175,7 +1175,7 @@ impl<'tcx, 'r> GotocCtx<'tcx, 'r> { self.ensure_struct(self.ty_mangled_name(ty), self.ty_pretty_name(ty), |ctx, _| { let variant = &def.variants().raw[0]; let layout = ctx.layout_of(ty); - ctx.codegen_variant_struct_fields(variant, subst, &layout.layout.0, Size::ZERO) + ctx.codegen_variant_struct_fields(variant, subst, &layout.layout, Size::ZERO) }) } @@ -1293,7 +1293,7 @@ impl<'tcx, 'r> GotocCtx<'tcx, 'r> { Some(variant) => { // a single enum is pretty much like a struct let layout = gcx.layout_of(ty).layout; - gcx.codegen_variant_struct_fields(variant, subst, &layout.0, Size::ZERO) + gcx.codegen_variant_struct_fields(variant, subst, &layout, Size::ZERO) } } }) diff --git a/kani-compiler/src/kani_queries/mod.rs b/kani-compiler/src/kani_queries/mod.rs index 48b81195bda4..9c4d0d4e712a 100644 --- a/kani-compiler/src/kani_queries/mod.rs +++ b/kani-compiler/src/kani_queries/mod.rs @@ -20,6 +20,12 @@ pub struct QueryDb { kani_functions: OnceCell>, } +// SAFETY: QueryDb is always used behind Arc> which provides proper synchronization. +// The FnDef type from rustc_public is not Send due to ThreadLocalIndex, but we ensure +// it's only accessed within the appropriate rustc_public context and never actually sent +// between threads. +unsafe impl Send for QueryDb {} + impl QueryDb { pub fn new() -> Arc> { Arc::new(Mutex::new(QueryDb::default())) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7da603b766ee..3b5d2331220f 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -2,5 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 OR MIT [toolchain] -channel = "nightly-2025-11-20" +channel = "nightly-2025-11-21" components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]