Skip to content

remove box_patterns - #156749

Open
cyrgani wants to merge 3 commits into
rust-lang:mainfrom
cyrgani:unbox-full
Open

remove box_patterns#156749
cyrgani wants to merge 3 commits into
rust-lang:mainfrom
cyrgani:unbox-full

Conversation

@cyrgani

@cyrgani cyrgani commented May 19, 2026

Copy link
Copy Markdown
Contributor

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 since deref_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.

@cyrgani cyrgani added S-blocked Status: Blocked on something else such as an RFC or other implementation work. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. I-lang-nominated Nominated for discussion during a lang team meeting. needs-crater This change needs a crater run to check for possible breakage in the ecosystem. labels May 19, 2026
@rustbot

rustbot commented May 19, 2026

Copy link
Copy Markdown
Collaborator

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

The Rustfmt subtree was changed

cc @rust-lang/rustfmt

The Clippy subtree was changed

cc @rust-lang/clippy

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels May 19, 2026
@rustbot

rustbot commented May 19, 2026

Copy link
Copy Markdown
Collaborator

r? @Kivooeo

rustbot has assigned @Kivooeo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 20 candidates

@cyrgani cyrgani changed the title remove box_patterrns remove box_patterns May 19, 2026
@rust-log-analyzer

This comment has been minimized.

@Kivooeo

Kivooeo commented May 19, 2026

Copy link
Copy Markdown
Member

Therefore, this needs a crater run

Which one? would check-only be sufficient for this?

Comment thread tests/ui/match/issue-42679.rs
@traviscross traviscross added the P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang label May 27, 2026
@tmandry tmandry added the T-lang Relevant to the language team label May 27, 2026
@tmandry

tmandry commented May 27, 2026

Copy link
Copy Markdown
Member

I don't expect the crater breakage to be significant; if it is, we should discuss again.

@rfcbot merge lang

@rust-rfcbot

rust-rfcbot commented May 27, 2026

Copy link
Copy Markdown
Collaborator

@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.
See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels May 27, 2026
@traviscross traviscross added the I-lang-radar Items that are on lang's radar and will need eventual work or consideration. label May 27, 2026
@traviscross

Copy link
Copy Markdown
Contributor

Looks good to me pending crater results; thanks @cyrgani.

@rfcbot reviewed
@rfcbot concern crater

@Kivooeo

Kivooeo commented May 29, 2026

Copy link
Copy Markdown
Member

About to run crater. In my opinion check-only should be sufficient for this, do folks have other opinion?

@fmease

fmease commented May 29, 2026

Copy link
Copy Markdown
Member

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 craterbot check would never be an option for anyone. In any case, the beta crater runs will run in build-and-test mode and exercise doctests anyway, so we'd still catch such regressions eventually and still have a bit of time to either revert the change or to send (more) downstream patches. Anyway, it's not super likely that anybody is using box patterns in doctests (without also using them in the main crater), I'd say.

@fmease

fmease commented May 29, 2026

Copy link
Copy Markdown
Member

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 29, 2026
@rust-bors

rust-bors Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 1639375 (163937523761cc0def32f1ba9ed63fdf65ad3478, parent: dc375db7d8df0aa450e622c529147c95eee756f5)

@Kivooeo

Kivooeo commented May 29, 2026

Copy link
Copy Markdown
Member

@craterbot run mode=check-only

@traviscross

This comment was marked as resolved.

@traviscross

Copy link
Copy Markdown
Contributor

As I understand it, the way we'd see breakage in stable rust is if a macro was relying on box $pat or $patpath { box $ident } being parsed as a pattern, since we weren't feature-gating box_patterns pre-expansion. As far as I could tell at least, nothing like that turned up in this crater report.

Based on this understanding, we can proceed.

@rfcbot resolve crater

@rust-rfcbot rust-rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Jun 20, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@Kivooeo Kivooeo added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 22, 2026
@rust-rfcbot rust-rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Jun 30, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

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.

@traviscross traviscross removed the P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang label Jul 8, 2026
@fmease

fmease commented Jul 30, 2026

Copy link
Copy Markdown
Member

AFAICT this only needs a rebase and a formal "r=" blessing from @Kivooeo, then this can be shipped.

Seems like @cyrgani has been inactive lately, so we could rebase for them.

@cyrgani

cyrgani commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

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?

@rust-log-analyzer

This comment has been minimized.

@fmease

fmease commented Jul 30, 2026

Copy link
Copy Markdown
Member

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?

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.

@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@cyrgani

cyrgani commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 10, 2026
@Kivooeo

Kivooeo commented Aug 11, 2026

Copy link
Copy Markdown
Member

#156749 (comment) is still unresolved. We should decide whether to tackle it in a follow-up or fix it in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. needs-crater This change needs a crater run to check for possible breakage in the ecosystem. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting

Projects

None yet