summaryrefslogtreecommitdiffstats
path: root/src/test/ui/macros/trace_faulty_macros.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/macros/trace_faulty_macros.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/macros/trace_faulty_macros.stderr')
-rw-r--r--src/test/ui/macros/trace_faulty_macros.stderr84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/test/ui/macros/trace_faulty_macros.stderr b/src/test/ui/macros/trace_faulty_macros.stderr
new file mode 100644
index 000000000..d6fc69402
--- /dev/null
+++ b/src/test/ui/macros/trace_faulty_macros.stderr
@@ -0,0 +1,84 @@
+error: no rules expected the token `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: 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 `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`
+
+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
+
+For more information about this error, try `rustc --explain E0774`.