Uh oh!
There was an error while loading. Please reload this page.
Don't allow const to begin a nonterminal - #80135
Merged
Merged
Conversation
Thanks to Vadim Petrochenkov who [told me what the fix was][z]! [z]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/finding.20which.20macro.20rule.20to.20use/near/220240422
camelid
commented
Dec 17, 2020
MemberAuthor
Beta-nominating because this fixes a P-critical regression from stable to beta. |
petrochenkov
commented
Dec 17, 2020
Contributor
@bors r+ rollup |
bors
commented
Dec 17, 2020
Collaborator
📌 Commit d6f1787 has been approved by |
camelid
commented
Dec 17, 2020
MemberAuthor
Should this be p=1 because it fixes a P-critical regression? |
MemberAuthor
Likewise, I don't think this should be |
RalfJung added a commit
to RalfJung/rust
that referenced
this pull request
Dec 18, 2020
Don't allow `const` to begin a nonterminal Fixesrust-lang#79908. Thanks to Vadim Petrochenkov who [told me what the fix was][z]! [z]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/finding.20which.20macro.20rule.20to.20use/near/220240422 r? `@petrochenkov`
bors added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 18, 2020
Rollup of 6 pull requests Successful merges: - rust-lang#80121 (Change the message for `if_let_guard` feature gate) - rust-lang#80130 (docs: Edit rustc_span::symbol::Symbol method) - rust-lang#80135 (Don't allow `const` to begin a nonterminal) - rust-lang#80145 (Fix typo in rustc_typeck docs) - rust-lang#80146 (Edit formatting in Rust Prelude docs) - rust-lang#80147 (Add missing punctuation to std::alloc docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
petrochenkov
commented
Dec 19, 2020
Contributor
Ok, looks like the questions above already resolved themselves without my involvement. |
camelid
commented
Dec 19, 2020
MemberAuthor
Oh well :) |
Merged
bors added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 28, 2020
…ulacrum [beta] backports This backports the following to 1.49: * Revert change to trait evaluation order rust-lang#80132 * Don't allow `const` to begin a nonterminal rust-lang#80135 * Prevent caching normalization results with a cycle rust-lang#80246 r? `@Mark-Simulacrum`
lf- added a commit
to lf-/rust
that referenced
this pull request
Apr 26, 2021
This makes it possible to use `inline_const` (rust-lang#76001) and `let_chains` (rust-lang#53667) inside macros' `expr` patterns in a future edition by bifurcating the `expr` nonterminal in a similar way to `pat2021` to remove some backwards compatibility exceptions that disallow `const`/`let` at the beginning of an `expr` match. Fixesrust-lang#84155 and relaxes the backward compat restriction from rust-lang#80135 for a future edition. This is not intended to go into 2021 as it I don't think it's simple to write an automatic fix, and certainly not now that it's past the soft deadline for inclusion in 2021 by a long shot. Here is a pathological case of rust-lang#79908 that forces this to be an edition change: ```rust macro_rules! evil { ($e:expr) => { // or something else const {$e-1} }; (const $b:block) => { const {$b} } } fn main() { let x = 5; match x { evil!(const { 5 }) => panic!("oh no"), _ => (), }; } ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#79908.
Thanks to Vadim Petrochenkov who told me what the fix was!
r? @petrochenkov