Skip to content

Conversation

jullanggit
Copy link

@jullanggit jullanggit commented Aug 31, 2025

Disclaimer

This is my first PR to rust, so if I missed/could improve something about this PR, please excuse and tell me!

The improvement

The metavar_expr_concat feature currently does not seem to support nested repetitions, and throws an ICE without much explanation if the relevant code path is hit.
This PR adds a draft compiler error that attempts to explain the issue. I am not 100% sure what all the ways of triggering this error are, so the message is currently pretty generic, please do correct me if there's something wrong with it or it could be improved.

Thank you for you time!

Fixes #140479.

@rustbot
Copy link
Collaborator

rustbot commented Aug 31, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 31, 2025
@jullanggit
Copy link
Author

@rustbot label F-macro_metavar_expr_concat

@rustbot rustbot added the F-macro_metavar_expr_concat `#![feature(macro_metavar_expr_concat)]` label Aug 31, 2025
@rust-log-analyzer

This comment has been minimized.

@fmease
Copy link
Member

fmease commented Aug 31, 2025

Please add a regression test, squash your commits and make the error message start with a lower case letter (https://rustc-dev-guide.rust-lang.org/diagnostics.html?highlight=diagnostic#diagnostic-output-style-guide)

@rust-log-analyzer

This comment has been minimized.

@jullanggit
Copy link
Author

@fmease like this?

@jullanggit jullanggit force-pushed the patch-1 branch 2 times, most recently from 99dc5b4 to 22a770c Compare August 31, 2025 21:50
@rust-log-analyzer

This comment has been minimized.

@jullanggit
Copy link
Author

I seem to have fixed the crash from #140479, and already covered the issue in my regression test. Should I just remove the crash test?

Replace unimplemented()! with a more helpful compiler error.
@rustbot
Copy link
Collaborator

rustbot commented Sep 1, 2025

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

@jullanggit
Copy link
Author

Is everything alright now?

@fmease
Copy link
Member

fmease commented Sep 1, 2025

Thanks, we're good!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 1, 2025

📌 Commit f6e7c81 has been approved by fmease

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-review Status: Awaiting review from the assignee but also interested parties. labels Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-macro_metavar_expr_concat `#![feature(macro_metavar_expr_concat)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

ICE: expand: unimplemented
6 participants