Use &mut Diagnostic instead of &mut DiagnosticBuilder unless needed
This commit is contained in:
parent
34a6cae28e
commit
a2b6744af0
15 changed files with 37 additions and 59 deletions
|
@ -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>,
|
||||
|
|
|
@ -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![
|
||||
(span.shrink_to_lo(), "(".to_string()),
|
||||
(span.shrink_to_hi(), ")".to_string()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue