Add test for issue-58490
This commit is contained in:
parent
54b7d21f59
commit
081e32baba
26
src/test/ui/macros/issue-58490.rs
Normal file
26
src/test/ui/macros/issue-58490.rs
Normal file
@ -0,0 +1,26 @@
|
||||
// Regression test for #58490
|
||||
|
||||
macro_rules! a {
|
||||
( @1 $i:item ) => {
|
||||
a! { @2 $i }
|
||||
};
|
||||
( @2 $i:item ) => {
|
||||
$i
|
||||
};
|
||||
}
|
||||
mod b {
|
||||
a! {
|
||||
@1
|
||||
#[macro_export]
|
||||
macro_rules! b { () => () }
|
||||
}
|
||||
#[macro_export]
|
||||
macro_rules! b { () => () }
|
||||
//~^ ERROR: the name `b` is defined multiple times
|
||||
}
|
||||
mod c {
|
||||
#[allow(unused_imports)]
|
||||
use crate::b;
|
||||
}
|
||||
|
||||
fn main() {}
|
14
src/test/ui/macros/issue-58490.stderr
Normal file
14
src/test/ui/macros/issue-58490.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error[E0428]: the name `b` is defined multiple times
|
||||
--> $DIR/issue-58490.rs:18:5
|
||||
|
|
||||
LL | macro_rules! b { () => () }
|
||||
| -------------- previous definition of the macro `b` here
|
||||
...
|
||||
LL | macro_rules! b { () => () }
|
||||
| ^^^^^^^^^^^^^^ `b` redefined here
|
||||
|
|
||||
= note: `b` must be defined only once in the macro namespace of this module
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0428`.
|
Loading…
Reference in New Issue
Block a user