Skip to content

Conversation

@yaahc
Copy link
Member

@yaahc yaahc commented Nov 26, 2025

experiment for #148610

This change takes advantage of the fact that macro_rules cannot be resolved via path-based scope by default1, letting us change their implicit visibility without changing their reach-ability from dependent crates for all existing stable code.

TODO

  • fix unreachable_pub lint to not apply directly to macro_rules definitions
  • implement feature flag

@petrochenkov the PR is split into two commits. The first adds tests that show the current behavior, the second implements the feature, modifies the tests to take advantage of the new feature, and adds a feature gate test.

Footnotes

  1. https://github.com/rust-lang/reference/pull/2055/files#diff-6ea1ee99d6fb8818703d2bd8bf5d373182871235ea102d2de541af0dd87d20bbR368-R374

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 26, 2025
@rust-log-analyzer

This comment has been minimized.

@petrochenkov petrochenkov self-assigned this Nov 26, 2025
@yaahc yaahc force-pushed the implicit-pub-macros branch from abaf5eb to 6be80a1 Compare December 12, 2025 21:28
@rust-log-analyzer

This comment has been minimized.

@yaahc yaahc force-pushed the implicit-pub-macros branch from 6be80a1 to 34baa79 Compare December 12, 2025 21:49
@rust-log-analyzer

This comment has been minimized.

@yaahc yaahc force-pushed the implicit-pub-macros branch from 34baa79 to db51cee Compare December 15, 2025 17:58
@rust-log-analyzer

This comment has been minimized.

@yaahc yaahc force-pushed the implicit-pub-macros branch 2 times, most recently from e49dfe5 to 600e45b Compare December 15, 2025 19:11
@rust-log-analyzer

This comment has been minimized.

@yaahc yaahc force-pushed the implicit-pub-macros branch 4 times, most recently from 3c85396 to 2670d21 Compare December 15, 2025 20:54
@yaahc yaahc marked this pull request as ready for review December 15, 2025 20:54
@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 Dec 15, 2025
@yaahc yaahc force-pushed the implicit-pub-macros branch 5 times, most recently from eea03df to 9853d97 Compare December 15, 2025 21:22
@yaahc yaahc force-pushed the implicit-pub-macros branch from 9853d97 to 0d1557a Compare December 16, 2025 21:44
@rustbot
Copy link
Collaborator

rustbot commented Dec 16, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants