]>
Commit | Line | Data |
---|---|---|
ea8adc8c | 1 | error: no rules expected the token `bcd` |
0731742a | 2 | --> $DIR/trace_faulty_macros.rs:7:26 |
ea8adc8c | 3 | | |
a1dfa0c6 XL |
4 | LL | macro_rules! my_faulty_macro { |
5 | | ---------------------------- when calling this macro | |
6 | LL | () => { | |
532ac7d7 | 7 | LL | my_faulty_macro!(bcd); |
a1dfa0c6 | 8 | | ^^^ no rules expected this token in macro call |
ea8adc8c | 9 | ... |
0531ce1d | 10 | LL | my_faulty_macro!(); |
c295e0f8 | 11 | | ------------------ in this macro invocation |
74b04a01 | 12 | | |
487cf647 | 13 | = note: while trying to match end of macro |
17df50a5 | 14 | = note: this error originates in the macro `my_faulty_macro` (in Nightly builds, run with -Z macro-backtrace for more info) |
ea8adc8c XL |
15 | |
16 | note: trace_macro | |
ba9703b0 | 17 | --> $DIR/trace_faulty_macros.rs:31:5 |
ea8adc8c | 18 | | |
0531ce1d | 19 | LL | my_faulty_macro!(); |
c295e0f8 | 20 | | ^^^^^^^^^^^^^^^^^^ |
ea8adc8c XL |
21 | | |
22 | = note: expanding `my_faulty_macro! { }` | |
4b012472 | 23 | = note: to `my_faulty_macro! (bcd);` |
ea8adc8c XL |
24 | = note: expanding `my_faulty_macro! { bcd }` |
25 | ||
dfeec247 | 26 | error: recursion limit reached while expanding `my_recursive_macro!` |
0731742a | 27 | --> $DIR/trace_faulty_macros.rs:22:9 |
ea8adc8c | 28 | | |
532ac7d7 | 29 | LL | my_recursive_macro!(); |
c295e0f8 | 30 | | ^^^^^^^^^^^^^^^^^^^^^ |
ea8adc8c | 31 | ... |
0531ce1d | 32 | LL | my_recursive_macro!(); |
c295e0f8 | 33 | | --------------------- in this macro invocation |
ea8adc8c | 34 | | |
c295e0f8 | 35 | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "8"]` attribute to your crate (`trace_faulty_macros`) |
17df50a5 | 36 | = note: this error originates in the macro `my_recursive_macro` (in Nightly builds, run with -Z macro-backtrace for more info) |
ea8adc8c XL |
37 | |
38 | note: trace_macro | |
ba9703b0 | 39 | --> $DIR/trace_faulty_macros.rs:32:5 |
ea8adc8c | 40 | | |
0531ce1d | 41 | LL | my_recursive_macro!(); |
c295e0f8 | 42 | | ^^^^^^^^^^^^^^^^^^^^^ |
ea8adc8c XL |
43 | | |
44 | = note: expanding `my_recursive_macro! { }` | |
4b012472 | 45 | = note: to `my_recursive_macro! ();` |
ea8adc8c | 46 | = note: expanding `my_recursive_macro! { }` |
4b012472 | 47 | = note: to `my_recursive_macro! ();` |
ea8adc8c | 48 | = note: expanding `my_recursive_macro! { }` |
4b012472 | 49 | = note: to `my_recursive_macro! ();` |
ea8adc8c | 50 | = note: expanding `my_recursive_macro! { }` |
4b012472 | 51 | = note: to `my_recursive_macro! ();` |
ea8adc8c | 52 | |
4b012472 | 53 | error: expected expression, found pattern `A { a: a, b: 0, c: _, .. }` |
ba9703b0 XL |
54 | --> $DIR/trace_faulty_macros.rs:16:9 |
55 | | | |
56 | LL | $a | |
57 | | ^^ expected expression | |
58 | ... | |
59 | LL | let a = pat_macro!(); | |
60 | | ------------ in this macro invocation | |
61 | | | |
17df50a5 | 62 | = note: this error originates in the macro `pat_macro` (in Nightly builds, run with -Z macro-backtrace for more info) |
ba9703b0 | 63 | |
136023e0 | 64 | error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s |
ba9703b0 XL |
65 | --> $DIR/trace_faulty_macros.rs:42:1 |
66 | | | |
67 | LL | #[derive(Debug)] | |
136023e0 XL |
68 | | ^^^^^^^^^^^^^^^^ not applicable here |
69 | LL | fn use_derive_macro_as_attr() {} | |
70 | | -------------------------------- not a `struct`, `enum` or `union` | |
ba9703b0 | 71 | |
4b012472 FG |
72 | error: expected expression, found pattern `1 + 1` |
73 | --> $DIR/trace_faulty_macros.rs:49:37 | |
74 | | | |
75 | LL | (let $p:pat = $e:expr) => {test!(($p,$e))}; | |
76 | | ------- -- this is interpreted as expression, but it is expected to be pattern | |
77 | | | | |
78 | | this macro fragment matcher is expression | |
79 | ... | |
80 | LL | (($p:pat, $e:pat)) => {let $p = $e;}; | |
81 | | ------ ^^ expected expression | |
82 | | | | |
83 | | this macro fragment matcher is pattern | |
84 | ... | |
85 | LL | test!(let x = 1+1); | |
86 | | ------------------ | |
87 | | | | | |
88 | | | this is expected to be expression | |
89 | | in this macro invocation | |
90 | | | |
91 | = note: when forwarding a matched fragment to another macro-by-example, matchers in the second macro will see an opaque AST of the fragment type, not the underlying tokens | |
92 | = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info) | |
93 | ||
ba9703b0 XL |
94 | note: trace_macro |
95 | --> $DIR/trace_faulty_macros.rs:36:13 | |
96 | | | |
97 | LL | let a = pat_macro!(); | |
98 | | ^^^^^^^^^^^^ | |
99 | | | |
100 | = note: expanding `pat_macro! { }` | |
4b012472 | 101 | = note: to `pat_macro! (A { a : a, b : 0, c : _, .. });` |
ba9703b0 XL |
102 | = note: expanding `pat_macro! { A { a : a, b : 0, c : _, .. } }` |
103 | = note: to `A { a: a, b: 0, c: _, .. }` | |
104 | ||
4b012472 FG |
105 | note: trace_macro |
106 | --> $DIR/trace_faulty_macros.rs:53:5 | |
107 | | | |
108 | LL | test!(let x = 1+1); | |
109 | | ^^^^^^^^^^^^^^^^^^ | |
110 | | | |
111 | = note: expanding `test! { let x = 1+1 }` | |
112 | = note: to `test! ((x, 1 + 1))` | |
113 | = note: expanding `test! { (x, 1 + 1) }` | |
114 | = note: to `let x = 1 + 1 ;` | |
115 | ||
116 | error: aborting due to 5 previous errors | |
0531ce1d | 117 | |
1b1a35ee | 118 | For more information about this error, try `rustc --explain E0774`. |