-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify what -D warnings
or -F warnings
does
#46136
Conversation
They set all lints currently on the warning level to `deny` or `forbid`, respectively.
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
Tested what it actually does by running
with the lint |
Ping from triage @pnkfelix — will you have some time to review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do a bit better.
src/librustc_driver/lib.rs
Outdated
@@ -980,7 +980,7 @@ Available lint options: | |||
println!("Lint groups provided by rustc:\n"); | |||
println!(" {} {}", padded("name"), "sub-lints"); | |||
println!(" {} {}", padded("----"), "---------"); | |||
println!(" {} {}", padded("warnings"), "all built-in lints"); | |||
println!(" {} {}", padded("warnings"), "all lints activated to the warning level"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I don't find this phrasing very clear. "The warning level" sounds to me like something that one can control independently. Perhaps "all lints set to warn
", or "all lints that are set to issue warnings"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a lint that defaults to allow, but you set it explicitly to warn, and then you do #[deny(warnings)]
, is that lint then denied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I don't find this phrasing very clear.
Yea, I struggled to find a good wording. Thanks for the suggestions, I used the second one for now.
If you have a lint that defaults to allow, but you set it explicitly to warn, and then you do
#[deny(warnings)]
, is that lint then denied?
Yes.
#![deny(warnings)]
fn main() {
Box::new(());
}
$ rustc -W box-pointers a.rs
error: type uses owned (Box type) pointers: std::boxed::Box<()>
--> box.rs:3:5
|
3 | Box::new(());
| ^^^^^^^^^^^^
|
note: lint level defined here
--> box.rs:1:9
|
1 | #![deny(warnings)]
| ^^^^^^^^
= note: #[deny(box_pointers)] implied by #[deny(warnings)]
error: aborting due to previous error
@bors r+ rollup |
📌 Commit e1e1dcc has been approved by |
⌛ Testing commit e1e1dcc with merge 3de30dd00edbc89613e93900a48ddfa4f8eb06a7... |
Clarify what `-D warnings` or `-F warnings` does They set all lints currently on the warning level to `deny` or `forbid`, respectively.
@bors retry — Prioritize for rollup (which included this PR...) |
They set all lints currently on the warning level to
deny
orforbid
,respectively.