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.
Clean up error reporting for deprecated passes
- 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
- Loading branch information
Showing
4 changed files
with
74 additions
and
36 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 |
---|---|---|
@@ -1,7 +1,13 @@ | ||
// 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 |
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,33 @@ | ||
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")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information | ||
= note: the `collapse-docs` pass was removed in #80261 <https://github.com/rust-lang/rust/pull/80261> | ||
|
||
warning: 2 warnings emitted | ||
warning: 4 warnings emitted | ||
|