about summary refs log tree commit diff
path: root/tests/ui/parser/attribute/attr-pat-struct-rest.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/attribute/attr-pat-struct-rest.rs')
-rw-r--r--tests/ui/parser/attribute/attr-pat-struct-rest.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/parser/attribute/attr-pat-struct-rest.rs b/tests/ui/parser/attribute/attr-pat-struct-rest.rs
new file mode 100644
index 00000000000..b2bfcf82df8
--- /dev/null
+++ b/tests/ui/parser/attribute/attr-pat-struct-rest.rs
@@ -0,0 +1,8 @@
+// #81282: Attributes are not allowed on struct field rest patterns (the ..).
+
+struct S {}
+
+fn main() {
+    let S { #[cfg(any())] .. } = S {};
+    //~^ ERROR expected identifier, found `..`
+}