-
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
register_late_mod_pass
doesn't visit all attributes
#115571
Comments
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Sep 11, 2023
…e, r=oli-obk Call `LateLintPass::check_attribute` from `with_lint_attrs` Fixes rust-lang#115571 For regular `register_late_pass` lints also means that `last_node_with_lint_attrs` is correct when in `check_attribute`, I've added a test that previously failed for `clippy::allow_attributes` As far as I can see the only late lint in rustc that uses `check_attribute` is `unstable_features` which is allow by default and deprecated so this is mostly for clippy (or future rustc lints)
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Sep 11, 2023
…e, r=oli-obk Call `LateLintPass::check_attribute` from `with_lint_attrs` Fixes rust-lang#115571 For regular `register_late_pass` lints also means that `last_node_with_lint_attrs` is correct when in `check_attribute`, I've added a test that previously failed for `clippy::allow_attributes` As far as I can see the only late lint in rustc that uses `check_attribute` is `unstable_features` which is allow by default and deprecated so this is mostly for clippy (or future rustc lints)
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 11, 2023
Rollup merge of rust-lang#115739 - Alexendoo:lint-pass-check-attribute, r=oli-obk Call `LateLintPass::check_attribute` from `with_lint_attrs` Fixes rust-lang#115571 For regular `register_late_pass` lints also means that `last_node_with_lint_attrs` is correct when in `check_attribute`, I've added a test that previously failed for `clippy::allow_attributes` As far as I can see the only late lint in rustc that uses `check_attribute` is `unstable_features` which is allow by default and deprecated so this is mostly for clippy (or future rustc lints)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was testing using per module passes (like #113734) in Clippy and saw test failures when trying
clippy::allow_attributes
, it seems only inner attributes of the root crate are visited by per module late lint passesReproducer without having to compile clippy:
Compile + run rustc on
You'll see only one attribute in the output
The text was updated successfully, but these errors were encountered: