diff --git a/kani-compiler/src/codegen_aeneas_llbc/mir_to_ullbc/mod.rs b/kani-compiler/src/codegen_aeneas_llbc/mir_to_ullbc/mod.rs index 7b44ff4ca62..22b5ef18b5a 100644 --- a/kani-compiler/src/codegen_aeneas_llbc/mir_to_ullbc/mod.rs +++ b/kani-compiler/src/codegen_aeneas_llbc/mir_to_ullbc/mod.rs @@ -2363,17 +2363,19 @@ pub fn prepare_translated_crate(tcx: TyCtxt, translated: &mut CharonTranslatedCr // As in Charon's `register_target_info`. let target_data = &tcx.data_layout; + // The alignment of `i8` is not part of the data layout (it is always 1). + let i8_align = rustc_abi::Integer::I8.align(target_data).bytes(); let mut primitive_alignments = charon_lib::ast::SeqHashMap::new(); - primitive_alignments.insert(CharonLiteralTy::Bool, target_data.i8_align.bytes()); + primitive_alignments.insert(CharonLiteralTy::Bool, i8_align); let int = |ty| CharonLiteralTy::Integer(ty); for (ty, alignment) in [ - (CharonIntegerTy::Signed(CharonIntTy::I8), target_data.i8_align.bytes()), + (CharonIntegerTy::Signed(CharonIntTy::I8), i8_align), (CharonIntegerTy::Signed(CharonIntTy::I16), target_data.i16_align.bytes()), (CharonIntegerTy::Signed(CharonIntTy::I32), target_data.i32_align.bytes()), (CharonIntegerTy::Signed(CharonIntTy::I64), target_data.i64_align.bytes()), (CharonIntegerTy::Signed(CharonIntTy::I128), target_data.i128_align.bytes()), (CharonIntegerTy::Signed(CharonIntTy::Isize), target_data.pointer_align().bytes()), - (CharonIntegerTy::Unsigned(CharonUIntTy::U8), target_data.i8_align.bytes()), + (CharonIntegerTy::Unsigned(CharonUIntTy::U8), i8_align), (CharonIntegerTy::Unsigned(CharonUIntTy::U16), target_data.i16_align.bytes()), (CharonIntegerTy::Unsigned(CharonUIntTy::U32), target_data.i32_align.bytes()), (CharonIntegerTy::Unsigned(CharonUIntTy::U64), target_data.i64_align.bytes()), diff --git a/kani-compiler/src/kani_middle/attributes.rs b/kani-compiler/src/kani_middle/attributes.rs index 84d53b6df55..72d547ca00a 100644 --- a/kani-compiler/src/kani_middle/attributes.rs +++ b/kani-compiler/src/kani_middle/attributes.rs @@ -50,7 +50,9 @@ pub fn attrs_by_path<'tcx>( /// `Attribute::path_matches` (nightly-2026-11-17); this is the same test it used to perform. fn attr_path_matches(attr: &Attribute, path: &[Symbol]) -> bool { match attr { - Attribute::Tool(item) | Attribute::DeriveHelper(item) => item.path.segments.iter().eq(path), + Attribute::Tool { item, .. } | Attribute::DeriveHelper(item) => { + item.path.segments.iter().eq(path) + } _ => false, } } @@ -65,7 +67,7 @@ pub fn attr_value_str(attr: &Attribute) -> Option { /// always `Attribute::Tool`. fn normal_item(attr: &Attribute) -> &AttrItem { match attr { - Attribute::Tool(item) => item, + Attribute::Tool { item, .. } => item, Attribute::Parsed(_) | Attribute::DeriveHelper(_) => { unreachable!("Kani attributes are unparsed tool attributes: {attr:?}") } @@ -1001,7 +1003,7 @@ impl<'tcx> KaniAttributes<'tcx> { #[allow(deprecated)] let attrs = self.tcx.get_all_attrs(def_id); let stub_set_attr = attrs.iter().find(|a| { - if let Attribute::Tool(normal) = a { + if let Attribute::Tool { item: normal, .. } = a { let segments = &normal.path.segments; segments.len() == 2 && segments[0].as_str() == "kanitool" @@ -1370,7 +1372,7 @@ fn parse_key_values(attr: &Attribute) -> Result, String /// If the attribute is named `kanitool::name`, this extracts `name` fn attr_kind(tcx: TyCtxt, attr: &Attribute) -> Option { - if let Attribute::Tool(normal) = attr { + if let Attribute::Tool { item: normal, .. } = attr { let segments = &normal.path.segments; if (!segments.is_empty()) && segments[0].as_str() == "kanitool" { let ident_str = segments[1..] diff --git a/kani-compiler/src/kani_middle/intrinsics.rs b/kani-compiler/src/kani_middle/intrinsics.rs index 7ea442cedcc..3f8e0229a16 100644 --- a/kani-compiler/src/kani_middle/intrinsics.rs +++ b/kani-compiler/src/kani_middle/intrinsics.rs @@ -9,7 +9,7 @@ use rustc_index::IndexVec; use rustc_middle::mir::{Body, Const as mirConst, ConstValue, Operand, TerminatorKind}; use rustc_middle::mir::{Local, LocalDecl}; use rustc_middle::ty::{self, Ty, TyCtxt}; -use rustc_middle::ty::{Const, GenericArgs, IntrinsicDef}; +use rustc_middle::ty::{Const, GenericArgs, Intrinsic, IntrinsicDef}; use rustc_span::Spanned; use rustc_span::symbol::{Symbol, sym}; use tracing::{debug, trace}; @@ -39,7 +39,7 @@ impl<'tcx> ModelIntrinsics<'tcx> { if let Some((intrinsic, generics)) = resolve_rust_intrinsic(self.tcx, func_ty) { let intrinsic_name = intrinsic.name; trace!(?func, ?intrinsic_name, "run_pass"); - if intrinsic_name == sym::simd_bitmask { + if intrinsic_name == Intrinsic::Rustc(sym::simd_bitmask) { self.replace_simd_bitmask(func, args, generics) } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1cdf94ea9b4..dffc0519fb9 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -2,5 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 OR MIT [toolchain] -channel = "nightly-2026-11-18" +channel = "nightly-2026-11-19" components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]