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`.
This commit is contained in:
bors 2024-12-18 19:16:15 +00:00
commit 4ba4ac612d
17 changed files with 17 additions and 16 deletions

View file

@ -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 })
}
}