File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Regression test for #58490
2
+
3
+ macro_rules! a {
4
+ ( @1 $i: item ) => {
5
+ a! { @2 $i }
6
+ } ;
7
+ ( @2 $i: item ) => {
8
+ $i
9
+ } ;
10
+ }
11
+ mod b {
12
+ a ! {
13
+ @1
14
+ #[ macro_export]
15
+ macro_rules! b { ( ) => ( ) }
16
+ }
17
+ #[ macro_export]
18
+ macro_rules! b { ( ) => ( ) }
19
+ //~^ ERROR: the name `b` is defined multiple times
20
+ }
21
+ mod c {
22
+ #[ allow( unused_imports) ]
23
+ use crate :: b;
24
+ }
25
+
26
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0428]: the name `b` is defined multiple times
2
+ --> $DIR/issue-58490.rs:18:5
3
+ |
4
+ LL | macro_rules! b { () => () }
5
+ | -------------- previous definition of the macro `b` here
6
+ ...
7
+ LL | macro_rules! b { () => () }
8
+ | ^^^^^^^^^^^^^^ `b` redefined here
9
+ |
10
+ = note: `b` must be defined only once in the macro namespace of this module
11
+
12
+ error: aborting due to previous error
13
+
14
+ For more information about this error, try `rustc --explain E0428`.
You can’t perform that action at this time.
0 commit comments