diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs index 8879c529262..00f70e586f4 100644 --- a/clippy_lints/src/doc.rs +++ b/clippy_lints/src/doc.rs @@ -729,7 +729,7 @@ fn has_needless_main(code: String, edition: Edition) -> bool { false, TerminalUrl::No, ); - let handler = Handler::with_emitter(false, None, Box::new(emitter), None); + let handler = Handler::with_emitter(Box::new(emitter)).disable_warnings(); let sess = ParseSess::with_span_handler(handler, sm); let mut parser = match maybe_new_parser_from_source_str(&sess, filename, code) {