Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c415f12

Browse files
committedMar 24, 2020
fix rebase fallout due to rust-lang#69497.
1 parent d071035 commit c415f12

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed
 

‎src/test/ui/macros/trace_faulty_macros.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// compile-flags: -Z trace-macros
22

3-
#![recursion_limit="4"]
3+
#![recursion_limit = "4"]
44

55
macro_rules! my_faulty_macro {
66
() => {
@@ -24,9 +24,7 @@ macro_rules! my_recursive_macro {
2424
}
2525

2626
macro_rules! my_macro {
27-
() => {
28-
29-
};
27+
() => {};
3028
}
3129

3230
fn main() {
@@ -39,7 +37,7 @@ fn main() {
3937
}
4038

4139
#[my_macro]
42-
fn use_bang_macro_as_attr(){}
40+
fn use_bang_macro_as_attr() {}
4341

44-
#[derive(Debug)]
45-
fn use_derive_macro_as_attr(){}
42+
#[derive(Debug)] //~ ERROR `derive` may only be applied to structs
43+
fn use_derive_macro_as_attr() {}

‎src/test/ui/macros/trace_faulty_macros.stderr

+20-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LL | my_faulty_macro!();
1313
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
1414

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

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

63-
error: aborting due to 3 previous errors
63+
error: `derive` may only be applied to structs, enums and unions
64+
--> $DIR/trace_faulty_macros.rs:42:1
65+
|
66+
LL | #[derive(Debug)]
67+
| ^^^^^^^^^^^^^^^^
68+
69+
note: trace_macro
70+
--> $DIR/trace_faulty_macros.rs:36:13
71+
|
72+
LL | let a = pat_macro!();
73+
| ^^^^^^^^^^^^
74+
|
75+
= note: expanding `pat_macro! { }`
76+
= note: to `pat_macro ! (A { a : a, b : 0, c : _, .. }) ;`
77+
= note: expanding `pat_macro! { A { a : a, b : 0, c : _, .. } }`
78+
= note: to `A { a: a, b: 0, c: _, .. }`
79+
80+
error: aborting due to 4 previous errors
6481

0 commit comments

Comments
 (0)
Please sign in to comment.