Skip to content

fix: Do not #[macro_use] the sysroot crates#22784

Merged
Veykril merged 1 commit into
rust-lang:masterfrom
ChayimFriedman2:no-stdlib-macrouse
Jul 14, 2026
Merged

fix: Do not #[macro_use] the sysroot crates#22784
Veykril merged 1 commit into
rust-lang:masterfrom
ChayimFriedman2:no-stdlib-macrouse

Conversation

@ChayimFriedman2

Copy link
Copy Markdown
Contributor

They were so in the past, but in rust-lang/rust#139493 they were changed to not be, instead macros are now explicitly exported from the prelude. This is important as now there are macros (assert_matches!()) that are not exported by default despite sitting in the crate root.

That change has landed in 1.94.0, 4 Rust versions ago, and we only officially support that last stdlib, so I think it's fine to just not support older versions.

Fixes #22775; the issue was that we resolved the macro without the import, so we didn't offer auto-import and also considered the import unused.

They were so in the past, but in rust-lang/rust#139493 they were changed to not be, instead macros are now explicitly exported from the prelude. This is important as now there are macros (`assert_matches!()`) that are *not* exported by default despite sitting in the crate root.

That change has landed in 1.94.0, 4 Rust versions ago, and we only officially support that last stdlib, so I think it's fine to just not support older versions.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 13, 2026
@Veykril
Veykril added this pull request to the merge queue Jul 14, 2026
Merged via the queue into rust-lang:master with commit 711ead6 Jul 14, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 14, 2026
@ChayimFriedman2
ChayimFriedman2 deleted the no-stdlib-macrouse branch July 14, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handling of std::assert_matches and std::debug_assert_matches macros

3 participants