Skip to content

core: Add assert_matches and debug_assert_matches to the next prelude - #164328

Open
tgross35 wants to merge 1 commit into
rust-lang:mainfrom
tgross35:assert-matches-prelude
Open

tgross35 wants to merge 1 commit into
rust-lang:mainfrom
tgross35:assert-matches-prelude

Conversation

@tgross35

Copy link
Copy Markdown
Member

As discussed at the tracking issue, there has been support for having these in the prelude, but adding to the current prelude wasn't possible because of conflicts with glob-imported macros. It is possible to add to the future edition's prelude, so do that here.

…lude

As discussed at the tracking issue, there has been support for having
these in the prelude, but adding to the current prelude wasn't possible
because of conflicts with glob-imported macros. It is possible to add to
the future edition's prelude, so do that here.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 14, 2026
@rustbot

rustbot commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

r? @JohnTitor

rustbot has assigned @JohnTitor.
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: libs
  • libs expanded to 12 candidates
  • Random selection from JohnTitor, Mark-Simulacrum, aapoalas

@tgross35

Copy link
Copy Markdown
Member Author

@rustbot label +I-libs-nominated

Nominating for @rust-lang/libs since I don't think this needs FCP right now (the module is unstable) but we should have some consensus on future prelude items so we don't need to re-litigate much when the edition is ready to ship. Should be a pretty easy decision.

@rustbot rustbot added the I-libs-nominated Nominated for discussion during a libs team meeting. label Oct 14, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor

I think it would make sense to productively FCP prelude changes and add them to the edition guide just so we have less work to do before the edition rolls around.

@tgross35

Copy link
Copy Markdown
Member Author

That was my initial thought, but I wasn't sure how to encode the result since it doesn't really make sense to set a stable attribute. I suppose we can just point to completed FCPs when the edition rolls around, worst case.

@rfcbot fcp merge libs

@rust-rfcbot

rust-rfcbot commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

@tgross35 has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

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/libs-ping: FCP proposed for libs, 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 Oct 14, 2026
@cuviper cuviper changed the title core: Add assert_matches and debug_assert_matches to the next pelude core: Add assert_matches and debug_assert_matches to the next prelude Oct 14, 2026
@clarfonthey

This comment was marked as outdated.

@cuviper

This comment was marked as outdated.

@clarfonthey

This comment was marked as outdated.

Comment thread library/core/src/prelude/mod.rs Resolved
@clarfonthey

Copy link
Copy Markdown
Contributor

So I guess to reclarify my thoughts:

  1. We should make it so that everything added to the rust_future prelude should be FCPed before added.
  2. This should go under the edition guide under some next-edition prelude additions section.
  3. We should block merging this on both those. Note that a reference PR should be efficient; doesn't need to be merged now.

@clarfonthey clarfonthey added A-edition-2027 Area: The 2027 edition (TBD) T-edition Relevant to the edition team. needs-reference-pr This language change needs an approved Reference PR to proceed. labels Oct 15, 2026
@nia-e nia-e removed the I-libs-nominated Nominated for discussion during a libs team meeting. label Oct 20, 2026
@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 Oct 20, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

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

@clarfonthey

Copy link
Copy Markdown
Contributor

FWIW: this should just be marked as stable in the module since I guess, even though it's a stability leak, we should be fine to just add it anyway since that leak already exists for all the other things in the module.

@Iurig

Iurig commented Oct 29, 2026

Copy link
Copy Markdown

I've wanted to reach for this more than once but ended up reaching for assert!(matches!()) instead in part due to laziness to import, so I wanted to express my support.

@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 Oct 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.

This branch has not been deployed

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

Labels

A-edition-2027 Area: The 2027 edition (TBD) 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. needs-reference-pr This language change needs an approved Reference PR to proceed. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-edition Relevant to the edition team. T-libs Relevant to the library team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants