From d9ea1027b52b94924c00a1ee2eb543f44f64a4e2 Mon Sep 17 00:00:00 2001 From: Alona Enraght-Moony Date: Fri, 22 Dec 2023 23:29:20 +0000 Subject: [PATCH] bool->enum for ast::PatKind::Struct presence of `..` See https://github.com/rust-lang/rust/blob/cee794ee98d49b45a55ba225680d98e0c4672736/compiler/rustc_parse/src/parser/pat.rs#L890-L897 for the only place this is constructed. --- src/patterns.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/patterns.rs b/src/patterns.rs index 8504999b8ff..0fa6edaa5d7 100644 --- a/src/patterns.rs +++ b/src/patterns.rs @@ -259,9 +259,15 @@ fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option None, None, ), - PatKind::Struct(ref qself, ref path, ref fields, ellipsis) => { - rewrite_struct_pat(qself, path, fields, ellipsis, self.span, context, shape) - } + PatKind::Struct(ref qself, ref path, ref fields, rest) => rewrite_struct_pat( + qself, + path, + fields, + rest == ast::PatFieldsRest::Rest, + self.span, + context, + shape, + ), PatKind::MacCall(ref mac) => { rewrite_macro(mac, None, context, shape, MacroPosition::Pat) }