Add --print=lint-levels
to retrieve lints levels
#833
Labels
major-change
A proposal to make a major change to rustc
T-compiler
Add this label so rfcbot knows to poll the compiler team
Proposal
Add a new unstable
--print
variantlint-levels
(--print=lint-levels -Zunstable-options
) that would print out all the lints and their associated levels (allow
,warn
,deny
,forbid
) based on the regular Rust rules at crate root, that is:-W
,-A
, ...)#![allow]
,#![warn]
, ...)warnings
lint groupThe output format would be
LINT_NAME=LINT_LEVEL
, e.g.:Motivation
Exposing more stuff for external tools. 😄
In particular, exposing the actual lint level for lints could help external tools (like Cargo) extend some built-ins lints, e.g.
unknown_lints
for Cargo[lints]
table1, which would not need to try to compute the lint level, which require knowing the default, interpreting rustc args (and dealing withRUSTFLAGS
), ... all of which are non-trivial.Delegating all that work to the source of truth (rustc), makes it nearly "trivial" for those tools to know the lint level and re-use it.
Mentors or Reviewers
My-self for the work.
Process
The main points of the Major Change Process are as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.
Footnotes
Cargo has not committed to using this new flag, it should be kept as an example, but it's still a good motivation to try out the flag ↩
The text was updated successfully, but these errors were encountered: