about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-18 19:16:15 +0000
committerbors <bors@rust-lang.org>2024-12-18 19:16:15 +0000
commit4ba4ac612d36e3409e8e1e31e12acc028808f85f (patch)
tree4984f3ca5507abb2a5ccd2aad7346390edff999f /compiler/rustc_parse/src
parenta52085d9f6a6e596b0cbad4502cddf86bc878028 (diff)
parenta105cd606628b07e79ab343cc183a176e278c809 (diff)
downloadrust-4ba4ac612d36e3409e8e1e31e12acc028808f85f.tar.gz
rust-4ba4ac612d36e3409e8e1e31e12acc028808f85f.zip
Auto merge of #134443 - joshtriplett:use-field-init-shorthand, r=lqd,tgross35,nnethercote
Use field init shorthand where possible

Field init shorthand allows writing initializers like `tcx: tcx` as
`tcx`. The compiler already uses it extensively. Fix the last few places
where it isn't yet used.

EDIT: this PR also updates `rustfmt.toml` to set
`use_field_init_shorthand = true`.
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/pat.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/pat.rs b/compiler/rustc_parse/src/parser/pat.rs
index 76101914bbd..9b63100105b 100644
--- a/compiler/rustc_parse/src/parser/pat.rs
+++ b/compiler/rustc_parse/src/parser/pat.rs
@@ -1647,7 +1647,7 @@ impl<'a> Parser<'a> {
                 ident: prev_field,
             })
         } else {
-            self.dcx().create_err(AtInStructPattern { span: span })
+            self.dcx().create_err(AtInStructPattern { span })
         }
     }