Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Upgrade toolchain to 08/28 #3454

Merged
merged 15 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
7 changes: 5 additions & 2 deletions kani-compiler/src/codegen_cprover_gotoc/codegen/typ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,10 @@ impl<'tcx> GotocCtx<'tcx> {
.unwrap();
self.codegen_fndef_type(instance)
}
ty::FnPtr(sig) => self.codegen_function_sig(*sig).to_pointer(),
ty::FnPtr(sig_tys, hdr) => {
let sig = sig_tys.with(*hdr);
self.codegen_function_sig(sig).to_pointer()
}
ty::Closure(_, subst) => self.codegen_ty_closure(ty, subst),
ty::Coroutine(..) => self.codegen_ty_coroutine(ty),
ty::Never => self.ensure_struct(NEVER_TYPE_EMPTY_STRUCT_NAME, "!", |_, _| vec![]),
Expand Down Expand Up @@ -1014,7 +1017,7 @@ impl<'tcx> GotocCtx<'tcx> {

// These types were blocking stdlib. Doing the default thing to unblock.
// https://github.com/model-checking/kani/issues/214
ty::FnPtr(_) => self.codegen_ty(pointee_type).to_pointer(),
ty::FnPtr(_, _) => self.codegen_ty(pointee_type).to_pointer(),

// These types have no regression tests for them.
// For soundness, hold off on generating them till we have test-cases.
Expand Down
2 changes: 1 addition & 1 deletion kani-compiler/src/kani_middle/coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub fn extract_unsize_casting<'tcx>(
coerce_info.dst_ty
));
// Find the tail of the coercion that determines the type of metadata to be stored.
let (src_base_ty, dst_base_ty) = tcx.struct_lockstep_tails_erasing_lifetimes(
let (src_base_ty, dst_base_ty) = tcx.struct_lockstep_tails_for_codegen(
src_pointee_ty,
dst_pointee_ty,
ParamEnv::reveal_all(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct PointsToAnalysis<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
/// This will be used in the future to resolve function pointer and vtable calls. Currently, we
/// can resolve call graph edges just by looking at the terminators and erroring if we can't
/// resolve the callee.
/// resolve the callee.
call_graph: &'a CallGraph,
/// This graph should contain a subset of the points-to graph reachable from function arguments.
/// For the entry function it will be empty (as it supposedly does not have any parameters).
Expand Down Expand Up @@ -521,7 +521,7 @@ impl<'a, 'tcx> PointsToAnalysis<'a, 'tcx> {
| Rvalue::ShallowInitBox(operand, _)
| Rvalue::Cast(_, operand, _)
| Rvalue::Repeat(operand, ..) => self.successors_for_operand(state, operand),
Rvalue::Ref(_, _, ref_place) | Rvalue::AddressOf(_, ref_place) => {
Rvalue::Ref(_, _, ref_place) | Rvalue::RawPtr(_, ref_place) => {
// Here, a reference to a place is created, which leaves the place
// unchanged.
state.resolve_place(ref_place, self.instance)
Expand Down
7 changes: 3 additions & 4 deletions kani-compiler/src/kani_middle/transform/internal_mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,9 @@ impl RustcInternalMir for Rvalue {

fn internal_mir<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Self::T<'tcx> {
match self {
Rvalue::AddressOf(mutability, place) => rustc_middle::mir::Rvalue::AddressOf(
internal(tcx, mutability),
internal(tcx, place),
),
Rvalue::AddressOf(mutability, place) => {
rustc_middle::mir::Rvalue::RawPtr(internal(tcx, mutability), internal(tcx, place))
}
Rvalue::Aggregate(aggregate_kind, operands) => rustc_middle::mir::Rvalue::Aggregate(
Box::new(aggregate_kind.internal_mir(tcx)),
rustc_index::IndexVec::from_raw(
Expand Down
3 changes: 2 additions & 1 deletion kani-compiler/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ static JSON_PANIC_HOOK: LazyLock<Box<dyn Fn(&panic::PanicHookInfo<'_>) + Sync +
Lrc::new(SourceMap::new(FilePathMapping::empty())),
fallback_bundle,
false,
HumanReadableErrorType::Default(ColorConfig::Never),
HumanReadableErrorType::Default,
ColorConfig::Never,
);
let diagnostic = DiagInner::new(rustc_errors::Level::Bug, msg);
emitter.emit_diagnostic(diagnostic);
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-2024-08-07"
channel = "nightly-2024-08-20"
components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]
1 change: 0 additions & 1 deletion tools/scanner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ strum_macros = "0.26"
# This crate uses rustc crates.
# More info: https://github.com/rust-analyzer/rust-analyzer/pull/7891
rustc_private = true

Loading