-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Audit lint pass names and functionality for 1.0 #21761
Comments
1.0 polish, P-high. |
I went through the lints I could find in the compiler and checked the following, as per RFC 344:
In addition I added another rule:
I have tried to apply these as blindly as possible, even in cases where I feel the lint name is perfectly reasonable, just to ensure each lint's name is considered for any possible infraction. And yes, I know they're guidelines, not rules... but guidelines are really just loosely enforced rules. :P Lints CheckedComments are included only in cases of problems or suggestions.
|
While "fat pointer" may not be a concept presented to end-users, I think |
@pnkfelix I considered that, but my concern is that Also, just to be clear, I'm uncertain whether I should just go ahead with the proposed changes, and make a PR, move all this into an RFC, or keep this here. Honestly, the RFC thing only just occurred to me since it was "oh, this is fixing stuff that doesn't match the already accepted guidelines" as opposed to "let's deliberately break everything". I'm happy to go with whatever. :P |
Note: If some of these lints need a place to go, I can take them as part of rust-clippy. If necessary, I can put some more work into the library and publish it. |
Regarding the interaction with stable Rust, I think that we should adopt a plan like this:
The idea here is that if I am using somebody's package, I don't want to have compilation fail because we added a new lint in the meantime. But if I am editing my own source code, I absolutely do want compilation to fail. I feel like this bridges the gap and avoids the problem of |
#[feature(deny)]? Makes sense. That being said I'm a tad wary of making stability guarantees that depend on Cargo. But I guess that leads to a cleaner solution. |
To expand on the point I made here, we can even go further and say that specifying lints which are no longer included are also not errors etc. It seems like we should reserve the right to change/remove/refine lints as we please, in which case this is not a milestone blocker. Closing issue for now in favor of more specific proposals. |
Also opened rust-lang/rfcs#1029 |
@nikomatsakis At least some compiler output should be presented in this case. If rustc silently accepts lints that don't exist and thus don't do anything, the user can accidentally mistype the name of an important lint they care about and think they're being protected by it, when in fact no such protection is present. |
We have a huge number of lints, and all of their names are at least decisions we cannot change. We have a naming convention RFC which dictates what each lint should be called, and we need to audit all names as some may have slipped through the cracks (we have a few new ones since the RFC was accepted).
More generally, we need to decide what lint functionality we're going to have in the compiler. Do we want to ship every single lint as-is today, or do we want to cut back on the number of lints that we're shipping with?
And as a final point, we should make a concrete decision about whether the functionality of lints can be altered in stable Rust. A lint may have a bug, for example, which issues new warnings in a new release, thereby breaking crates with
#![deny(warnings)]
.Nominating for 1.0-beta as we may want to decide to remove some lints (but if we don't, nominating for 1.0-polish).
The text was updated successfully, but these errors were encountered: