-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Add compiler error when trying to use concat metavar expr in repetitions #146064
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
base: master
Are you sure you want to change the base?
Conversation
r? @davidtwco rustbot has assigned @davidtwco. Use |
@rustbot label F-macro_metavar_expr_concat |
This comment has been minimized.
This comment has been minimized.
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) |
This comment has been minimized.
This comment has been minimized.
@fmease like this? |
Replace unimplemented()! with a more helpful compiler error.
The job Click to see the possible cause of the failure (guessed by this bot)
|
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!