Skip to content

Commit ecbdb14

Browse files
authored
Toolchain upgrade to nightly-2025-01-28 (model-checking#3855)
Resolves model-checking#3854. This upgrade requires changes to remove `RunCompiler` due to the following changes: - rust-lang/rust@a77776cc1d Remove RunCompiler By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --------- Signed-off-by: Felipe R. Monteiro <[email protected]>
1 parent bc134ce commit ecbdb14

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

kani-compiler/src/kani_compiler.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
//! This module defines all compiler extensions that form the Kani compiler.
55
//!
6-
//! The [KaniCompiler] can be used across multiple rustc driver runs ([RunCompiler::run()]),
6+
//! The [KaniCompiler] can be used across multiple rustc driver runs ([`rustc_driver::run_compiler`]),
77
//! which is used to implement stubs.
88
//!
99
//! In the first run, [KaniCompiler::config] will implement the compiler configuration and it will
@@ -25,7 +25,7 @@ use crate::kani_queries::QueryDb;
2525
use crate::session::init_session;
2626
use clap::Parser;
2727
use rustc_codegen_ssa::traits::CodegenBackend;
28-
use rustc_driver::{Callbacks, Compilation, RunCompiler};
28+
use rustc_driver::{Callbacks, Compilation, run_compiler};
2929
use rustc_interface::Config;
3030
use rustc_middle::ty::TyCtxt;
3131
use rustc_session::config::ErrorOutputType;
@@ -34,7 +34,7 @@ use std::sync::{Arc, Mutex};
3434
use tracing::debug;
3535

3636
/// Run the Kani flavour of the compiler.
37-
/// This may require multiple runs of the rustc driver ([RunCompiler::run]).
37+
/// This may require multiple runs of the rustc driver ([`rustc_driver::run_compiler`]).
3838
pub fn run(args: Vec<String>) {
3939
let mut kani_compiler = KaniCompiler::new();
4040
kani_compiler.run(args);
@@ -96,10 +96,7 @@ impl KaniCompiler {
9696
/// actually invoke the rust compiler multiple times.
9797
pub fn run(&mut self, args: Vec<String>) {
9898
debug!(?args, "run_compilation_session");
99-
let queries = self.queries.clone();
100-
let mut compiler = RunCompiler::new(&args, self);
101-
compiler.set_make_codegen_backend(Some(Box::new(move |_cfg| backend(queries))));
102-
compiler.run();
99+
run_compiler(&args, self);
103100
}
104101
}
105102

@@ -108,6 +105,10 @@ impl Callbacks for KaniCompiler {
108105
/// Configure the [KaniCompiler] `self` object during the [CompilationStage::Init].
109106
fn config(&mut self, config: &mut Config) {
110107
let mut args = vec!["kani-compiler".to_string()];
108+
config.make_codegen_backend = Some(Box::new({
109+
let queries = self.queries.clone();
110+
move |_cfg| backend(queries)
111+
}));
111112
args.extend(config.opts.cg.llvm_args.iter().cloned());
112113
let args = Arguments::parse_from(args);
113114
init_session(&args, matches!(config.opts.error_format, ErrorOutputType::Json { .. }));

kani-compiler/src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ mod kani_middle;
5050
mod kani_queries;
5151
mod session;
5252

53-
use rustc_driver::{RunCompiler, TimePassesCallbacks};
53+
use rustc_driver::{TimePassesCallbacks, run_compiler};
5454
use std::env;
5555

5656
/// Main function. Configure arguments and run the compiler.
@@ -63,8 +63,7 @@ fn main() {
6363
kani_compiler::run(rustc_args);
6464
} else {
6565
let mut callbacks = TimePassesCallbacks::default();
66-
let compiler = RunCompiler::new(&rustc_args, &mut callbacks);
67-
compiler.run();
66+
run_compiler(&rustc_args, &mut callbacks);
6867
}
6968
}
7069

kani-compiler/src/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static JSON_PANIC_HOOK: LazyLock<Box<dyn Fn(&panic::PanicHookInfo<'_>) + Sync +
5757
let mut emitter = JsonEmitter::new(
5858
Box::new(io::BufWriter::new(io::stderr())),
5959
#[allow(clippy::arc_with_non_send_sync)]
60-
Lrc::new(SourceMap::new(FilePathMapping::empty())),
60+
Some(Lrc::new(SourceMap::new(FilePathMapping::empty()))),
6161
fallback_bundle,
6262
false,
6363
HumanReadableErrorType::Default,

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
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-2025-01-24"
5+
channel = "nightly-2025-01-28"
66
components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]

0 commit comments

Comments
 (0)