-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Rewrite the new attribute argument parser #144689
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
Conversation
799d605
to
7b3bb12
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Rewrite the new attribute parser
@@ -51,12 +37,26 @@ error[E0589]: invalid alignment value: not a power of two | |||
LL | #[rustc_align(0)] | |||
| ^ | |||
|
|||
error: expected unsuffixed literal, found `-` |
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.
it would be pretty cool if we could explain here what an unsuffixed literal is. Maybe give an example of one with a short explanation. It's not required, but does teach the language better through diagnostics which is always cool
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.
I improved the error a lot :)
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `-`
--> $DIR/malformed-fn-align.rs:29:15
|
LL | #[rustc_align(-1)]
| ^
|
help: negative numbers are not literals, try removing the `-` sign
|
LL - #[rustc_align(-1)]
LL + #[rustc_align(1)]
|
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (acc46aa): 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 (secondary -1.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -0.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: 469.342s -> 468.873s (-0.10%) |
(match-stress looks currently noisy to me) |
Mhm, we came to the same conclusion (@JonathanBrouwer ) |
4c9a573
to
244cefa
Compare
tests/ui/issues/issue-32782.rs
Outdated
@@ -4,7 +4,7 @@ macro_rules! bar ( | |||
|
|||
macro_rules! foo ( | |||
() => ( | |||
#[allow_internal_unstable] //~ ERROR allow_internal_unstable side-steps | |||
#[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps |
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.
BREAKING CHANGE:
Previously, attributes on macro calls were partially checked for correct syntax (only what check_builtin_meta_item
can check).
After this PR, the attributes are fully parsed.
In any case, these attributes are always completely ignored, except for #[cfg]
, which was always completely parsed and still is and is not affected by this breaking change.
@@ -1095,7 +1095,7 @@ impl<'a> Parser<'a> { | |||
/// Parses a comma-separated sequence delimited by parentheses (e.g. `(x, y)`). | |||
/// The function `f` must consume tokens until reaching the next separator or | |||
/// closing bracket. | |||
fn parse_paren_comma_seq<T>( | |||
pub fn parse_paren_comma_seq<T>( |
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.
I've had to make quite a few of these functions public, how problematic is that?
I don't think it matters right, or at least it's better than the alternative of copying them over
244cefa
to
c0f407d
Compare
@rustbot ready |
r? @SparrowLii rustbot has assigned @SparrowLii. Use |
|
This comment has been minimized.
This comment has been minimized.
@rustbot author |
Reminder, once the PR becomes ready for a review, use |
b203b21
to
3170d9d
Compare
@rustbot ready |
☔ The latest upstream changes (presumably #145728) made this pull request unmergeable. Please resolve the merge conflicts. |
3170d9d
to
ec5b2cc
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. |
@bors r+ |
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 831e291 (parent) -> f5703d5 (this PR) Test differencesShow 31 test diffsStage 1
Stage 2
Additionally, 2 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard f5703d5dd3eec176f86a6e9bf7e668b48b84eabb --output-dir test-dashboard And then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
Finished benchmarking commit (f5703d5): comparison URL. Overall result: ❌ regressions - 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)Results (primary 0.2%, secondary 2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (secondary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 466.749s -> 466.339s (-0.09%) |
Fixes #143940
This rewrites the parser, should improve performance and maintainability.
This can be reviewed commit by commit