diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-03-13 09:03:30 +0900 |
|---|---|---|
| committer | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-03-13 16:06:07 +0900 |
| commit | 081e32baba731377ed85ecb146977c51421e299b (patch) | |
| tree | d39e0359b1018903a4228e4790b4d98a20bcc4cd | |
| parent | 54b7d21f59a363e53eb1c31d76b40af2ff99321c (diff) | |
| download | rust-081e32baba731377ed85ecb146977c51421e299b.tar.gz rust-081e32baba731377ed85ecb146977c51421e299b.zip | |
Add test for issue-58490
| -rw-r--r-- | src/test/ui/macros/issue-58490.rs | 26 | ||||
| -rw-r--r-- | src/test/ui/macros/issue-58490.stderr | 14 |
2 files changed, 40 insertions, 0 deletions
diff --git a/src/test/ui/macros/issue-58490.rs b/src/test/ui/macros/issue-58490.rs new file mode 100644 index 00000000000..97e71c9a1ce --- /dev/null +++ b/src/test/ui/macros/issue-58490.rs @@ -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() {} diff --git a/src/test/ui/macros/issue-58490.stderr b/src/test/ui/macros/issue-58490.stderr new file mode 100644 index 00000000000..b1f0896f3b6 --- /dev/null +++ b/src/test/ui/macros/issue-58490.stderr @@ -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`. |
