diff --git a/bevy_lint/src/driver.rs b/bevy_lint/src/driver.rs index e060cb11..e442a6c2 100644 --- a/bevy_lint/src/driver.rs +++ b/bevy_lint/src/driver.rs @@ -1,14 +1,17 @@ //! Contains code related to writing `bevy_lint_driver`. use crate::callback::BevyLintCallback; +use std::process::ExitCode; /// This is the main entrypoint into the driver, exported so that `bevy_cli` may call it. -#[allow(clippy::result_unit_err)] -pub fn main() -> Result<(), ()> { +pub fn main() -> ExitCode { let args: Vec = dbg!(std::env::args().skip(1).collect()); // Call the compiler with our custom callback. - rustc_driver::RunCompiler::new(&args, &mut BevyLintCallback) - .run() - .map_err(|_| ()) + let result = rustc_driver::RunCompiler::new(&args, &mut BevyLintCallback).run(); + + match result { + Ok(_) => ExitCode::SUCCESS, + Err(_) => ExitCode::FAILURE, + } } diff --git a/src/lint_driver.rs b/src/lint_driver.rs index 4adec061..f6e5cd25 100644 --- a/src/lint_driver.rs +++ b/src/lint_driver.rs @@ -5,6 +5,8 @@ // opt-in to `rustc_private`. #![feature(rustc_private)] -fn main() -> Result<(), ()> { +use std::process::ExitCode; + +fn main() -> ExitCode { bevy_lint::driver::main() }