2017-09-02 17:21:13 +02:00
error: no rules expected the token `bcd`
2018-12-25 08:56:47 -07:00
--> $DIR/trace_faulty_macros.rs:7:26
2017-09-02 17:21:13 +02:00
|
2018-10-24 11:34:23 -07:00
LL | macro_rules! my_faulty_macro {
| ---------------------------- when calling this macro
LL | () => {
2019-03-09 15:03:44 +03:00
LL | my_faulty_macro!(bcd);
2018-11-04 14:01:38 -08:00
| ^^^ no rules expected this token in macro call
2017-09-02 17:21:13 +02:00
...
2018-10-24 11:34:23 -07:00
LL | my_faulty_macro!();
2021-10-14 13:28:28 -05:00
| ------------------ in this macro invocation
2019-12-16 15:56:47 +02:00
|
2022-11-12 23:18:32 +01:00
= note: while trying to match end of macro
2021-02-13 14:52:25 -05:00
= note: this error originates in the macro `my_faulty_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
2017-09-02 17:21:13 +02:00
note: trace_macro
2020-03-21 22:12:24 +01:00
--> $DIR/trace_faulty_macros.rs:31:5
2017-09-02 17:21:13 +02:00
|
2018-02-23 03:42:32 +03:00
LL | my_faulty_macro!();
2021-10-14 13:28:28 -05:00
| ^^^^^^^^^^^^^^^^^^
2017-09-02 17:21:13 +02:00
|
= note: expanding `my_faulty_macro! { }`
2023-10-12 15:36:14 +11:00
= note: to `my_faulty_macro! (bcd);`
2017-09-02 17:21:13 +02:00
= note: expanding `my_faulty_macro! { bcd }`
2020-01-21 01:02:01 +02:00
error: recursion limit reached while expanding `my_recursive_macro!`
2018-12-25 08:56:47 -07:00
--> $DIR/trace_faulty_macros.rs:22:9
2017-09-02 17:21:13 +02:00
|
2019-03-09 15:03:44 +03:00
LL | my_recursive_macro!();
2021-10-14 13:28:28 -05:00
| ^^^^^^^^^^^^^^^^^^^^^
2017-09-02 17:21:13 +02:00
...
2018-02-23 03:42:32 +03:00
LL | my_recursive_macro!();
2021-10-14 13:28:28 -05:00
| --------------------- in this macro invocation
2017-09-02 17:21:13 +02:00
|
2021-09-28 22:16:42 +02:00
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "8"]` attribute to your crate (`trace_faulty_macros`)
2021-02-13 14:52:25 -05:00
= note: this error originates in the macro `my_recursive_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
2017-09-02 17:21:13 +02:00
note: trace_macro
2020-03-21 22:12:24 +01:00
--> $DIR/trace_faulty_macros.rs:32:5
2017-09-02 17:21:13 +02:00
|
2018-02-23 03:42:32 +03:00
LL | my_recursive_macro!();
2021-10-14 13:28:28 -05:00
| ^^^^^^^^^^^^^^^^^^^^^
2017-09-02 17:21:13 +02:00
|
= note: expanding `my_recursive_macro! { }`
2023-10-12 15:36:14 +11:00
= note: to `my_recursive_macro! ();`
2017-09-02 17:21:13 +02:00
= note: expanding `my_recursive_macro! { }`
2023-10-12 15:36:14 +11:00
= note: to `my_recursive_macro! ();`
2017-09-02 17:21:13 +02:00
= note: expanding `my_recursive_macro! { }`
2023-10-12 15:36:14 +11:00
= note: to `my_recursive_macro! ();`
2017-09-02 17:21:13 +02:00
= note: expanding `my_recursive_macro! { }`
2023-10-12 15:36:14 +11:00
= note: to `my_recursive_macro! ();`
2017-09-02 17:21:13 +02:00
2024-05-16 16:26:37 +10:00
error: expected expression, found pattern `A { a : a, b : 0, c : _, .. }`
2020-02-29 04:23:58 +01:00
--> $DIR/trace_faulty_macros.rs:16:9
|
LL | $a
| ^^ expected expression
...
LL | let a = pat_macro!();
| ------------ in this macro invocation
|
2021-02-13 14:52:25 -05:00
= note: this error originates in the macro `pat_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
2020-02-29 04:23:58 +01:00
2021-07-17 11:13:50 -07:00
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
2020-03-21 22:12:24 +01:00
--> $DIR/trace_faulty_macros.rs:42:1
|
LL | #[derive(Debug)]
2021-07-17 11:13:50 -07:00
| ^^^^^^^^^^^^^^^^ not applicable here
LL | fn use_derive_macro_as_attr() {}
| -------------------------------- not a `struct`, `enum` or `union`
2020-03-21 22:12:24 +01:00
2024-05-16 16:26:37 +10:00
error: expected expression, found pattern `1+1`
2023-07-31 14:55:47 +00:00
--> $DIR/trace_faulty_macros.rs:49:37
|
LL | (let $p:pat = $e:expr) => {test!(($p,$e))};
2024-04-22 16:29:27 +10:00
| -- this is interpreted as expression, but it is expected to be pattern
2023-07-31 14:55:47 +00:00
...
LL | (($p:pat, $e:pat)) => {let $p = $e;};
2024-04-22 16:29:27 +10:00
| ^^ expected expression
2023-07-31 14:55:47 +00:00
...
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)
2020-03-21 22:12:24 +01:00
note: trace_macro
--> $DIR/trace_faulty_macros.rs:36:13
|
LL | let a = pat_macro!();
| ^^^^^^^^^^^^
|
= note: expanding `pat_macro! { }`
2023-10-12 15:36:14 +11:00
= note: to `pat_macro! (A { a : a, b : 0, c : _, .. });`
2020-03-21 22:12:24 +01:00
= note: expanding `pat_macro! { A { a : a, b : 0, c : _, .. } }`
2024-05-16 16:26:37 +10:00
= note: to `A { a : a, b : 0, c : _, .. }`
2020-03-21 22:12:24 +01:00
2023-07-31 14:55:47 +00:00
note: trace_macro
--> $DIR/trace_faulty_macros.rs:53:5
|
LL | test!(let x = 1+1);
| ^^^^^^^^^^^^^^^^^^
|
2023-08-08 11:43:44 +10:00
= note: expanding `test! { let x = 1+1 }`
2024-05-16 16:26:37 +10:00
= note: to `test! ((x, 1+1))`
= note: expanding `test! { (x, 1+1) }`
= note: to `let x = 1+1;`
2023-07-31 14:55:47 +00:00
error: aborting due to 5 previous errors
2018-03-15 16:13:47 +01:00
2020-09-05 14:55:15 +02:00
For more information about this error, try `rustc --explain E0774`.