File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -403,11 +403,23 @@ pub(crate) fn run_global_ctxt(
403403 {}/rustdoc/how-to-write-documentation.html",
404404 crate :: DOC_RUST_LANG_ORG_VERSION
405405 ) ;
406+
407+ let krate_name = if let Some ( name) = krate. module . inner . name {
408+ format ! ( "`{}`'s" , name. as_str( ) )
409+ } else {
410+ "this crate's" . to_string ( )
411+ } ;
412+ let span = tcx. def_span ( krate. module . item_id . as_local_def_id ( ) . unwrap ( ) ) ;
413+
406414 tcx. node_lint (
407415 crate :: lint:: MISSING_CRATE_LEVEL_DOCS ,
408416 DocContext :: as_local_hir_id ( tcx, krate. module . item_id ) . unwrap ( ) ,
409417 |lint| {
410- lint. primary_message ( "no documentation found for this crate's top-level module" ) ;
418+ lint. span ( span) ;
419+ lint. primary_message ( format ! (
420+ "no documentation found for {} top-level module" ,
421+ krate_name
422+ ) ) ;
411423 lint. help ( help) ;
412424 } ,
413425 ) ;
You can’t perform that action at this time.
0 commit comments