Skip to content

Commit a221d07

Browse files
committed
Revert "Toolchain upgrade to nightly-2025-01-28 (model-checking#3855)"
This reverts commit ecbdb14.
1 parent 5cf5b8c commit a221d07

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

kani-compiler/src/kani_compiler.rs

Lines changed: 7 additions & 8 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 ([`rustc_driver::run_compiler`]),
6+
//! The [KaniCompiler] can be used across multiple rustc driver runs ([RunCompiler::run()]),
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, run_compiler};
28+
use rustc_driver::{Callbacks, Compilation, RunCompiler};
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 ([`rustc_driver::run_compiler`]).
37+
/// This may require multiple runs of the rustc driver ([RunCompiler::run]).
3838
pub fn run(args: Vec<String>) {
3939
let mut kani_compiler = KaniCompiler::new();
4040
kani_compiler.run(args);
@@ -96,7 +96,10 @@ 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-
run_compiler(&args, self);
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();
100103
}
101104
}
102105

@@ -105,10 +108,6 @@ impl Callbacks for KaniCompiler {
105108
/// Configure the [KaniCompiler] `self` object during the [CompilationStage::Init].
106109
fn config(&mut self, config: &mut Config) {
107110
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-
}));
112111
args.extend(config.opts.cg.llvm_args.iter().cloned());
113112
let args = Arguments::parse_from(args);
114113
init_session(&args, matches!(config.opts.error_format, ErrorOutputType::Json { .. }));

kani-compiler/src/main.rs

Lines changed: 3 additions & 2 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::{TimePassesCallbacks, run_compiler};
53+
use rustc_driver::{RunCompiler, TimePassesCallbacks};
5454
use std::env;
5555

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

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-
Some(Lrc::new(SourceMap::new(FilePathMapping::empty()))),
60+
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-28"
5+
channel = "nightly-2025-01-24"
66
components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]

0 commit comments

Comments
 (0)