lint against repeated repr attributes - #157036
Conversation
This comment has been minimized.
This comment has been minimized.
|
Wearing my lang hat but not speaking as team consensus (since we've not talked about it): I think you should start with the "obviously good" version, and we can do future PRs later to expand it or to update severity. Concretely, thus, I'd say it should be a warning (because if it's inert it doesn't need to be deny) when you have a clearly-unnecessary one that wasn't emitted from a macro, or something like that. (Our bar in the compiler for deny-by-default is pretty high. My personal heuristic is whether it's worth running your unit tests despite the warning, and an inert extra attribute doesn't need to block that.) We can then look at impacts and ratchet it up over time or over an edition, but those decisions can be made later and don't need to block you making a useful lint in the meantime. I'm a bad reviewer for lint stuff code-wise, though, so let's try |
|
+1 to what @scottmcm said on how best to approach this. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Some changes occurred in compiler/rustc_passes/src/check_attr.rs |
This comment has been minimized.
This comment has been minimized.
ae3cdee to
314903c
Compare
|
r? jdonszelmann |
|
@ettolrach if you rebase and address what lang asked, let's go merge! :) |
224a101 to
9a370ca
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. |
9a370ca to
a363964
Compare
|
that's the merge conflicts fixed. would appreciate a quick look at the latest two commits to make sure that i added the lint to the unused group correctly :) |
|
@ettolrach could you squash the typo commits? Not all of them, I generally like many commits in a PR to show the way its built up, but those tiny ones should probably either be part of the other commits, or all typos together in one commit if you can. |
|
formatting changes you can keep in its own commit, though it's always nicer if you keep every commit formatted. Sometimes the rebase is bad though... |
|
r=me otherwise :) ping me once you reordered some commits and I'll merge it |
had to update several tests which used repeated aligns and packeds. they now produce both a warning and an error where appropriate (e.g. when using conflicting packeds) which i think is correct.
a363964 to
e99f23f
Compare
|
tests pass, that's ready to be merged now @jdonszelmann |
|
@bors r+ |
… r=jdonszelmann lint against repeated repr attributes fixes rust-lang#156029 by adding a lint against repeated repr attributes. r? scottmcm
…uwer Rollup of 7 pull requests Successful merges: - #157036 (lint against repeated repr attributes) - #160183 (panic_unwind: Use global_asm! for IMGREL relocations) - #161718 (Fix the wasm32-unknown-unknown target feature/cfg bug) - #161673 (Fix broken link to lang_items.rs in unstable book) - #161744 (Remove `RawDefPathHash`) - #161747 (explicitly state that allocations cannot grow to the left) - #161796 (Remove dead parse error recovery (underscores in expressions))
|
Note This PR was benchmarked as part of triage of its containing rollup: triage URL. Finished benchmarking commit (39d59b8): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary 2.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 0.6%, secondary 2.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 475.812s -> 480.439s (0.97%) |
View all comments
fixes #156029 by adding a lint against repeated repr attributes.
r? scottmcm