mbe: Rework diagnostics for metavariable expressions#142950
Merged
bors merged 2 commits intorust-lang:masterfrom Jul 10, 2025
Merged
mbe: Rework diagnostics for metavariable expressions#142950bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Collaborator
|
There are changes to the cc @jieyouxu |
Contributor
Author
|
I split the nonfunctional changes here to a new PR, #143245. I think this should make it a bit more straightforward to do the other changes here. |
Contributor
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jul 1, 2025
…ation, r=petrochenkov mbe: Add tests and restructure metavariable expressions Add tests that show better diagnostics, and factor `concat` handling to a separate function. Each commit message has further details. This performs the nonfunctional perparation for further changes such as rust-lang#142950 and rust-lang#142975 .
Contributor
Author
|
@rustbot author |
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
rust-timer
added a commit
that referenced
this pull request
Jul 1, 2025
Rollup merge of #143245 - tgross35:metavariable-expr-organization, r=petrochenkov mbe: Add tests and restructure metavariable expressions Add tests that show better diagnostics, and factor `concat` handling to a separate function. Each commit message has further details. This performs the nonfunctional perparation for further changes such as #142950 and #142975 .
This comment was marked as resolved.
This comment was marked as resolved.
51693ef to
1146773
Compare
This comment has been minimized.
This comment has been minimized.
13a7e49 to
7e5760b
Compare
7e5760b to
5366b37
Compare
Contributor
Author
5366b37 to
b276ff8
Compare
petrochenkov
reviewed
Jul 9, 2025
Contributor
|
r=me with the comments addressed. |
b276ff8 to
dff37db
Compare
Give a more user-friendly diagnostic about the following:
* Trailing tokens within braces, e.g. `${foo() extra}`
* Missing parentheses, e.g. `${foo}`
* Incorrect number of arguments, with a hint about correct usage.
Change to a structural diagnostic, update the valid list, and move the valid list to a note.
dff37db to
87e9819
Compare
Contributor
Author
|
Applied the suggestions then rebased. @bors r=petrochenkov rollup |
Collaborator
tgross35
added a commit
to tgross35/rust
that referenced
this pull request
Jul 10, 2025
… r=petrochenkov mbe: Rework diagnostics for metavariable expressions Make the diagnostics for metavariable expressions more user-friendly. This mostly addresses syntactic errors; I will be following up with improvements to `concat(..)`.
bors
added a commit
that referenced
this pull request
Jul 10, 2025
Rollup of 9 pull requests Successful merges: - #141996 (Fix `proc_macro::Ident`'s handling of `$crate`) - #142911 (Remove support for dynamic allocas) - #142950 (mbe: Rework diagnostics for metavariable expressions) - #143270 (tests/codegen/enum/enum-match.rs: accept negative range attribute) - #143298 (`tests/ui`: A New Order [23/N]) - #143398 (tidy: add support for `--extra-checks=auto:` feature) - #143632 (fix: correct parameter names in LLVMRustBuildMinNum and LLVMRustBuildMaxNum FFI declarations) - #143644 (Add triagebot stdarch mention ping) - #143651 (Win: Use exceptions with empty data for SEH panic exception copies instead of a new panic) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
that referenced
this pull request
Jul 10, 2025
Rollup of 9 pull requests Successful merges: - #141996 (Fix `proc_macro::Ident`'s handling of `$crate`) - #142950 (mbe: Rework diagnostics for metavariable expressions) - #143011 (Make lint `ambiguous_glob_imports` deny-by-default and report-in-deps) - #143265 (Mention as_chunks in the docs for chunks) - #143270 (tests/codegen/enum/enum-match.rs: accept negative range attribute) - #143298 (`tests/ui`: A New Order [23/N]) - #143396 (Move NaN tests to floats/mod.rs) - #143398 (tidy: add support for `--extra-checks=auto:` feature) - #143644 (Add triagebot stdarch mention ping) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
Jul 10, 2025
Rollup merge of #142950 - tgross35:metavariable-expr-rework, r=petrochenkov mbe: Rework diagnostics for metavariable expressions Make the diagnostics for metavariable expressions more user-friendly. This mostly addresses syntactic errors; I will be following up with improvements to `concat(..)`.
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
Jul 12, 2025
Rollup of 9 pull requests Successful merges: - rust-lang#141996 (Fix `proc_macro::Ident`'s handling of `$crate`) - rust-lang#142950 (mbe: Rework diagnostics for metavariable expressions) - rust-lang#143011 (Make lint `ambiguous_glob_imports` deny-by-default and report-in-deps) - rust-lang#143265 (Mention as_chunks in the docs for chunks) - rust-lang#143270 (tests/codegen/enum/enum-match.rs: accept negative range attribute) - rust-lang#143298 (`tests/ui`: A New Order [23/N]) - rust-lang#143396 (Move NaN tests to floats/mod.rs) - rust-lang#143398 (tidy: add support for `--extra-checks=auto:` feature) - rust-lang#143644 (Add triagebot stdarch mention ping) r? `@ghost` `@rustbot` modify labels: rollup
Kobzol
pushed a commit
to Kobzol/rustc_codegen_gcc
that referenced
this pull request
Dec 21, 2025
Rollup of 9 pull requests Successful merges: - rust-lang/rust#141996 (Fix `proc_macro::Ident`'s handling of `$crate`) - rust-lang/rust#142950 (mbe: Rework diagnostics for metavariable expressions) - rust-lang/rust#143011 (Make lint `ambiguous_glob_imports` deny-by-default and report-in-deps) - rust-lang/rust#143265 (Mention as_chunks in the docs for chunks) - rust-lang/rust#143270 (tests/codegen/enum/enum-match.rs: accept negative range attribute) - rust-lang/rust#143298 (`tests/ui`: A New Order [23/N]) - rust-lang/rust#143396 (Move NaN tests to floats/mod.rs) - rust-lang/rust#143398 (tidy: add support for `--extra-checks=auto:` feature) - rust-lang/rust#143644 (Add triagebot stdarch mention ping) r? `@ghost` `@rustbot` modify labels: rollup
Kobzol
pushed a commit
to Kobzol/rustc_codegen_cranelift
that referenced
this pull request
Dec 29, 2025
Rollup of 9 pull requests Successful merges: - rust-lang/rust#141996 (Fix `proc_macro::Ident`'s handling of `$crate`) - rust-lang/rust#142950 (mbe: Rework diagnostics for metavariable expressions) - rust-lang/rust#143011 (Make lint `ambiguous_glob_imports` deny-by-default and report-in-deps) - rust-lang/rust#143265 (Mention as_chunks in the docs for chunks) - rust-lang/rust#143270 (tests/codegen/enum/enum-match.rs: accept negative range attribute) - rust-lang/rust#143298 (`tests/ui`: A New Order [23/N]) - rust-lang/rust#143396 (Move NaN tests to floats/mod.rs) - rust-lang/rust#143398 (tidy: add support for `--extra-checks=auto:` feature) - rust-lang/rust#143644 (Add triagebot stdarch mention ping) r? `@ghost` `@rustbot` modify labels: rollup
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.
Make the diagnostics for metavariable expressions more user-friendly. This mostly addresses syntactic errors; I will be following up with improvements to
concat(..).r? @petrochenkov