Skip to content

Commit

Permalink
fix rebase fallout due to #69497.
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Mar 24, 2020
1 parent d071035 commit c415f12
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
12 changes: 5 additions & 7 deletions src/test/ui/macros/trace_faulty_macros.rs
@@ -1,6 +1,6 @@
// compile-flags: -Z trace-macros

#![recursion_limit="4"]
#![recursion_limit = "4"]

macro_rules! my_faulty_macro {
() => {
Expand All @@ -24,9 +24,7 @@ macro_rules! my_recursive_macro {
}

macro_rules! my_macro {
() => {

};
() => {};
}

fn main() {
Expand All @@ -39,7 +37,7 @@ fn main() {
}

#[my_macro]
fn use_bang_macro_as_attr(){}
fn use_bang_macro_as_attr() {}

#[derive(Debug)]
fn use_derive_macro_as_attr(){}
#[derive(Debug)] //~ ERROR `derive` may only be applied to structs
fn use_derive_macro_as_attr() {}
23 changes: 20 additions & 3 deletions src/test/ui/macros/trace_faulty_macros.stderr
Expand Up @@ -13,7 +13,7 @@ LL | my_faulty_macro!();
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

note: trace_macro
--> $DIR/trace_faulty_macros.rs:33:5
--> $DIR/trace_faulty_macros.rs:31:5
|
LL | my_faulty_macro!();
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -35,7 +35,7 @@ LL | my_recursive_macro!();
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

note: trace_macro
--> $DIR/trace_faulty_macros.rs:34:5
--> $DIR/trace_faulty_macros.rs:32:5
|
LL | my_recursive_macro!();
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -60,5 +60,22 @@ LL | let a = pat_macro!();
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors
error: `derive` may only be applied to structs, enums and unions
--> $DIR/trace_faulty_macros.rs:42:1
|
LL | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^

note: trace_macro
--> $DIR/trace_faulty_macros.rs:36:13
|
LL | let a = pat_macro!();
| ^^^^^^^^^^^^
|
= note: expanding `pat_macro! { }`
= note: to `pat_macro ! (A { a : a, b : 0, c : _, .. }) ;`
= note: expanding `pat_macro! { A { a : a, b : 0, c : _, .. } }`
= note: to `A { a: a, b: 0, c: _, .. }`

error: aborting due to 4 previous errors

0 comments on commit c415f12

Please sign in to comment.