diff options
| author | clubby789 <jamie@hill-daniel.co.uk> | 2023-04-27 01:53:06 +0100 |
|---|---|---|
| committer | clubby789 <jamie@hill-daniel.co.uk> | 2023-04-27 01:53:06 +0100 |
| commit | 1ce9d7254e3e890a4b60846072e5731231f7e030 (patch) | |
| tree | 791d54cdd067a4b7d48f49c93a682a8d5cce8a52 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 1c42cb4ef0544fbfaa500216e53382d6b079c001 (diff) | |
| download | rust-1ce9d7254e3e890a4b60846072e5731231f7e030.tar.gz rust-1ce9d7254e3e890a4b60846072e5731231f7e030.zip | |
Migrate trivially translatable `rustc_parse` diagnostics
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 03c82fbd329..27de9bd7268 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -3151,14 +3151,10 @@ impl<'a> Parser<'a> { let label = format!("'{}", ident.name); let ident = Ident { name: Symbol::intern(&label), span: ident.span }; - self.struct_span_err(ident.span, "expected a label, found an identifier") - .span_suggestion( - ident.span, - "labels start with a tick", - label, - Applicability::MachineApplicable, - ) - .emit(); + self.sess.emit_err(errors::ExpectedLabelFoundIdent { + span: ident.span, + start: ident.span.shrink_to_lo(), + }); Label { ident } } |
