Repository navigation
Undo accidental duplication checking for attributes on macro calls - #166374
Conversation
|
Hmm, are there actually attributes that are both allowed on macro invocations and produce errors when combined? If not then this PR actually isn't necessary. |
|
Ah, found one: #[link_ordinal(2)]
#[link_ordinal(3)]
println!();Can you add this as a test? |
|
Deprecated also works, I will use that as link_ordinal has platform dependant behavior |
| } else { | ||
| attrs.split_at(1) | ||
| }; | ||
| attrs = rest; |
There was a problem hiding this comment.
It's not obvious to me that this handles cases like
/// doc
#[abd]
/// doc2
#[edf] correctly, I'd just create a vec of doc attributes and then parse those together,
like
let doc_attrs = vec![];
for attr in attrs{
if is_doc_attr{
doc_attrs.push(attr);
} else {
parse(slice::from_ref(attr))
}
}
parse(doc_attrs)There was a problem hiding this comment.
Changed the implementation, makes sense
ea97746 to
93393fd
Compare
|
|
||
| // Parse all doc comments together in a group, to prevent a group of | ||
| // unused doc comments from emitting multiple lints | ||
| parse(doc_attrs.as_slice()); |
There was a problem hiding this comment.
Parsing nothing isn't zero cost, so you might be able to undo the (small) perf regressions in #166093 (comment) with
| parse(doc_attrs.as_slice()); | |
| if !doc_attrs.is_empty() { | |
| parse(doc_attrs.as_slice()); | |
| } |
There was a problem hiding this comment.
I'd be surprised if that is measurable, but also yeah makes sense to check it
93393fd to
0df0070
Compare
|
@bors r=mejrs |
…=mejrs Undo accidental duplication checking for attributes on macro calls one of r? @mejrs @GuillaumeGomez
…=mejrs Undo accidental duplication checking for attributes on macro calls one of r? @mejrs @GuillaumeGomez
…uwer Rollup of 5 pull requests Successful merges: - #164918 (Move lint validation to attribute parsing) - #166381 (`rust-analyzer` subtree update) - #166191 (Enable static-pie on all Musl targets) - #166250 (Add a reason suggestion for malformed lint attributes) - #166365 (Drop references to codebuild) Failed merges: - #166374 (Undo accidental duplication checking for attributes on macro calls)
…uwer Rollup of 6 pull requests Successful merges: - #164918 (Move lint validation to attribute parsing) - #166381 (`rust-analyzer` subtree update) - #166191 (Enable static-pie on all Musl targets) - #166390 (Turn `gca` into a macro 2.0 that expands to `k#gca(..)`) - #165764 (view-types: handle field accesses) - #166250 (Add a reason suggestion for malformed lint attributes) Failed merges: - #166374 (Undo accidental duplication checking for attributes on macro calls)
This comment has been minimized.
This comment has been minimized.
0df0070 to
035ee3f
Compare
|
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. |
|
@bors r=mejrs |
Rollup of 11 pull requests Successful merges: - #165769 (Fix invalid instantiation of fake intrinsic bodies) - #166374 (Undo accidental duplication checking for attributes on macro calls) - #166386 (Replace manual `AttributeParser` construction by `parse_limited_all`) - #162565 (Add `c_buffer_length` lint helper) - #166096 (llvm-wrapper: Pass more arguments to PreCodeGenCallback) - #166395 (std: fix positioned read/write on VxWorks) - #166404 (Change `ChildExt::kill_process_group` to be `&self`) - #166405 (Check for errors before encoding metadata) - #166412 (std: Fix locking test on GNU/Hurd) - #166413 (std: Fix symlink chmod test on GNU/Hurd) - #166421 (core: Stabilize `float_bits_const`)
Rollup merge of #166374 - JonathanBrouwer:undo-regression, r=mejrs Undo accidental duplication checking for attributes on macro calls one of r? @mejrs @GuillaumeGomez
|
Note This PR was benchmarked as part of triage of its containing rollup: triage URL. Finished benchmarking commit (359f812): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Artifact size: 406.38 MiB -> 405.72 MiB (-0.16%) |
|
??? From looking at the changes it does seem real |
|
He's beginning to believe... I wonder how this composes with your inline pr, it would be nice if these empty checks wouldnt be necessary |
one of r? @mejrs @GuillaumeGomez