1
Fork 0

Avoid unnecessary rustc_span::DUMMY_SP usage.

In some cases `DUMMY_SP` is already imported. In other cases this commit
adds the necessary import, in files where `DUMMY_SP` is used more than
once.
This commit is contained in:
Nicholas Nethercote 2024-03-06 16:39:02 +11:00
parent 63f70b3d10
commit 27374a0214
13 changed files with 35 additions and 53 deletions

View file

@ -1968,11 +1968,8 @@ impl<'a> Parser<'a> {
} else if matches!(is_raw, IdentIsRaw::No) && ident.is_reserved() {
let snapshot = self.create_snapshot_for_diagnostic();
let err = if self.check_fn_front_matter(false, Case::Sensitive) {
let inherited_vis = Visibility {
span: rustc_span::DUMMY_SP,
kind: VisibilityKind::Inherited,
tokens: None,
};
let inherited_vis =
Visibility { span: DUMMY_SP, kind: VisibilityKind::Inherited, tokens: None };
// We use `parse_fn` to get a span for the function
let fn_parse_mode = FnParseMode { req_name: |_| true, req_body: true };
match self.parse_fn(