rust/tests/ui/parser/attribute/attr-pat-struct-rest.rs
Jack Rickard 3f09a20549
Do not allow attributes on struct field rest patterns
This removes support for attributes on struct field rest patterns (the `..`) from the parser.
Previously they were being parsed but dropped from the AST, so didn't work and were deleted by rustfmt.
2025-02-03 14:04:57 +00:00

9 lines
192 B
Rust

// #81282: Attributes are not allowed on struct field rest patterns (the ..).
struct S {}
fn main() {
let S { #[cfg(any())] .. } = S {};
//~^ ERROR expected identifier, found `..`
}