Skip to content

Commit 7ef4409

Browse files
Rollup merge of #145783 - Erk-:et-cetera-span, r=compiler-errors
add span to struct pattern rest (..) Struct pattern rest (`..`) did not retain span information compared to normal fields. This patch adds span information for it. The motivation of this patch comes from when I implemented this PR for Clippy: rust-lang/rust-clippy#15000 (comment) It is possible to get the span of the Et cetera in a bit roundabout way, but I thought this would be nicer.
2 parents 2281382 + 2890913 commit 7ef4409

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/patterns.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ impl Rewrite for Pat {
303303
qself,
304304
path,
305305
fields,
306-
rest == ast::PatFieldsRest::Rest,
306+
matches!(rest, ast::PatFieldsRest::Rest(_)),
307307
self.span,
308308
context,
309309
shape,

0 commit comments

Comments
 (0)