Skip to content

Conversation

@ehuss
Copy link
Contributor

@ehuss ehuss commented Jun 30, 2025

New rules:

  • macro.decl.scope.macro_use.intro
  • macro.decl.scope.macro_use.syntax
  • macro.decl.scope.macro_use.allowed-positions
  • macro.decl.scope.macro_use.duplicates

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jun 30, 2025
@rustbot

This comment has been minimized.

@traviscross traviscross added this pull request to the merge queue Oct 21, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Oct 21, 2025
@rustbot

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Oct 21, 2025

This PR was rebased onto a different master 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.

@ehuss ehuss added this pull request to the merge queue Oct 21, 2025
Merged via the queue into rust-lang:master with commit 52ce896 Oct 21, 2025
5 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Oct 21, 2025
```rust,ignore
#[macro_use(lazy_static)] // Or #[macro_use] to import all macros.
extern crate lazy_static;
Macros imported this way are imported into the [`macro_use` prelude], not textually, which means that they can be shadowed by any other name. While macros imported by `macro_use` can be used before the import statement, in case of a conflict, the last macro imported wins.
Copy link
Contributor

Choose a reason for hiding this comment

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

It's unfortunate that we document that the last macro wins.

I always wanted to rework this into the standard order-independent scheme with "glob imports" (#[macro_use]), "single imports" shadowing glob imports (#[macro_use(single)]), and glob-vs-glob conflicts reported on use.
We should be able to do in practice, I think, so it would be good to leave unspecified what happens in case of conflicts.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a good issue to cite for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

4 participants