-
Notifications
You must be signed in to change notification settings - Fork 13.5k
mbe: Add tests and restructure metavariable expressions #143245
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
Merged
bors
merged 6 commits into
rust-lang:master
from
tgross35:metavariable-expr-organization
Jul 1, 2025
Merged
mbe: Add tests and restructure metavariable expressions #143245
bors
merged 6 commits into
rust-lang:master
from
tgross35:metavariable-expr-organization
Jul 1, 2025
+739
−668
Conversation
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
These tests have expanded beyond the RFC, so rename the directory `rfc-3086-metavar-expr` to `metavar-expressions`. `concat` (which wasn't part of the RFC) now fits in this group, so merge its tests into the `metavar-expressions` directory. Additionally rename some related `issue-*` tests.
There are changes to the cc @jieyouxu |
This comment has been minimized.
This comment has been minimized.
r=me after CI is fixed. |
Reminder, once the PR becomes ready for a review, use |
`syntax-errors` currently contains both syntax error tests (which don't need expansion) and tests for incorrect instantiations of the `count` metavariable expression (which do need expansion). Split the expansion-dependent tests to a separate file and remove unneeded invocations from `syntax-errors`, to ensure we are catching these before expansion.
Add tests showing the current state to make it more clear when output gets updated later in refactoring.
More diagnostic structs related to metavariable expressions will be introduced. Introduce the abbreviation "mve" which is reasonably unambiguous (`rg Mve` and `rg '(\b|_|-)mve(\b|_|-)'` return no results outside of a Thumb target feature) and use it for these diagnostic types. A new module is also created.
Move the `concat` implementation to a separate function so it is easier to work on. Other metavariable expressions are already split this way. This is a non-functional change.
Move this structure directly above the `parse_<expr>` functions that return it to keep top-down flow. This is a non-functional change.
44ef2e8
to
a1a0669
Compare
Only was missing an error annotation. @bors r=petrochenkov rollup |
bors
added a commit
that referenced
this pull request
Jul 1, 2025
Rollup of 8 pull requests Successful merges: - #143125 (Disable f16 on Aarch64 without neon for llvm < 20.1.1) - #143156 (inherit `#[align]` from trait method prototypes) - #143178 (rustdoc default faviocon) - #143234 (Replace `ItemCtxt::report_placeholder_type_error` match with a call to `TyCtxt::def_descr`) - #143245 (mbe: Add tests and restructure metavariable expressions) - #143257 (Upgrade dependencies in run-make-support) - #143263 (linkify CodeSuggestion in doc comments) - #143264 (fix: Emit suggestion filename if primary diagnostic span is dummy) Failed merges: - #143251 (bootstrap: add build.tidy-extra-checks option) r? `@ghost` `@rustbot` modify labels: rollup
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 .
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-tidy
Area: The tidy tool
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
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 .
r? @petrochenkov