Skip to content

Conversation

@Voultapher
Copy link
Contributor

@Voultapher Voultapher commented Feb 23, 2025

Closes #82775

This is a revive of #120234, with the suggested move from the public assert_matches module to macros. This necessitates the rename of the internal macros modules to core_macros and std_macros respectively.

@rustbot
Copy link
Collaborator

rustbot commented Feb 23, 2025

r? @scottmcm

rustbot has assigned @scottmcm.
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

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-run-make Area: port run-make Makefiles to rmake.rs O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Feb 23, 2025
@Voultapher Voultapher changed the title Stabilize assert_matches and move it to core::macros Stabilize assert_matches and move it to core::macros Feb 23, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 23, 2025

HIR ty lowering was modified

cc @fmease

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

The run-make-support library was changed

cc @jieyouxu

Some changes occurred to the CTFE machinery

cc @rust-lang/wg-const-eval

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@Voultapher
Copy link
Contributor Author

To all the people that got cc'd feel free to check the changes, but they should only amount to import renames.

@rust-log-analyzer

This comment has been minimized.

@Voultapher Voultapher force-pushed the stabilize-assert-matches branch from 01b7c95 to 6859a17 Compare February 23, 2025 15:54
@rust-log-analyzer

This comment has been minimized.

@Voultapher
Copy link
Contributor Author

Voultapher commented Feb 24, 2025

Changing the filename of the private macros modules has wide reaching effects inside the rustc source code. Mostly the fix is to rename mentions to the path outside of rust code as in the error tests, but there are some places like src/tools/cargo/tests/testsuite/fix.rs that reference the path and I don't know why they do that.

@rustbot rustbot added the A-rustc-dev-guide Area: rustc-dev-guide label Feb 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2025

The Miri subtree was changed

cc @rust-lang/miri

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@scottmcm
Copy link
Member

Hmm, I found the FCP to stabilize in #82775 (comment)

But I couldn't find any decision on the module. So nominating for libs-api to weigh in on that part.

@scottmcm scottmcm added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. I-libs-api-nominated Nominated for discussion during a libs-api team meeting. S-waiting-on-team and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 20, 2025
@Voultapher
Copy link
Contributor Author

Voultapher commented Mar 20, 2025

The module name was suggested here #120234 (comment) and here #120234 (comment)

We discussed this in today's @rust-lang/libs-api meeting. The consensus we came up with was:

We want to stabilize this. We're not thrilled with the module name assert_matches (std::assert_matches::assert_matches!), and would prefer a more general name there. However, we don't want to delay stabilization while trying to bikeshed that name.

Ah -- then maybe core::assertions, though that's a bit more of a mouthful. A broader core::macros wouldn't be horrible either IMO, but I could understand hesitation about that.

Given how popular this feature is and the previously expressed desires of the libs-api team to avoid blocking on bikesheding, I'd appreciate it if we could avoid another round of bikesheding here. std::macros and core::macros are about as intuitive a place for a macro to be in. In the future we can pull assert_matches into the prelude for Rust edition 2027.

@Voultapher
Copy link
Contributor Author

Plus this PR has to touch a lot of files by necessity, so it be great if we could move forward in a reasonable amount of time to limit the amount of merge conflict resolution I'll have to do.

@scottmcm
Copy link
Member

Process-wise, a meeting consensus is generally not enough to make a one-way decision like picking a stable path, and it seems clear that this wasn't part of the previous FCP, so I'm not comfortable merging it without explicit libs-api assent.

If they disagree with my assessment that's fine, but it's their decision to make.

@Voultapher
Copy link
Contributor Author

Voultapher commented Mar 20, 2025

so I'm not comfortable merging it without explicit libs-api assent.

Neither am I. Let's please ask for their approval. What I'd like to avoid is a situation where we block this because the team is happy enough with the name but maybe there could be a better one and so the discussion starts.

@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 Jan 23, 2026
@Amanieu
Copy link
Member

Amanieu commented Jan 26, 2026

@rfcbot merge libs-api

@rust-rfcbot
Copy link
Collaborator

rust-rfcbot commented Jan 26, 2026

Team member @Amanieu 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!

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. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Jan 26, 2026
@rust-rfcbot
Copy link
Collaborator

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

@rust-rfcbot rust-rfcbot removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label Jan 27, 2026
@rust-bors

This comment has been minimized.

@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 Feb 6, 2026
@rust-rfcbot
Copy link
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.

@jhpratt
Copy link
Member

jhpratt commented Feb 7, 2026

r=me after rebasing

@Voultapher Voultapher force-pushed the stabilize-assert-matches branch from 1ef76ef to f266750 Compare February 7, 2026 12:13
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@Voultapher Voultapher force-pushed the stabilize-assert-matches branch from f266750 to 58df51b Compare February 8, 2026 21:14
@rustbot

This comment has been minimized.

@rust-bors

This comment has been minimized.

@Voultapher Voultapher force-pushed the stabilize-assert-matches branch from 58df51b to 9787178 Compare February 9, 2026 16:30
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
REPOSITORY                                   TAG       IMAGE ID       CREATED       SIZE
ghcr.io/dependabot/dependabot-updater-core   latest    afc745c7535d   2 weeks ago   783MB
=> Removing docker images...
Deleted Images:
untagged: ghcr.io/dependabot/dependabot-updater-core:latest
untagged: ghcr.io/dependabot/dependabot-updater-core@sha256:faae3d3a1dedd24cde388bb506bbacc0f7ed1eae99ebac129af66acd8540c84a
deleted: sha256:afc745c7535da1bb12f92c273b9a7e9c52c3f12c5873714b2542da259c6d9769
deleted: sha256:64e147d5e54d9be8b8aa322e511cda02296eda4b8b8d063c6a314833aca50e29
deleted: sha256:5cba409bb463f4e7fa1a19f695450170422582c1bc7c0e934d893b4e5f558bc6
deleted: sha256:cddc6ebd344b0111eaab170ead1dfda24acdfe865ed8a12599a34d338fa8e28b
deleted: sha256:2412c3f334d79134573cd45e657fb6cc0abd75bef3881458b0d498d936545c8d

@Amanieu
Copy link
Member

Amanieu commented Feb 9, 2026

@bors delegate+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 9, 2026

✌️ @Voultapher, you can now approve this pull request!

If @Amanieu told you to "r=me" after making some further change, then please make that change and post @bors r=Amanieu.

@Amanieu
Copy link
Member

Amanieu commented Feb 9, 2026

r=me once CI passes

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

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking Issue for assert_matches