Skip to content

Commit b349137

Browse files
authored
Upgrade toolchain to nightly-2024-01-17 (#2976)
Fixes were done to address the following upstream changes: - rust-lang/rust#119606 - rust-lang/rust#119751 - rust-lang/rust#120025 - rust-lang/rust#116520 Resolves #2971 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
1 parent fd12a28 commit b349137

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,11 @@ impl<'tcx> GotocCtx<'tcx> {
302302
kind: ty::BoundRegionKind::BrEnv,
303303
};
304304
let env_region = ty::Region::new_bound(self.tcx, ty::INNERMOST, br);
305-
let env_ty = self.tcx.closure_env_ty(def_id, args, env_region).unwrap();
305+
let env_ty = self.tcx.closure_env_ty(
306+
Ty::new_closure(self.tcx, def_id, args),
307+
args.as_closure().kind(),
308+
env_region,
309+
);
306310

307311
let sig = sig.skip_binder();
308312

kani-compiler/src/codegen_cprover_gotoc/utils/debug.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use tracing::debug;
1616
// Use a thread-local global variable to track the current codegen item for debugging.
1717
// If Kani panics during codegen, we can grab this item to include the problematic
1818
// codegen item in the panic trace.
19-
thread_local!(static CURRENT_CODEGEN_ITEM: RefCell<(Option<String>, Option<Location>)> = RefCell::new((None, None)));
19+
thread_local!(static CURRENT_CODEGEN_ITEM: RefCell<(Option<String>, Option<Location>)> = const { RefCell::new((None, None)) });
2020

2121
pub fn init() {
2222
// Install panic hook

kani-compiler/src/kani_middle/attributes.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,12 @@ impl<'tcx> KaniAttributes<'tcx> {
348348
"Use of unstable feature `{}`: {}",
349349
unstable_attr.feature, unstable_attr.reason
350350
))
351-
.span_note(
351+
.with_span_note(
352352
self.tcx.def_span(self.item),
353353
format!("the function `{fn_name}` is unstable:"),
354354
)
355-
.note(format!("see issue {} for more information", unstable_attr.issue))
356-
.help(format!("use `-Z {}` to enable using this function.", unstable_attr.feature))
355+
.with_note(format!("see issue {} for more information", unstable_attr.issue))
356+
.with_help(format!("use `-Z {}` to enable using this function.", unstable_attr.feature))
357357
.emit()
358358
}
359359

@@ -422,7 +422,7 @@ impl<'tcx> KaniAttributes<'tcx> {
422422
self.item_name(),
423423
),
424424
)
425-
.span_note(self.tcx.def_span(id), "Try adding a contract to this function.")
425+
.with_span_note(self.tcx.def_span(id), "Try adding a contract to this function.")
426426
.emit();
427427
return;
428428
};
@@ -448,7 +448,7 @@ impl<'tcx> KaniAttributes<'tcx> {
448448
self.item_name(),
449449
),
450450
)
451-
.span_note(
451+
.with_span_note(
452452
self.tcx.def_span(def_id),
453453
format!(
454454
"Try adding a contract to this function or use the unsound `{}` attribute instead.",
@@ -624,7 +624,7 @@ impl<'a> UnstableAttrParseError<'a> {
624624
self.attr.span,
625625
format!("failed to parse `#[kani::unstable]`: {}", self.reason),
626626
)
627-
.note(format!(
627+
.with_note(format!(
628628
"expected format: #[kani::unstable({}, {}, {})]",
629629
r#"feature="<IDENTIFIER>""#, r#"issue="<ISSUE>""#, r#"reason="<DESCRIPTION>""#
630630
))
@@ -665,7 +665,7 @@ fn expect_no_args(tcx: TyCtxt, kind: KaniAttributeKind, attr: &Attribute) {
665665
if !attr.is_word() {
666666
tcx.dcx()
667667
.struct_span_err(attr.span, format!("unexpected argument for `{}`", kind.as_ref()))
668-
.help("remove the extra argument")
668+
.with_help("remove the extra argument")
669669
.emit();
670670
}
671671
}

kani-compiler/src/kani_middle/intrinsics.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use rustc_middle::mir::{Body, Const as mirConst, ConstValue, Operand, Terminator
77
use rustc_middle::mir::{Local, LocalDecl};
88
use rustc_middle::ty::{self, Ty, TyCtxt};
99
use rustc_middle::ty::{Const, GenericArgsRef};
10+
use rustc_span::source_map::Spanned;
1011
use rustc_span::symbol::{sym, Symbol};
1112
use tracing::{debug, trace};
1213

@@ -48,12 +49,12 @@ impl<'tcx> ModelIntrinsics<'tcx> {
4849
fn replace_simd_bitmask(
4950
&self,
5051
func: &mut Operand<'tcx>,
51-
args: &[Operand<'tcx>],
52+
args: &[Spanned<Operand<'tcx>>],
5253
gen_args: GenericArgsRef<'tcx>,
5354
) {
5455
assert_eq!(args.len(), 1);
5556
let tcx = self.tcx;
56-
let arg_ty = args[0].ty(&self.local_decls, tcx);
57+
let arg_ty = args[0].node.ty(&self.local_decls, tcx);
5758
if arg_ty.is_simd() {
5859
// Get the stub definition.
5960
let stub_id = tcx.get_diagnostic_item(Symbol::intern("KaniModelSimdBitmask")).unwrap();

rust-toolchain.toml

+1-1
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-01-08"
5+
channel = "nightly-2024-01-17"
66
components = ["llvm-tools-preview", "rustc-dev", "rust-src", "rustfmt"]

0 commit comments

Comments
 (0)