-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #114959 - mojave2:issue-113702, r=petrochenkov
fix #113702 emit a proper diagnostic message for unstable lints passed from CLI Current output: ```bash $ build/host/stage1/bin/rustc hello.rs -Wunnameable_types warning: unknown lint: `unnameable_types` | = note: the `unnameable_types` lint is unstable = note: see issue #48054 <#48054> for more information = help: add `-Zcrate-attr="feature(type_privacy_lints)"` to the command-line options to enable = note: `#[warn(unknown_lints)]` on by default warning: 1 warning emitted ``` Previously, the feature gate diagnostic message is like below, which is the same as the message for unstable lints from the root module. ```shell = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable ``` Fixes #113702
- Loading branch information
Showing
7 changed files
with
46 additions
and
21 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
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
6 changes: 3 additions & 3 deletions
6
tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr
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,18 +1,18 @@ | ||
error: unknown lint: `test_unstable_lint` | ||
| | ||
= note: the `test_unstable_lint` lint is unstable | ||
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable | ||
= help: add `-Zcrate-attr="feature(test_unstable_lint)"` to the command-line options to enable | ||
= note: requested on the command line with `-D unknown-lints` | ||
|
||
error: unknown lint: `test_unstable_lint` | ||
| | ||
= note: the `test_unstable_lint` lint is unstable | ||
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable | ||
= help: add `-Zcrate-attr="feature(test_unstable_lint)"` to the command-line options to enable | ||
|
||
error: unknown lint: `test_unstable_lint` | ||
| | ||
= note: the `test_unstable_lint` lint is unstable | ||
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable | ||
= help: add `-Zcrate-attr="feature(test_unstable_lint)"` to the command-line options to enable | ||
|
||
error: aborting due to 3 previous errors | ||
|
6 changes: 3 additions & 3 deletions
6
tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr
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,18 +1,18 @@ | ||
warning: unknown lint: `test_unstable_lint` | ||
| | ||
= note: the `test_unstable_lint` lint is unstable | ||
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable | ||
= help: add `-Zcrate-attr="feature(test_unstable_lint)"` to the command-line options to enable | ||
= note: requested on the command line with `-W unknown-lints` | ||
|
||
warning: unknown lint: `test_unstable_lint` | ||
| | ||
= note: the `test_unstable_lint` lint is unstable | ||
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable | ||
= help: add `-Zcrate-attr="feature(test_unstable_lint)"` to the command-line options to enable | ||
|
||
warning: unknown lint: `test_unstable_lint` | ||
| | ||
= note: the `test_unstable_lint` lint is unstable | ||
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable | ||
= help: add `-Zcrate-attr="feature(test_unstable_lint)"` to the command-line options to enable | ||
|
||
warning: 3 warnings emitted | ||
|