Skip to content

Commit 9af0935

Browse files
committed
1 parent b04b8e4 commit 9af0935

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

driver/src/lib.rs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,7 @@ pub fn run<T: AsRef<OsStr>>(args: &[T]) -> Result<()> {
350350
// of the log messages.
351351
log::debug!("{:?}", rustc_args);
352352

353-
#[allow(clippy::unit_arg)]
354-
map_run_compiler_err(rustc_driver::RunCompiler::new(&rustc_args, &mut callbacks).run())
353+
run_compiler(&rustc_args, &mut callbacks)
355354
}
356355

357356
fn sysroot() -> Result<PathBuf> {
@@ -422,13 +421,31 @@ fn rustc_args<T: AsRef<OsStr>, U: AsRef<str>, V: AsRef<Path>>(
422421
}
423422

424423
#[rustversion::before(2024-12-09)]
425-
fn map_run_compiler_err(result: Result<(), rustc_span::ErrorGuaranteed>) -> Result<()> {
426-
result.map_err(|_| std::process::exit(1))
424+
fn run_compiler(
425+
at_args: &[String],
426+
callbacks: &mut (dyn rustc_driver::Callbacks + Send),
427+
) -> Result<()> {
428+
rustc_driver::RunCompiler::new(at_args, callbacks)
429+
.run()
430+
.map_err(|_| std::process::exit(1))
427431
}
428432

429-
#[rustversion::since(2024-12-09)]
433+
#[rustversion::all(since(2024-12-09), before(2025-01-24))]
430434
#[allow(clippy::unnecessary_wraps)]
431-
const fn map_run_compiler_err((): ()) -> Result<()> {
435+
fn run_compiler(
436+
at_args: &[String],
437+
callbacks: &mut (dyn rustc_driver::Callbacks + Send),
438+
) -> Result<()> {
439+
rustc_driver::RunCompiler::new(at_args, callbacks).run();
440+
Ok(())
441+
}
442+
443+
#[rustversion::since(2025-01-24)]
444+
fn run_compiler(
445+
at_args: &[String],
446+
callbacks: &mut (dyn rustc_driver::Callbacks + Send),
447+
) -> Result<()> {
448+
rustc_driver::run_compiler(at_args, callbacks);
432449
Ok(())
433450
}
434451

expensive/tests/boundary_toolchains.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ use tempfile::tempdir;
1818
// smoelius: Put recent boundaries first, since they're more likely to cause problems.
1919
// smoelius: The relevant PRs and merge commits appear before each boundary.
2020
const BOUNDARIES: &[(&str, &str)] = &[
21+
// https://github.com/rust-lang/rust/pull/135880
22+
// https://github.com/rust-lang/rust/commit/7d31ae7f351b4aa0fcb47d1d22e04c275bef0653
23+
("2025-01-24", "2025-01-25"),
2124
// https://github.com/rust-lang/rust/pull/133567
2225
// https://github.com/rust-lang/rust/commit/d2881e4eb5e0fe1591bfd8e4cab1d5abc3e3a46c
2326
("2024-12-09", "2024-12-10"),

0 commit comments

Comments
 (0)