Make the expansion of guard metavars begin guard non-terminals#155182
Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom Apr 13, 2026
Merged
Make the expansion of guard metavars begin guard non-terminals#155182rust-bors[bot] merged 1 commit intorust-lang:mainfrom
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
Collaborator
|
rustbot has assigned @petrochenkov. Use Why was this reviewer chosen?The reviewer was selected based on:
|
fmease
commented
Apr 12, 2026
Contributor
|
@bors r+ |
Contributor
rust-bors Bot
pushed a commit
that referenced
this pull request
Apr 13, 2026
…uwer Rollup of 10 pull requests Successful merges: - #155227 (`rust-analyzer` subtree update) - #153335 (Add #![unstable_removed(..)] attribute to track removed features) - #154932 (Handle RTN projections in assoc type restriction diagnostics) - #155096 (delegation: support proper interaction of user-specified args and impl Traits) - #155106 (cg_llvm: scalable vectors with `simd_cast` and `simd_select`) - #155140 (add regression test for OpenOptionsExt downstream compat) - #155182 (Make the expansion of guard metavars begin guard non-terminals) - #155226 (delegation: revert execution of hir_crate_items before delayed lowering) - #153997 (Use closures more consistently in `dep_graph.rs`.) - #155003 (update thin-vec)
rust-timer
added a commit
that referenced
this pull request
Apr 13, 2026
Rollup merge of #155182 - fmease:guard-exp-begins-guard, r=petrochenkov Make the expansion of guard metavars begin guard non-terminals While investigating something unrelated, I noticed a bug in the impl of unstable feature `macro_guard_matcher` (tracking issue: #153104). Namely, the following doesn't compile: ```rs #![feature(macro_guard_matcher)] macro_rules! a { ($guard:guard) => { b!($guard); }; } macro_rules! b { ($guard:guard) => {}; } a!(if true); ``` ``` error: no rules expected `guard` metavariable --> src/lib.rs:3:41 | 3 | macro_rules! a { ($guard:guard) => { b!($guard); }; } | ^^^^^^ no rules expected this token in macro call 4 | macro_rules! b { ($guard:guard) => {}; } | -------------- when calling this macro 5 | a!(if true); | ----------- in this macro invocation | note: while trying to match meta-variable `$guard:guard` --> src/lib.rs:4:19 | 4 | macro_rules! b { ($guard:guard) => {}; } | ^^^^^^^^^^^^ = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) ``` --- While I'm still skeptical of `guard` fragment specifiers in general (although I can't quite pinpoint why), I figured I should fix this issue.
4 tasks
github-actions Bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Apr 13, 2026
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#155227 (`rust-analyzer` subtree update) - rust-lang/rust#153335 (Add #![unstable_removed(..)] attribute to track removed features) - rust-lang/rust#154932 (Handle RTN projections in assoc type restriction diagnostics) - rust-lang/rust#155096 (delegation: support proper interaction of user-specified args and impl Traits) - rust-lang/rust#155106 (cg_llvm: scalable vectors with `simd_cast` and `simd_select`) - rust-lang/rust#155140 (add regression test for OpenOptionsExt downstream compat) - rust-lang/rust#155182 (Make the expansion of guard metavars begin guard non-terminals) - rust-lang/rust#155226 (delegation: revert execution of hir_crate_items before delayed lowering) - rust-lang/rust#153997 (Use closures more consistently in `dep_graph.rs`.) - rust-lang/rust#155003 (update thin-vec)
github-actions Bot
pushed a commit
to rust-lang/rust-analyzer
that referenced
this pull request
Apr 16, 2026
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#155227 (`rust-analyzer` subtree update) - rust-lang/rust#153335 (Add #![unstable_removed(..)] attribute to track removed features) - rust-lang/rust#154932 (Handle RTN projections in assoc type restriction diagnostics) - rust-lang/rust#155096 (delegation: support proper interaction of user-specified args and impl Traits) - rust-lang/rust#155106 (cg_llvm: scalable vectors with `simd_cast` and `simd_select`) - rust-lang/rust#155140 (add regression test for OpenOptionsExt downstream compat) - rust-lang/rust#155182 (Make the expansion of guard metavars begin guard non-terminals) - rust-lang/rust#155226 (delegation: revert execution of hir_crate_items before delayed lowering) - rust-lang/rust#153997 (Use closures more consistently in `dep_graph.rs`.) - rust-lang/rust#155003 (update thin-vec)
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.
While investigating something unrelated, I noticed a bug in the impl of unstable feature
macro_guard_matcher(tracking issue: #153104). Namely, the following doesn't compile:While I'm still skeptical of
guardfragment specifiers in general (although I can't quite pinpoint why), I figured I should fix this issue.