- Notifications
You must be signed in to change notification settings - Fork 13.8k
Port #[cfg_attr]
to the new attribute parsing infrastructure #147532
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
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
10cf134
to e9bdfb0
Compare r? @jdonszelmann |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Port `#[cfg_attr]` to the new attribute parsing infrastructure
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (ff502cb): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -2.2%, secondary 0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 475.312s -> 475.298s (-0.00%) |
Some changes occurred in compiler/rustc_attr_parsing |
LL + #[cfg_attr(true, #[inline(never)])] | ||
| | ||
LL - #[cfg_attr(true, inline())] | ||
LL + #[cfg_attr(true, #[inline])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ugly but not a regression, this was already broken before.
#147693
I'll fix this in a separate PR, since this one is already a little big
@jdonszelmann I think the perf looks reasonable, more improvements than regressions and it's all secondary benchmarks anyways. Feel free to disagree and I can look into the regressions more though. |
8e534b9
to 2d7c376
Compare Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2d7c376
to 1a84725
Compare This PR was rebased onto a different master 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. |
const CFG_ATTR_NOTE_REF: &str = "for more information, visit \ | ||
<https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>"; | ||
| ||
match cfg_attr.get_normal_item().args { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be nicer to somehow use our new attribute parser logic here already? Especially with the prospect of throwing the old one out some day
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that the argument of cfg_attr
are not required to be a valid meta item. The sub-attribute could be a proc macro attribute, in which case we still need to have access to the TokenStream
. I could not find a nice way to achieve this goal with the new attribute parser logic.
The old attribute parser is not actually used here afaik, we don't parse to a MetaItem
here. So throwing the old one out should still be possible with this implementation
1a84725
to 48ca34d
Compare This comment has been minimized.
This comment has been minimized.
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
48ca34d
to 5e34be1
Compare
This work in progress, not ready for review.
PR mostly for ci/perf runs