-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Unstable lints passed on command line can only be ungated from source code #113702
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Does |
Yep, it does. The diagnostic should at least suggest it if the lint was passed from command line, so I'll keep the issue open. |
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this issue
Aug 22, 2023
fix rust-lang#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 rust-lang#48054 <rust-lang#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 rust-lang#113702
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Aug 22, 2023
…mpiler-errors Rollup of 6 pull requests Successful merges: - rust-lang#114959 (fix rust-lang#113702 emit a proper diagnostic message for unstable lints passed from CLI) - rust-lang#115011 (Warn on elided lifetimes in associated constants (`ELIDED_LIFETIMES_IN_ASSOCIATED_CONSTANT`)) - rust-lang#115077 (Do not emit invalid suggestion in E0191 when spans overlap) - rust-lang#115087 (Add disclaimer on size assertion macro) - rust-lang#115090 (Always use `os-release` rather than `/lib` to detect `NixOS` (bootstrap)) - rust-lang#115101 (triagebot: add dependency licensing pings) r? `@ghost` `@rustbot` modify labels: rollup
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen:
Successful compilation, no warnings.
Instead, this happened:
The warnings can only be removed by
-Aunknown_lints
, which is bad,#![feature(type_privacy_lints)]
to source code of all crates in which we want to enable the lint, which may be dozens or hundreds crates like in case of Enable type privacy lints in rustc #113284, making this alternative even worse than the first one.Warnings about unstable lints passed from command line should be silence-able from command line as well, with something like
-Zunstable-options
.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: