diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-06 16:39:02 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-04-16 15:55:24 +1000 |
| commit | 27374a0214a7b057c19af3af85253268095d8db8 (patch) | |
| tree | 40954e486eebd475ebe2ad3ffdda91a4caa7a2f1 /compiler/rustc_parse/src/parser | |
| parent | 63f70b3d104e20289a1a0df82747066c3d85b9a1 (diff) | |
| download | rust-27374a0214a7b057c19af3af85253268095d8db8.tar.gz rust-27374a0214a7b057c19af3af85253268095d8db8.zip | |
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.
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 003479b9d8e..1260c20fd55 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -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( |
