Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRFC: Prevent lint changes being a breaking change #1193
Conversation
alexcrichton
added
the
T-dev-tools
label
Jul 8, 2015
This comment has been minimized.
This comment has been minimized.
sfackler
reviewed
Jul 8, 2015
| # Drawbacks | ||
| This RFC adds surface area to the command line of the compiler with a relatively | ||
| obscure option `--cap-lints`. The option will almost never be passed by anything |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
alexcrichton
Jul 8, 2015
Author
Member
We do currently kinda have this already, the --help --verbose page is a little longer than --help. I'd also prefer to continue to consider -Z as "unstable flags", aka flags that Cargo should avoid.
This comment has been minimized.
This comment has been minimized.
|
Big |
nrc
assigned
alexcrichton
Jul 8, 2015
This comment has been minimized.
This comment has been minimized.
|
+1 from me. |
huonw
reviewed
Jul 13, 2015
| ``` | ||
|
|
||
| For example when `--cap-lints allow` is passed, all instances of `#[warn]`, | ||
| `#[deny]`, and `#[forbid] are ignored. If, however `--cap-lints warn` is passed |
This comment has been minimized.
This comment has been minimized.
huonw
reviewed
Jul 13, 2015
| obscure option `--cap-lints`. The option will almost never be passed by anything | ||
| other than Cargo, so having it show up here is a little unfortunate. | ||
| Some crates may inadvertently rely on memory safety through lints, or otherwise |
This comment has been minimized.
This comment has been minimized.
huonw
Jul 13, 2015
Member
I think it's not entirely unreasonable for crates to rely on their own custom lints to guarantee memory safety (I think servo does this). The key point being custom. One way to tackle this is for the capping to only apply to built-in lints?
This comment has been minimized.
This comment has been minimized.
alexcrichton
Jul 13, 2015
Author
Member
That makes sense to me, although it's possible that modifications to the compiler could also cause custom lints to trigger more warnings. For example if the compiler collected a set of "mutable variables never used mutably" and then a custom lint (e.g. pretend we didn't have a built-in one) iterated this set and issued warnings, when we fix the compiler to add more items to this set (if they were forgotten earlier), the change would bubble down to custom lints.
I do agree though that we could probably tackle this later on. Custom lints could perhaps register themselves as "not having a cap" which could opt-in to possibly breaking changes.
This comment has been minimized.
This comment has been minimized.
|
After being bit hard by |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
The tools team has decided to place this RFC in its final comment period. |
alexcrichton
added
the
final-comment-period
label
Jul 16, 2015
brson
added a commit
to brson/rust
that referenced
this pull request
Jul 20, 2015
This was referenced Jul 20, 2015
bors
added a commit
to rust-lang/rust
that referenced
this pull request
Jul 21, 2015
alexcrichton
referenced this pull request
Jul 22, 2015
Merged
Rewrite the improper_ctypes lint. #26583
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Jul 24, 2015
alexcrichton
referenced this pull request
Jul 24, 2015
Closed
Implement a cap on lints on the rustc CLI #27259
This comment has been minimized.
This comment has been minimized.
|
The consensus of the tools team is to merge this RFC, so I'm going to do so! |
alexcrichton commentedJul 8, 2015
Add a new flag to the compiler,
--cap-lints, which set the maximum possiblelint level for the entire crate (and cannot be overridden). Cargo will then pass
--cap-lints allowto all upstream dependencies when compiling code.Fixes #1029.
Rendered