Skip to content

Commit 9664002

Browse files
Update to new diagnostic
1 parent ffe1289 commit 9664002

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/librustdoc/core.rs

+11-8
Original file line numberDiff line numberDiff line change
@@ -415,17 +415,20 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
415415

416416
if let Some(ref m) = krate.module {
417417
if let None | Some("") = m.doc_value() {
418-
let mut diag = tcx.struct_lint_node(
418+
let help = "The following guide may be of use:\n\
419+
https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation\
420+
.html";
421+
tcx.struct_lint_node(
419422
rustc_lint::builtin::MISSING_CRATE_LEVEL_DOC,
420423
ctxt.as_local_hir_id(m.def_id).unwrap(),
421-
"no documentation found for this crate's top-level module",
422-
);
423-
diag.help(
424-
"The following guide may be of use:\n\
425-
https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation\
426-
.html",
424+
|lint| {
425+
let mut diag = lint.build(
426+
"no documentation found for this crate's top-level module",
427+
);
428+
diag.help(help);
429+
diag.emit();
430+
},
427431
);
428-
diag.emit();
429432
}
430433
}
431434

0 commit comments

Comments
 (0)