File tree Expand file tree Collapse file tree 5 files changed +14
-20
lines changed Expand file tree Collapse file tree 5 files changed +14
-20
lines changed Original file line number Diff line number Diff line change @@ -404,22 +404,14 @@ pub(crate) fn run_global_ctxt(
404404 crate :: DOC_RUST_LANG_ORG_VERSION
405405 ) ;
406406
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- } ;
412407 let span = tcx. def_span ( krate. module . item_id . as_local_def_id ( ) . unwrap ( ) ) ;
413408
414409 tcx. node_lint (
415410 crate :: lint:: MISSING_CRATE_LEVEL_DOCS ,
416411 DocContext :: as_local_hir_id ( tcx, krate. module . item_id ) . unwrap ( ) ,
417412 |lint| {
418413 lint. span ( span) ;
419- lint. primary_message ( format ! (
420- "no documentation found for {} top-level module" ,
421- krate_name
422- ) ) ;
414+ lint. primary_message ( "no documentation found for this crate's top-level module" ) ;
423415 lint. help ( help) ;
424416 } ,
425417 ) ;
Original file line number Diff line number Diff line change 11//@ check-pass
22//@ compile-flags: -Z unstable-options --check
33//@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
4- #![ feature( rustdoc_missing_doc_code_examples) ] //~ WARN no documentation found for `check`'s top-level module
4+
5+ #![ feature( rustdoc_missing_doc_code_examples) ] //~ WARN no documentation found for this crate's top-level module
56//~^ WARN
67
78#![ warn( missing_docs) ]
1112pub fn foo ( ) { }
1213//~^ WARN
1314//~^^ WARN
15+
Original file line number Diff line number Diff line change 11warning: missing documentation for the crate
2- --> $DIR/check.rs:4 :1
2+ --> $DIR/check.rs:5 :1
33 |
44LL | / #![feature(rustdoc_missing_doc_code_examples)]
55LL | |
@@ -10,19 +10,19 @@ LL | | pub fn foo() {}
1010 | |_______________^
1111 |
1212note: the lint level is defined here
13- --> $DIR/check.rs:7 :9
13+ --> $DIR/check.rs:8 :9
1414 |
1515LL | #![warn(missing_docs)]
1616 | ^^^^^^^^^^^^
1717
1818warning: missing documentation for a function
19- --> $DIR/check.rs:11 :1
19+ --> $DIR/check.rs:12 :1
2020 |
2121LL | pub fn foo() {}
2222 | ^^^^^^^^^^^^
2323
24- warning: no documentation found for `check` 's top-level module
25- --> $DIR/check.rs:4 :1
24+ warning: no documentation found for this crate 's top-level module
25+ --> $DIR/check.rs:5 :1
2626 |
2727LL | / #![feature(rustdoc_missing_doc_code_examples)]
2828LL | |
@@ -35,20 +35,20 @@ LL | | pub fn foo() {}
3535 = help: The following guide may be of use:
3636 https://doc.rust-lang.org/$CHANNEL/rustdoc/how-to-write-documentation.html
3737note: the lint level is defined here
38- --> $DIR/check.rs:9 :9
38+ --> $DIR/check.rs:10 :9
3939 |
4040LL | #![warn(rustdoc::all)]
4141 | ^^^^^^^^^^^^
4242 = note: `#[warn(rustdoc::missing_crate_level_docs)]` implied by `#[warn(rustdoc::all)]`
4343
4444warning: missing code example in this documentation
45- --> $DIR/check.rs:11 :1
45+ --> $DIR/check.rs:12 :1
4646 |
4747LL | pub fn foo() {}
4848 | ^^^^^^^^^^^^^^^
4949 |
5050note: the lint level is defined here
51- --> $DIR/check.rs:8 :9
51+ --> $DIR/check.rs:9 :9
5252 |
5353LL | #![warn(rustdoc::missing_doc_code_examples)]
5454 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change 11//@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
2- #![ deny( rustdoc:: missing_crate_level_docs) ] //~ ERROR no documentation found for `no_crate_level_doc_lint` 's top-level module
2+ #![ deny( rustdoc:: missing_crate_level_docs) ] //~ ERROR no documentation found for this crate 's top-level module
33//^~ NOTE defined here
44
55pub fn foo ( ) { }
Original file line number Diff line number Diff line change 1- error: no documentation found for `no_crate_level_doc_lint` 's top-level module
1+ error: no documentation found for this crate 's top-level module
22 --> $DIR/no-crate-level-doc-lint.rs:2:1
33 |
44LL | / #![deny(rustdoc::missing_crate_level_docs)]
You can’t perform that action at this time.
0 commit comments