forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#104347 - notriddle:notriddle/import-macro-f…
…rom-self-fixup, r=TaKO8Ki diagnostics: suggest changing `s@self::{macro}@::macro` for exported Fixes rust-lang#99695
- Loading branch information
Showing
7 changed files
with
121 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// run-rustfix | ||
#![allow(unused, nonstandard_style)] | ||
mod m { | ||
|
||
mod p { | ||
#[macro_export] | ||
macro_rules! nu { | ||
{} => {}; | ||
} | ||
|
||
pub struct other_item; | ||
} | ||
|
||
use ::nu; | ||
pub use self::p::{other_item as _}; | ||
//~^ ERROR unresolved import `self::p::nu` [E0432] | ||
//~| HELP a macro with this name exists at the root of the crate | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// run-rustfix | ||
#![allow(unused, nonstandard_style)] | ||
mod m { | ||
|
||
mod p { | ||
#[macro_export] | ||
macro_rules! nu { | ||
{} => {}; | ||
} | ||
|
||
pub struct other_item; | ||
} | ||
|
||
pub use self::p::{nu, other_item as _}; | ||
//~^ ERROR unresolved import `self::p::nu` [E0432] | ||
//~| HELP a macro with this name exists at the root of the crate | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error[E0432]: unresolved import `self::p::nu` | ||
--> $DIR/issue-99695-b.rs:14:23 | ||
| | ||
LL | pub use self::p::{nu, other_item as _}; | ||
| ^^ no `nu` in `m::p` | ||
| | ||
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined | ||
help: a macro with this name exists at the root of the crate | ||
| | ||
LL ~ use ::nu; | ||
LL ~ pub use self::p::{other_item as _}; | ||
| | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0432`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// run-rustfix | ||
#![allow(unused, nonstandard_style)] | ||
mod m { | ||
#[macro_export] | ||
macro_rules! nu { | ||
{} => {}; | ||
} | ||
|
||
pub struct other_item; | ||
|
||
use ::nu; | ||
pub use self::{other_item as _}; | ||
//~^ ERROR unresolved import `self::nu` [E0432] | ||
//~| HELP a macro with this name exists at the root of the crate | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// run-rustfix | ||
#![allow(unused, nonstandard_style)] | ||
mod m { | ||
#[macro_export] | ||
macro_rules! nu { | ||
{} => {}; | ||
} | ||
|
||
pub struct other_item; | ||
|
||
pub use self::{nu, other_item as _}; | ||
//~^ ERROR unresolved import `self::nu` [E0432] | ||
//~| HELP a macro with this name exists at the root of the crate | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error[E0432]: unresolved import `self::nu` | ||
--> $DIR/issue-99695.rs:11:20 | ||
| | ||
LL | pub use self::{nu, other_item as _}; | ||
| ^^ no `nu` in `m` | ||
| | ||
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined | ||
help: a macro with this name exists at the root of the crate | ||
| | ||
LL ~ use ::nu; | ||
LL ~ pub use self::{other_item as _}; | ||
| | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0432`. |