about summary refs log tree commit diff
path: root/tests/ui/parser
diff options
context:
space:
mode:
authorMu001999 <mu001999@outlook.com>2023-10-28 08:53:51 +0800
committerMu001999 <mu001999@outlook.com>2023-10-28 08:53:51 +0800
commitfe00cfef57fcd54d89a09b69819eb66cf90edf70 (patch)
tree256f2d7e1a5acef0dde6bb55a051e2700def13a7 /tests/ui/parser
parent64338796ab1092e2ad01283b14606e2d8d5d28fc (diff)
restore snapshot when parse_param_general
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/issue-116781.rs8
-rw-r--r--tests/ui/parser/issue-116781.stderr16
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/parser/issue-116781.rs b/tests/ui/parser/issue-116781.rs
new file mode 100644
index 00000000000..0e951d2eaa4
--- /dev/null
+++ b/tests/ui/parser/issue-116781.rs
@@ -0,0 +1,8 @@
+#[derive(Debug)]
+struct Foo {
+    #[cfg(all())]
+    field: fn(($),), //~ ERROR expected pattern, found `$`
+    //~^ ERROR expected pattern, found `$`
+}
+
+fn main() {}
diff --git a/tests/ui/parser/issue-116781.stderr b/tests/ui/parser/issue-116781.stderr
new file mode 100644
index 00000000000..1a77b60a50d
--- /dev/null
+++ b/tests/ui/parser/issue-116781.stderr
@@ -0,0 +1,16 @@
+error: expected pattern, found `$`
+  --> $DIR/issue-116781.rs:4:16
+   |
+LL |     field: fn(($),),
+   |                ^ expected pattern
+
+error: expected pattern, found `$`
+  --> $DIR/issue-116781.rs:4:16
+   |
+LL |     field: fn(($),),
+   |                ^ expected pattern
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+error: aborting due to 2 previous errors
+