-
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
Support lint tool names in rustc command line options #86639
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
Does this mean we no longer need |
It shoudn't have any change there. This simply makes it so you can do |
The |
Thanks for the comments, @petrochenkov. I removed the rust-analyzer submodule update. |
@rustbot label -S-waiting-on-author +S-waiting-on-review |
This comment has been minimized.
This comment has been minimized.
This adds a ui test to make sure rustc accepts lint arguments such as `-A clippy::foo` when clippy is disabled.
This shares a little more code between checking command line and attribute lint specifications.
This is a little better now, although probably not quite ready to merge. I think there's some more cleanup still to do. Is it at least on the right path for solving the problem? I'm also having an issue with my tests. Even after adding the
|
This comment has been minimized.
This comment has been minimized.
The tests are missing |
Tests need some adjustments, but otherwise LGTM. |
Previously this was using a `.stderr` file, but that does not seem to work for all cases. This change uses `// error-pattern:` instead.
This comment has been minimized.
This comment has been minimized.
This change merges `check_lint_and_tool_name` into `check_lint_name` in order to avoid having two very similar functions. Also adds the `.stderr` file back for the test case, since apparently it is still needed.
Okay, this should be ready to go now. @rustbot label -S-waiting-on-author +S-waiting-on-review |
Thanks! |
📌 Commit 4a83a93 has been approved by |
Support lint tool names in rustc command line options When rustc is running without a lint tool such as clippy enabled, options for lints such as `clippy::foo` are meant to be ignored. This was already working for those specified by attrs, such as `#![allow(clippy::foo)]`, but this did not work for command line arguments like `-A clippy::foo`. This PR fixes that issue. Note that we discovered this issue while discussing rust-lang/cargo#5034. Fixes rust-lang#86628.
Rollup of 9 pull requests Successful merges: - rust-lang#86639 (Support lint tool names in rustc command line options) - rust-lang#86812 (Recover from `&dyn mut ...` parse errors) - rust-lang#86917 (Add doc comment for `impl From<LayoutError> for TryReserveError`) - rust-lang#86925 (Add self to mailmap) - rust-lang#86927 (Sync rustc_codegen_cranelift) - rust-lang#86932 (Fix ICE when misplaced visibility cannot be properly parsed) - rust-lang#86933 (Clean up rustdoc static files) - rust-lang#86955 (Fix typo in `ops::Drop` docs) - rust-lang#86956 (Revert "Add "every" as a doc alias for "all".") Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
When rustc is running without a lint tool such as clippy enabled, options for lints such as
clippy::foo
are meant to be ignored. This was already working for those specified by attrs, such as#![allow(clippy::foo)]
, but this did not work for command line arguments like-A clippy::foo
. This PR fixes that issue.Note that we discovered this issue while discussing rust-lang/cargo#5034.
Fixes #86628.