@@ -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
357356fn sysroot ( ) -> Result < PathBuf > {
@@ -422,13 +421,30 @@ 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 ) ]
430- #[ allow( clippy:: unnecessary_wraps) ]
431- const fn map_run_compiler_err ( ( ) : ( ) ) -> Result < ( ) > {
433+ #[ rustversion:: all( since( 2024 -12 -09 ) , before( 2025 -01 -24 ) ) ]
434+ fn run_compiler (
435+ at_args : & [ String ] ,
436+ callbacks : & mut ( dyn rustc_driver:: Callbacks + Send ) ,
437+ ) -> Result < ( ) > {
438+ rustc_driver:: RunCompiler :: new ( at_args, callbacks) . run ( ) ;
439+ Ok ( ( ) )
440+ }
441+
442+ #[ rustversion:: since( 2025 -01 -24 ) ]
443+ fn run_compiler (
444+ at_args : & [ String ] ,
445+ callbacks : & mut ( dyn rustc_driver:: Callbacks + Send ) ,
446+ ) -> Result < ( ) > {
447+ rustc_driver:: run_compiler ( at_args, callbacks) ;
432448 Ok ( ( ) )
433449}
434450
0 commit comments