diff options
| author | Michael Goulet <michael@errs.io> | 2022-08-10 03:39:41 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-08-10 03:45:42 +0000 |
| commit | a2b6744af03e315587626e9faa34bfaf3b913012 (patch) | |
| tree | b76f3ac29d63cf455ada56c86332f77490ad8ae9 /compiler/rustc_parse/src/parser | |
| parent | 34a6cae28e7013ff0e640026a8e46f315426829d (diff) | |
| download | rust-a2b6744af03e315587626e9faa34bfaf3b913012.tar.gz rust-a2b6744af03e315587626e9faa34bfaf3b913012.zip | |
Use &mut Diagnostic instead of &mut DiagnosticBuilder unless needed
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index a2155ac1d1a..f4c6b33a529 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -19,7 +19,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_errors::{ fluent, Applicability, DiagnosticBuilder, DiagnosticMessage, Handler, MultiSpan, PResult, }; -use rustc_errors::{pluralize, struct_span_err, Diagnostic, EmissionGuarantee, ErrorGuaranteed}; +use rustc_errors::{pluralize, struct_span_err, Diagnostic, ErrorGuaranteed}; use rustc_macros::{SessionDiagnostic, SessionSubdiagnostic}; use rustc_span::source_map::Spanned; use rustc_span::symbol::{kw, Ident}; @@ -228,13 +228,13 @@ struct MultiSugg { } impl MultiSugg { - fn emit<G: EmissionGuarantee>(self, err: &mut DiagnosticBuilder<'_, G>) { + fn emit(self, err: &mut Diagnostic) { err.multipart_suggestion(&self.msg, self.patches, self.applicability); } /// Overrides individual messages and applicabilities. - fn emit_many<G: EmissionGuarantee>( - err: &mut DiagnosticBuilder<'_, G>, + fn emit_many( + err: &mut Diagnostic, msg: &str, applicability: Applicability, suggestions: impl Iterator<Item = Self>, diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index e473f4d30cf..7dda3428bd7 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -859,7 +859,7 @@ impl<'a> Parser<'a> { ); let mut err = self.struct_span_err(span, &msg); - let suggest_parens = |err: &mut DiagnosticBuilder<'_, _>| { + let suggest_parens = |err: &mut Diagnostic| { let suggestions = vec