File: trace_faulty_macros.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (114 lines) | stat: -rw-r--r-- 4,119 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
error: no rules expected `bcd`
  --> $DIR/trace_faulty_macros.rs:7:26
   |
LL | macro_rules! my_faulty_macro {
   | ---------------------------- when calling this macro
LL |     () => {
LL |         my_faulty_macro!(bcd);
   |                          ^^^ no rules expected this token in macro call
...
LL |     my_faulty_macro!();
   |     ------------------ in this macro invocation
   |
   = note: while trying to match end of macro
   = note: this error originates in the macro `my_faulty_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

note: trace_macro
  --> $DIR/trace_faulty_macros.rs:31:5
   |
LL |     my_faulty_macro!();
   |     ^^^^^^^^^^^^^^^^^^
   |
   = note: expanding `my_faulty_macro! {  }`
   = note: to `my_faulty_macro! (bcd);`
   = note: expanding `my_faulty_macro! { bcd }`

error: recursion limit reached while expanding `my_recursive_macro!`
  --> $DIR/trace_faulty_macros.rs:22:9
   |
LL |         my_recursive_macro!();
   |         ^^^^^^^^^^^^^^^^^^^^^
...
LL |     my_recursive_macro!();
   |     --------------------- in this macro invocation
   |
   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "8"]` attribute to your crate (`trace_faulty_macros`)
   = note: this error originates in the macro `my_recursive_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

note: trace_macro
  --> $DIR/trace_faulty_macros.rs:32:5
   |
LL |     my_recursive_macro!();
   |     ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expanding `my_recursive_macro! {  }`
   = note: to `my_recursive_macro! ();`
   = note: expanding `my_recursive_macro! {  }`
   = note: to `my_recursive_macro! ();`
   = note: expanding `my_recursive_macro! {  }`
   = note: to `my_recursive_macro! ();`
   = note: expanding `my_recursive_macro! {  }`
   = note: to `my_recursive_macro! ();`

error: expected expression, found pattern `A { a : a, b : 0, c : _, .. }`
  --> $DIR/trace_faulty_macros.rs:16:9
   |
LL |         $a
   |         ^^ expected expression
...
LL |     let a = pat_macro!();
   |             ------------ in this macro invocation
   |
   = note: this error originates in the macro `pat_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
  --> $DIR/trace_faulty_macros.rs:42:1
   |
LL | #[derive(Debug)]
   | ^^^^^^^^^^^^^^^^ not applicable here
LL | fn use_derive_macro_as_attr() {}
   | -------------------------------- not a `struct`, `enum` or `union`

error: expected expression, found pattern `1+1`
  --> $DIR/trace_faulty_macros.rs:49:37
   |
LL |     (let $p:pat = $e:expr) => {test!(($p,$e))};
   |                                          -- this is interpreted as expression, but it is expected to be pattern
...
LL |     (($p:pat, $e:pat)) => {let $p = $e;};
   |                                     ^^ expected expression
...
LL |     test!(let x = 1+1);
   |     ------------------
   |     |             |
   |     |             this is expected to be expression
   |     in this macro invocation
   |
   = 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
   = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)

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 : _, .. }`

note: trace_macro
  --> $DIR/trace_faulty_macros.rs:53:5
   |
LL |     test!(let x = 1+1);
   |     ^^^^^^^^^^^^^^^^^^
   |
   = note: expanding `test! { let x = 1+1 }`
   = note: to `test! ((x, 1+1))`
   = note: expanding `test! { (x, 1+1) }`
   = note: to `let x = 1+1;`

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0774`.