forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#83816 - JohnTitor:unused-doc-comments-on-ma…
…cros, r=varkor Trigger `unused_doc_comments` on macros at once Fixes rust-lang#83768
- Loading branch information
Showing
6 changed files
with
61 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#![deny(unused_doc_comments)] | ||
#![feature(rustc_attrs)] | ||
|
||
macro_rules! foo { () => {}; } | ||
|
||
fn main() { | ||
/// line1 //~ ERROR: unused doc comment | ||
/// line2 | ||
/// line3 | ||
foo!(); | ||
|
||
// Ensure we still detect another doc-comment block. | ||
/// line1 //~ ERROR: unused doc comment | ||
/// line2 | ||
/// line3 | ||
foo!(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
error: unused doc comment | ||
--> $DIR/unused-doc-comments-for-macros.rs:7:5 | ||
| | ||
LL | / /// line1 | ||
LL | | /// line2 | ||
LL | | /// line3 | ||
| |_____--------^ | ||
| | | ||
| rustdoc does not generate documentation for macro invocations | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/unused-doc-comments-for-macros.rs:1:9 | ||
| | ||
LL | #![deny(unused_doc_comments)] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
= help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion | ||
|
||
error: unused doc comment | ||
--> $DIR/unused-doc-comments-for-macros.rs:13:5 | ||
| | ||
LL | / /// line1 | ||
LL | | /// line2 | ||
LL | | /// line3 | ||
| |_____--------^ | ||
| | | ||
| rustdoc does not generate documentation for macro invocations | ||
| | ||
= help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion | ||
|
||
error: aborting due to 2 previous errors | ||
|
File renamed without changes.
File renamed without changes.