Skip to content
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

Improve error message: missing ; in macro_rules #125180

Merged
merged 1 commit into from
May 18, 2024

Conversation

mu001999
Copy link
Contributor

Fixes #124968

@rustbot
Copy link
Collaborator

rustbot commented May 16, 2024

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 16, 2024
@fmease fmease changed the title Imporve error message: missing ; in macro_rules Improve error message: missing ; in macro_rules May 16, 2024
@Nilstrieb
Copy link
Member

this code is very perf sensitive, so let's check
@bors try @rust-timer queue
If perf is OK I'd like you to refactor the code a bit to make this Option<Token> clearer, but let's check it first.

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 16, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 16, 2024
… r=<try>

Improve error message: missing `;` in macro_rules

Fixes rust-lang#124968
@bors
Copy link
Contributor

bors commented May 16, 2024

⌛ Trying commit 26f0246 with merge 7af9416...

@bors
Copy link
Contributor

bors commented May 16, 2024

☀️ Try build successful - checks-actions
Build commit: 7af9416 (7af9416f7e94983731941e40d1c092347b074419)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7af9416): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.7% [0.2%, 4.4%] 21
Regressions ❌
(secondary)
1.0% [0.4%, 1.8%] 13
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.7% [0.2%, 4.4%] 21

Max RSS (memory usage)

Results (primary 2.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.3% [2.3%, 2.3%] 1

Cycles

Results (primary 3.6%, secondary 3.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.6% [0.8%, 7.6%] 13
Regressions ❌
(secondary)
3.3% [2.0%, 4.7%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.6% [0.8%, 7.6%] 13

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 679.603s -> 680.293s (0.10%)
Artifact size: 316.12 MiB -> 316.16 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 16, 2024
@mu001999
Copy link
Contributor Author

@Nilstrieb How about the result? Looks like this change slows down Rustc a bit.

@Nilstrieb
Copy link
Member

yeah, that's too much. i very much like the improvement, but you need to try to figure out a faster way. maybe you can make use of the trait abstraction, where you try to avoid all work for the no-op tracker

@Nilstrieb
Copy link
Member

I've written that abstraction and logic myself, so if you have questions feel free to ask

@mu001999
Copy link
Contributor Author

@Nilstrieb thanks! I will try it ;)

@mu001999
Copy link
Contributor Author

I don't know if I have access but
@bors try @rust-timer queue

@bors
Copy link
Contributor

bors commented May 17, 2024

@mu001999: 🔑 Insufficient privileges: not in try users

@rust-timer

This comment has been minimized.

@Nilstrieb
Copy link
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 17, 2024
@bors
Copy link
Contributor

bors commented May 17, 2024

⌛ Trying commit 9081a66 with merge 7308417...

bors added a commit to rust-lang-ci/rust that referenced this pull request May 17, 2024
… r=<try>

Improve error message: missing `;` in macro_rules

Fixes rust-lang#124968
@bors
Copy link
Contributor

bors commented May 17, 2024

☀️ Try build successful - checks-actions
Build commit: 7308417 (7308417b77b10ac9dcee77ce6b5174c7284cabe4)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7308417): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
4.1% [1.2%, 6.9%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-0.6%, -0.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.5% [-0.6%, 6.9%] 3

Cycles

Results (primary 0.7%, secondary 1.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.4% [2.2%, 2.7%] 2
Regressions ❌
(secondary)
3.6% [2.2%, 5.0%] 6
Improvements ✅
(primary)
-1.1% [-1.1%, -1.1%] 2
Improvements ✅
(secondary)
-2.0% [-2.4%, -1.7%] 4
All ❌✅ (primary) 0.7% [-1.1%, 2.7%] 4

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 670.875s -> 671.044s (0.03%)
Artifact size: 315.99 MiB -> 316.20 MiB (0.07%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels May 17, 2024
@mu001999
Copy link
Contributor Author

@Nilstrieb The new result looks good! How do you think of this new change? Should I refactor the code?

@Nilstrieb
Copy link
Member

very cool. I skimmed the code and it looks okay, I will review it later.

tests/ui/macros/missing-semi.rs Outdated Show resolved Hide resolved
compiler/rustc_expand/src/mbe/diagnostics.rs Outdated Show resolved Hide resolved
compiler/rustc_expand/src/mbe/diagnostics.rs Outdated Show resolved Hide resolved
compiler/rustc_expand/src/mbe/diagnostics.rs Outdated Show resolved Hide resolved
compiler/rustc_expand/src/mbe/diagnostics.rs Outdated Show resolved Hide resolved
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 18, 2024
@mu001999 mu001999 force-pushed the improve/macro-diag branch 2 times, most recently from b75d408 to 62f509b Compare May 18, 2024 10:27
@mu001999 mu001999 requested a review from fee1-dead May 18, 2024 10:37
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 18, 2024
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@fee1-dead fee1-dead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@fee1-dead
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 18, 2024

📌 Commit c2be134 has been approved by fee1-dead

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 18, 2024
@bors
Copy link
Contributor

bors commented May 18, 2024

⌛ Testing commit c2be134 with merge 685a80f...

@bors
Copy link
Contributor

bors commented May 18, 2024

☀️ Test successful - checks-actions
Approved by: fee1-dead
Pushing 685a80f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 18, 2024
@bors bors merged commit 685a80f into rust-lang:master May 18, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 18, 2024
@mu001999 mu001999 deleted the improve/macro-diag branch May 18, 2024 16:05
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (685a80f): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (primary 4.6%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
4.6% [4.6%, 4.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.6% [4.6%, 4.6%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 668.952s -> 669.005s (0.01%)
Artifact size: 316.33 MiB -> 316.23 MiB (-0.03%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error message: missing ; in macro_rules! rules
7 participants