Skip to content

Conversation

@traviscross
Copy link
Contributor

Currently, for macro_use, the last macro imported wins. This may be something that we consider to be a bug. Rather than documenting this normatively, then, let's stay normatively silent on that behavior and document the details of the situation with rustc in an admonition.

cc @ehuss @petrochenkov #1886 (comment)

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Oct 22, 2025
Comment on lines +395 to +396
> [!NOTE]
> `rustc` currently prefers the last macro in case of conflict. Don't rely on this. This behavior is unusual, as imports in Rust are generally order-independent. This behavior of `macro_use` may change in the future.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's a good issue to cite for this, we can cite it here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've opened rust-lang/rust#148025 for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Added it here.

Currently, for `macro_use`, the last macro imported wins.  This may
be something that we consider to be a bug.  Rather than documenting
this normatively, then, let's stay normatively silent on that behavior
and document the details of the situation with `rustc` in an
admonition.
@traviscross traviscross force-pushed the TC/loosen-mbe-last-macro-imported-wins branch from 97cadcf to 5b19599 Compare October 23, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: The marked PR is awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants