-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
reject inline const patterns pre-expansion #152548
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: main
Are you sure you want to change the base?
Conversation
|
r? @nnethercote rustbot has assigned @nnethercote. Use Why was this reviewer chosen?The reviewer was selected based on:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix! @bors r+ rollup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awkwardly, some cases of inline const pats can only be caught pre-expansion and some can only be caught post-expansion. #149667 switched from only rejecting the former to only rejecting the latter.
The existence of PatKind::Expr / $e:expr being allowed to be inserted into pats continues to make me sad.
Diagnostic stashing+stealing would allow us to use the diagnostic note (use a named …) from AST lowering again, instead of duplicating it here … at the cost of not showing this help under #[cfg(false)]. Might be overkill tho (and it definitely shouldn't be done in this PR).
…expansion, r=fmease reject inline const patterns pre-expansion Reverts the parser changes from rust-lang#149667 Fixes rust-lang#152499 Awkwardly, some cases of inline const pats can only be caught pre-expansion and some can only be caught post-expansion. rust-lang#149667 switched from only rejecting the former to only rejecting the latter.
…uwer Rollup of 11 pull requests Successful merges: - #146901 (Support AVRTiny devices in AVR inline assembly) - #150988 (Improve code suggestion for incorrect macro_rules! usage) - #152422 (Change query proc macro to be more rust-analyzer friendly) - #152496 (Fix multi-cgu+debug builds using autodiff by delaying autodiff till lto) - #152520 (Don't use `DepContext` in `rustc_middle::traits::cache`) - #152528 (Support serializing CodegenContext) - #152082 (Move tests) - #152444 (`-Znext-solver` Prevent committing unfulfilled unsized coercion) - #152486 (remove redundant backchain attribute in codegen) - #152529 (sparc64: enable abi compatibility test) - #152548 (reject inline const patterns pre-expansion)
…expansion, r=fmease reject inline const patterns pre-expansion Reverts the parser changes from rust-lang#149667 Fixes rust-lang#152499 Awkwardly, some cases of inline const pats can only be caught pre-expansion and some can only be caught post-expansion. rust-lang#149667 switched from only rejecting the former to only rejecting the latter.
Reverts the parser changes from #149667
Fixes #152499
Awkwardly, some cases of inline const pats can only be caught pre-expansion and some can only be caught post-expansion. #149667 switched from only rejecting the former to only rejecting the latter.