rustc_passes: lint unused #[path] attributes on inline modules - #158835
Conversation
|
Some changes occurred in compiler/rustc_passes/src/check_attr.rs cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_hir/src/attrs |
|
Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @theemathas (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
|
r? compiler |
|
This feels similar-ish to other warnings about misapplied attributes, at least some of which were treated more as FCW than regular warning. Maybe there's a reason I'm missing why this one should be different. @JonathanBrouwer what do you think? |
|
Reminder, once the PR becomes ready for a review, use |
|
|
c397ba1 to
37c3b37
Compare
This comment has been minimized.
This comment has been minimized.
#[path] attributes on inline modules
37c3b37 to
56dd0c2
Compare
|
@rustbot ready |
|
This pull request was unapproved. |
d468a2b to
6d83fae
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6d83fae to
a7636e9
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
|
@bors r+ |
…uwer Rollup of 12 pull requests Successful merges: - #160336 (Move attributes out of rustc_hir) - #160715 (ignore tests with the GCC backend if we can't find `libgccjit.so` for the target) - #157609 (fix: build-std on 32 bit arm with 64 bit time) - #160613 (Add regression test for unsized non-last struct field with overlapping impls) - #160658 (miri: implement more restrictive trivial-ABI checks) - #160704 (sort lint names in lint pass declarations) - #160707 (Add regression test for higher ranked fn pointer impl not general enough) - #160713 (Add regression test for #135287) - #160720 (triagebot: add ubiratan to infra-ci) - #160747 (rustc_errors: remove unused code) - #160751 (Add regression test for incremental borrowck ICE with generic const exprs) - #160753 (rustc_lint: remove unused rustc_attrs feature) Failed merges: - #158835 (rustc_passes: lint unused `#[path]` attributes on inline modules)
This comment has been minimized.
This comment has been minimized.
a7636e9 to
7b1731b
Compare
|
Some changes occurred in compiler/rustc_attr_ir |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
^ Rebased |
…uwer Rollup of 9 pull requests Successful merges: - #156935 (Introduce a `PinSafePointer` trait that generalizes `PinCoerceUnsized`) - #159834 (Apply str debugger visualizer to `*const str`, `*mut str` and `Box<str>`) - #160663 (Suggest add async for function sig with return expr in body) - #160732 (Optimize slice::contains for one-byte BytewiseEq types) - #157944 (Make `char::is_default_ignorable` unstably public) - #158835 (rustc_passes: lint unused `#[path]` attributes on inline modules) - #160754 (Rename more diagnostic files to `diagnostics.rs`) - #160755 (Merge `rustc_lint/lints.rs` into `diagnostics.rs`) - #160757 (Merge `rustc_attr_parsing/session_diagnostics.rs` into `diagnostics.rs`)
View all comments
Closes #157260.
This PR emits the
unused_attributeslint for#[path]attributes on inline modules when the attribute is unused.It also adds UI tests covering both linted and non-linted cases.
r? @theemathas