-
Notifications
You must be signed in to change notification settings - Fork 13.5k
mbe: Rework diagnostics for metavariable expressions #142950
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
Conversation
There are changes to the cc @jieyouxu |
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. |
…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 .
@rustbot author |
Reminder, once the PR becomes ready for a review, use |
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
5366b37
to
b276ff8
Compare
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
Applied the suggestions then rebased. @bors r=petrochenkov rollup |
… 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(..)`.
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
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
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(..)`.
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