Skip to content

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
merged 6 commits into from
Jul 1, 2025

Conversation

tgross35
Copy link
Contributor

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

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.
@rustbot rustbot added A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. labels Jun 30, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 30, 2025

There are changes to the tidy tool.

cc @jieyouxu

@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

r=me after CI is fixed.
@rustbot author

@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 Jun 30, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 30, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

tgross35 added 5 commits June 30, 2025 19:00
`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.
@tgross35 tgross35 force-pushed the metavariable-expr-organization branch from 44ef2e8 to a1a0669 Compare June 30, 2025 19:03
@tgross35
Copy link
Contributor Author

Only was missing an error annotation.

@bors r=petrochenkov rollup

@bors
Copy link
Collaborator

bors commented Jun 30, 2025

📌 Commit a1a0669 has been approved by petrochenkov

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 30, 2025
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
@bors bors merged commit cfe1942 into rust-lang:master Jul 1, 2025
10 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 1, 2025
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants