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#82651 - jyn514:rustdoc-warnings, r=Guillaum…
…eGomez Cleanup rustdoc warnings ## Clean up error reporting for deprecated passes Using `error!` here goes all the way back to the original commit, rust-lang#8540. I don't see any reason to use logging; rustdoc should use diagnostics wherever possible. See rust-lang#81932 (comment) for further context. - Use spans for deprecated attributes - Use a proper diagnostic for unknown passes, instead of error logging - Add tests for unknown passes - Improve some wording in diagnostics ## Report that `doc(plugins)` doesn't work using diagnostics instead of `eprintln!` This also adds a test for the output. This was added in rust-lang#52194. I don't see any particular reason not to use diagnostics here, I think it was just missed in rust-lang#50541.
- Loading branch information
Showing
5 changed files
with
91 additions
and
41 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
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 |
---|---|---|
@@ -1,7 +1,17 @@ | ||
// check-pass | ||
// compile-flags: --passes unknown-pass | ||
// error-pattern: ignoring unknown pass `unknown-pass` | ||
|
||
#![doc(no_default_passes, passes = "unindent-comments")] | ||
|
||
struct SomeStruct; | ||
|
||
pub struct OtherStruct; | ||
#![doc(no_default_passes)] | ||
//~^ WARNING attribute is deprecated | ||
//~| NOTE see issue #44136 | ||
//~| HELP use `#![doc(document_private_items)]` | ||
#![doc(passes = "collapse-docs unindent-comments")] | ||
//~^ WARNING attribute is deprecated | ||
//~| NOTE see issue #44136 | ||
//~| WARNING ignoring unknown pass | ||
//~| NOTE `collapse-docs` pass was removed | ||
#![doc(plugins = "xxx")] | ||
//~^ WARNING attribute is deprecated | ||
//~| NOTE see issue #44136 | ||
//~| WARNING no longer functions; see CVE |
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 |
---|---|---|
@@ -1,11 +1,42 @@ | ||
warning: the `#![doc(no_default_passes)]` attribute is considered deprecated | ||
warning: the `passes` flag is deprecated | ||
| | ||
= warning: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information | ||
= note: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information | ||
|
||
warning: ignoring unknown pass `unknown-pass` | ||
|
||
warning: the `#![doc(no_default_passes)]` attribute is deprecated | ||
--> $DIR/deprecated-attrs.rs:5:8 | ||
| | ||
LL | #![doc(no_default_passes)] | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information | ||
= help: you may want to use `#![doc(document_private_items)]` | ||
|
||
warning: the `#![doc(passes = "...")]` attribute is considered deprecated | ||
warning: the `#![doc(passes = "...")]` attribute is deprecated | ||
--> $DIR/deprecated-attrs.rs:9:8 | ||
| | ||
LL | #![doc(passes = "collapse-docs unindent-comments")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information | ||
|
||
warning: ignoring unknown pass `collapse-docs` | ||
--> $DIR/deprecated-attrs.rs:9:17 | ||
| | ||
LL | #![doc(passes = "collapse-docs unindent-comments")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the `collapse-docs` pass was removed in #80261 <https://github.com/rust-lang/rust/pull/80261> | ||
|
||
warning: the `#![doc(plugins = "...")]` attribute is deprecated | ||
--> $DIR/deprecated-attrs.rs:14:8 | ||
| | ||
LL | #![doc(plugins = "xxx")] | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= warning: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information | ||
= note: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information | ||
= warning: `#![doc(plugins = "...")]` no longer functions; see CVE-2018-1000622 <https://nvd.nist.gov/vuln/detail/CVE-2018-1000622> | ||
|
||
warning: 2 warnings emitted | ||
warning: 5 warnings emitted | ||
|