diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/macros/duplicate-builtin.rs | 17 | ||||
| -rw-r--r-- | tests/ui/macros/duplicate-builtin.stderr | 21 | ||||
| -rw-r--r-- | tests/ui/macros/unknown-builtin.rs | 5 | ||||
| -rw-r--r-- | tests/ui/macros/unknown-builtin.stderr | 14 |
4 files changed, 4 insertions, 53 deletions
diff --git a/tests/ui/macros/duplicate-builtin.rs b/tests/ui/macros/duplicate-builtin.rs deleted file mode 100644 index c75782128f4..00000000000 --- a/tests/ui/macros/duplicate-builtin.rs +++ /dev/null @@ -1,17 +0,0 @@ -//@ compile-flags:--crate-type lib -#![feature(decl_macro)] -#![feature(rustc_attrs)] - -#[rustc_builtin_macro] -pub macro test($item:item) { -//~^ NOTE previously defined - /* compiler built-in */ -} - -mod inner { - #[rustc_builtin_macro] - pub macro test($item:item) { - //~^ ERROR attempted to define built-in macro more than once [E0773] - /* compiler built-in */ - } -} diff --git a/tests/ui/macros/duplicate-builtin.stderr b/tests/ui/macros/duplicate-builtin.stderr deleted file mode 100644 index 887a4fbbdc8..00000000000 --- a/tests/ui/macros/duplicate-builtin.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0773]: attempted to define built-in macro more than once - --> $DIR/duplicate-builtin.rs:13:5 - | -LL | / pub macro test($item:item) { -LL | | -LL | | /* compiler built-in */ -LL | | } - | |_____^ - | -note: previously defined here - --> $DIR/duplicate-builtin.rs:6:1 - | -LL | / pub macro test($item:item) { -LL | | -LL | | /* compiler built-in */ -LL | | } - | |_^ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0773`. diff --git a/tests/ui/macros/unknown-builtin.rs b/tests/ui/macros/unknown-builtin.rs index 048f5d68d34..aa6e04d3fb8 100644 --- a/tests/ui/macros/unknown-builtin.rs +++ b/tests/ui/macros/unknown-builtin.rs @@ -1,12 +1,11 @@ -//@ error-pattern: attempted to define built-in macro more than once - #![feature(rustc_attrs)] #[rustc_builtin_macro] macro_rules! unknown { () => () } //~ ERROR cannot find a built-in macro with name `unknown` +// Defining another `line` builtin macro should not cause an error. #[rustc_builtin_macro] -macro_rules! line { () => () } //~ NOTE previously defined here +macro_rules! line { () => () } fn main() { line!(); diff --git a/tests/ui/macros/unknown-builtin.stderr b/tests/ui/macros/unknown-builtin.stderr index 22f54e04e54..1a83398891b 100644 --- a/tests/ui/macros/unknown-builtin.stderr +++ b/tests/ui/macros/unknown-builtin.stderr @@ -1,18 +1,8 @@ error: cannot find a built-in macro with name `unknown` - --> $DIR/unknown-builtin.rs:6:1 + --> $DIR/unknown-builtin.rs:4:1 | LL | macro_rules! unknown { () => () } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0773]: attempted to define built-in macro more than once - --> $SRC_DIR/core/src/macros/mod.rs:LL:COL - | -note: previously defined here - --> $DIR/unknown-builtin.rs:9:1 - | -LL | macro_rules! line { () => () } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0773`. |
