Skip to content

Commit

Permalink
no custom driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexendoo committed Feb 28, 2024
1 parent f8560b6 commit ec60f01
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions src/driver.rs
Original file line number Diff line number Diff line change
@@ -1,38 +1,7 @@
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::untranslatable_diagnostic)]
#![feature(rustc_private)]
#![feature(let_chains)]
#![feature(lazy_cell)]
#![feature(lint_reasons)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
// warn on lints, that are included in `rust-lang/rust`s bootstrap
#![warn(rust_2018_idioms, unused_lifetimes)]
// warn on rustc internal lints
#![warn(rustc::internal)]

// FIXME: switch to something more ergonomic here, once available.
// (Currently there is no way to opt into sysroot crates without `extern crate`.)
extern crate rustc_driver;
extern crate rustc_session;

use rustc_session::config::ErrorOutputType;
use rustc_session::EarlyDiagCtxt;

use std::env;
use std::process::exit;

struct ClippyCallbacks;

impl rustc_driver::Callbacks for ClippyCallbacks {}

pub fn main() {
let early_dcx = EarlyDiagCtxt::new(ErrorOutputType::default());

rustc_driver::init_rustc_env_logger(&early_dcx);

exit(rustc_driver::catch_with_exit_code(move || {
let args: Vec<String> = env::args().collect();

rustc_driver::RunCompiler::new(&args, &mut ClippyCallbacks {}).run()
}))
rustc_driver::main();
}

0 comments on commit ec60f01

Please sign in to comment.