-
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
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? |
99dc5b4
to
22a770c
Compare
This comment has been minimized.
This comment has been minimized.
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.
This PR changes a file inside |
Is everything alright now? |
Thanks, we're good! @bors r+ rollup |
Add compiler error when trying to use concat metavar expr in repetitions ## 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](rust-lang#124225) 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 rust-lang#140479.
Rollup of 10 pull requests Successful merges: - #144066 (stabilize c-style varargs for sysv64, win64, efiapi, aapcs) - #145783 (add span to struct pattern rest (..)) - #145961 (resolve: Avoid a regression from splitting prelude into two scopes) - #145962 (Ensure we emit an allocator shim when only some crate types need one) - #146064 (Add compiler error when trying to use concat metavar expr in repetitions) - #146067 (alloc: make Cow From impls const) - #146070 (rustdoc-search: skip loading unneeded fnData) - #146089 (fix a constness ordering bug in rustfmt) - #146094 (Make `Parser::parse_for_head` public for rustfmt usage) - #146102 (Remove dead code stemming from an old effects desugaring) r? `@ghost` `@rustbot` modify labels: rollup
Add compiler error when trying to use concat metavar expr in repetitions ## 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](rust-lang#124225) 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 rust-lang#140479.
Rollup of 9 pull requests Successful merges: - #145783 (add span to struct pattern rest (..)) - #145961 (resolve: Avoid a regression from splitting prelude into two scopes) - #145962 (Ensure we emit an allocator shim when only some crate types need one) - #146064 (Add compiler error when trying to use concat metavar expr in repetitions) - #146067 (alloc: make Cow From impls const) - #146070 (rustdoc-search: skip loading unneeded fnData) - #146089 (fix a constness ordering bug in rustfmt) - #146094 (Make `Parser::parse_for_head` public for rustfmt usage) - #146102 (Remove dead code stemming from an old effects desugaring) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 14 pull requests Successful merges: - #144066 (stabilize c-style varargs for sysv64, win64, efiapi, aapcs) - #145783 (add span to struct pattern rest (..)) - #146034 (Update target spec metadata of Arm64EC Windows and Trusty targets) - #146064 (Add compiler error when trying to use concat metavar expr in repetitions) - #146070 (rustdoc-search: skip loading unneeded fnData) - #146088 (constify impl Try for ControlFlow) - #146089 (fix a constness ordering bug in rustfmt) - #146091 (fix rustdoc `render_call_locations` panicking because of default span `DUMMY_SP` pointing at non local-source file) - #146094 (Make `Parser::parse_for_head` public for rustfmt usage) - #146102 (Remove dead code stemming from an old effects desugaring) - #146115 (Add maintainer for VxWorks) - #146116 (Adjust issue-118306.rs test after LLVM change) - #146117 (Fix search index generation) - #146118 (improve process::abort rendering in Miri backtraces) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #146064 - jullanggit:patch-1, r=fmease Add compiler error when trying to use concat metavar expr in repetitions ## 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](#124225) 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.
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.