remove box_patterns - #156749
Conversation
|
The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease The Rustfmt subtree was changed cc @rust-lang/rustfmt The Clippy subtree was changed cc @rust-lang/clippy |
|
r? @Kivooeo rustbot has assigned @Kivooeo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
Which one? would |
|
I don't expect the crater breakage to be significant; if it is, we should discuss again. @rfcbot merge lang |
|
@tmandry has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
|
About to run crater. In my opinion check-only should be sufficient for this, do folks have other opinion? |
Yes, it's absolutely sufficient. This PR rejects previously valid code in the frontend of the compiler, it removes syntax. The only things that don't show up in check builds are monomorphization and codegen changes. IINM one thing which you miss out on in check-only crater runs are potential doctest regressions but that's just something you have to accept if you want to have "faster" crater runs, otherwise |
|
@bors try |
This comment has been minimized.
This comment has been minimized.
|
@craterbot run mode=check-only |
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
89626b8 to
3105e80
Compare
|
I rebased this, but right now this is still blocked on removing box pattern usage from clippy (rust-lang/rust-clippy#17008). Should I just include these changes in this PR as well? |
This comment has been minimized.
This comment has been minimized.
Ah, I missed that. Yes, feel free to update the clippy subtree in this PR given that it's but a mechanical change that has to happen to make our CI pass -- the changes will get sync'ed anyway. |
This comment has been minimized.
This comment has been minimized.
3105e80 to
09d89e2
Compare
This comment has been minimized.
This comment has been minimized.
09d89e2 to
0ca8951
Compare
|
@rustbot ready |
|
#156749 (comment) is still unresolved. We should decide whether to tackle it in a follow-up or fix it in this PR |
There was a problem hiding this comment.
It would probably be beneficial to rename this file accordingly
| error[E0425]: cannot find value `x` in this scope | ||
| --> $DIR/removed-syntax-box-patterns.rs:3:19 | ||
| | | ||
| LL | let _: char = x; | ||
| | ^ not found in this scope | ||
|
|
There was a problem hiding this comment.
(in reply to #156749 (comment))
Instead of emitting a fatal parse error (what you are suggesting), we could parse box $pat as builtin # deref($pat) (PatKind::Deref) which would also naturally fix this subsequent name resolution error & basically any other pathological cases you could think of (for reference, the PR currently uses PatKind::Err).
| } | ||
|
|
||
| /// Parses `box pat` | ||
| fn parse_pat_box(&mut self) -> PResult<'a, PatKind> { |
There was a problem hiding this comment.
Should we add some sort of "// FIXME: Remove this entire function on YYYY-MM-DD!" (similarly for the struct field case)? Not sure
View all comments
This PR removes the old feature
box_patterns, tracked in #29641. As explained in #29641 (comment), this feature will not be stabilized sincederef_patterns(#87121) is a better and more general version of this feature.It was not possible to remove this feature until recently since the compiler itself still depended on this feature. This was changed with rust-lang/compiler-team#984.
This PR currently breaks crates that rely on box patterns using the incorrect pre-expansion feature gating (see #154045 for more details). Therefore, this needs a crater run.
Closes #29641.
Closes #105099.
Closes #156110.