Skip to content

Commit

Permalink
Auto merge of #5158 - lzutao:callbackshook, r=flip1995
Browse files Browse the repository at this point in the history
Impl DefaultCallbacks on our side

cc rust-lang/rust#69059 (comment)

changelog: none
  • Loading branch information
bors committed Feb 11, 2020
2 parents 80c0afe + bfc4bd4 commit 07f1736
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 07f1736

Please sign in to comment.