Skip to content

Commit b3187aa

Browse files
committed
Don't run analysis pass in rustdoc
- Explicitly check for missing docs - Don't run any lints except those we explicitly specified
1 parent a5275ff commit b3187aa

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/librustc_interface/passes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@ fn configure_and_expand_inner<'a>(
410410
// anything, so switch everything to just looping
411411
resolver.resolve_crate(&krate, sess.opts.actually_rustdoc);
412412

413-
//let mut should_loop = sess.opts.actually_rustdoc;
414413
let mut should_loop = false;
415414
if let Some(PpMode::PpmSource(PpSourceMode::PpmEveryBodyLoops)) = sess.opts.pretty {
416415
should_loop |= true;

src/librustdoc/core.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,10 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
372372
crate_name,
373373
lint_caps,
374374
register_lints: None,
375-
override_queries: None,
375+
override_queries: Some(|_sess, local_providers, external_providers| {
376+
local_providers.lint_mod = |_, _| {};
377+
external_providers.lint_mod = |_, _| {};
378+
}),
376379
registry: rustc_driver::diagnostics_registry(),
377380
};
378381

@@ -416,10 +419,9 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
416419
let mut global_ctxt = abort_on_err(queries.global_ctxt(), sess).take();
417420

418421
global_ctxt.enter(|tcx| {
419-
tcx.analysis(LOCAL_CRATE).ok();
420-
421-
// Abort if there were any errors so far
422-
sess.abort_if_errors();
422+
sess.time("missing_docs", || {
423+
rustc_lint::check_crate(tcx, rustc_lint::builtin::MissingDoc::new);
424+
});
423425

424426
let access_levels = tcx.privacy_access_levels(LOCAL_CRATE);
425427
// Convert from a HirId set to a DefId set since we don't always have easy access

0 commit comments

Comments
 (0)