Conversation
5 tasks
5 tasks
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Mar 31, 2026
Merged
eytan-starkware
approved these changes
Mar 31, 2026
Contributor
eytan-starkware
left a comment
There was a problem hiding this comment.
@eytan-starkware reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on TomerStarkware).
TomerStarkware
approved these changes
Apr 1, 2026
Collaborator
TomerStarkware
left a comment
There was a problem hiding this comment.
@TomerStarkware made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on orizi).
b495f1a to
e43c38a
Compare
dbb21ea to
95108b3
Compare
95108b3 to
a9de8c0
Compare
e43c38a to
8dd8779
Compare
orizi
commented
Apr 1, 2026
Collaborator
Author
orizi
left a comment
There was a problem hiding this comment.
@orizi reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on orizi).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixed handling of declarative macro parameters that are missing kind specifiers by returning
Noneinstead of panicking withunreachable!(), and added a test case to verify proper error reporting for this scenario.Type of change
Please check one:
Why is this change needed?
The code was using
unreachable!()for a case that can actually occur when macro parameters are missing kind specifiers, causing the compiler to panic instead of gracefully handling the error and providing proper diagnostics to the user.What was the behavior or documentation before?
When a declarative macro parameter was missing a kind specifier (e.g.,
($x)instead of($x:expr)), the compiler would panic with an "unreachable" error during macro rule matching.What is the behavior or documentation after?
The compiler now gracefully handles missing kind specifiers by returning
Nonefrom the matching function, allowing proper error diagnostics to be generated (E1010: "Macro parameter must have a kind" and E2158: "No matching rule found in inline macro").Related issue or discussion (if any)
Fixes #9797
Additional context
The test case demonstrates that the compiler now properly reports two errors: one for the missing kind specifier in the macro definition, and another for the failed macro invocation due to no matching rules.
Note
Low Risk
Small, localized change that only affects invalid macro patterns by turning a panic into a normal match failure; low chance of impacting valid macro expansion.
Overview
Fixes declarative macro rule matching to gracefully fail when a macro parameter is missing its kind specifier:
is_macro_rule_match_exnow returnsNoneinstead of panicking viaunreachable!().Adds a semantic test case covering
macro m { ($x) => ... }to ensure the compiler reports the expected diagnostics (missing kind + no matching rule) rather than crashing.Written by Cursor Bugbot for commit a9de8c0. This will update automatically on new commits. Configure here.