Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions kani-compiler/src/codegen_aeneas_llbc/mir_to_ullbc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
10 changes: 6 additions & 4 deletions kani-compiler/src/kani_middle/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand All @@ -65,7 +67,7 @@ pub fn attr_value_str(attr: &Attribute) -> Option<Symbol> {
/// 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:?}")
}
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -1370,7 +1372,7 @@ fn parse_key_values(attr: &Attribute) -> Result<BTreeMap<String, String>, String

/// If the attribute is named `kanitool::name`, this extracts `name`
fn attr_kind(tcx: TyCtxt, attr: &Attribute) -> Option<KaniAttributeKind> {
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..]
Expand Down
4 changes: 2 additions & 2 deletions kani-compiler/src/kani_middle/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Loading