Skip to content

Commit

Permalink
Impl DefaultCallbacks on our side
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Feb 11, 2020
1 parent 63f818e commit bfc4bd4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ fn test_arg_value() {
assert_eq!(arg_value(args, "--foo", |_| true), None);
}

#[allow(clippy::too_many_lines)]
struct DefaultCallbacks;
impl rustc_driver::Callbacks for DefaultCallbacks {}

struct ClippyCallbacks;

impl rustc_driver::Callbacks for ClippyCallbacks {
fn config(&mut self, config: &mut interface::Config) {
let previous = config.register_lints.take();
Expand Down Expand Up @@ -387,7 +387,7 @@ pub fn main() {
}
}
let mut clippy = ClippyCallbacks;
let mut default = rustc_driver::DefaultCallbacks;
let mut default = DefaultCallbacks;
let callbacks: &mut (dyn rustc_driver::Callbacks + Send) =
if clippy_enabled { &mut clippy } else { &mut default };
rustc_driver::run_compiler(&args, callbacks, None, None)
Expand Down

0 comments on commit bfc4bd4

Please sign in to comment.