1
Fork 0

Replace &mut DiagnosticBuilder, in signatures, with &mut Diagnostic.

This commit is contained in:
Eduard-Mihai Burtescu 2022-01-23 20:41:46 +00:00
parent f24ff1815f
commit 02ff9e0aef
65 changed files with 369 additions and 466 deletions

View file

@ -3,7 +3,7 @@ use crate::ty::diagnostics::suggest_constraining_type_param;
use crate::ty::print::{FmtPrinter, Printer};
use crate::ty::{self, BoundRegionKind, Region, Ty, TyCtxt};
use rustc_errors::Applicability::{MachineApplicable, MaybeIncorrect};
use rustc_errors::{pluralize, DiagnosticBuilder};
use rustc_errors::{pluralize, Diagnostic};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_span::symbol::{sym, Symbol};
@ -347,7 +347,8 @@ impl<'tcx> Ty<'tcx> {
impl<'tcx> TyCtxt<'tcx> {
pub fn note_and_explain_type_err(
self,
db: &mut DiagnosticBuilder<'_>,
// FIXME(eddyb) rename this since it's no longer a `DiagnosticBuilder`.
db: &mut Diagnostic,
err: &TypeError<'tcx>,
cause: &ObligationCause<'tcx>,
sp: Span,
@ -584,7 +585,8 @@ impl<T> Trait<T> for X {
fn suggest_constraint(
self,
db: &mut DiagnosticBuilder<'_>,
// FIXME(eddyb) rename this since it's no longer a `DiagnosticBuilder`.
db: &mut Diagnostic,
msg: &str,
body_owner_def_id: DefId,
proj_ty: &ty::ProjectionTy<'tcx>,
@ -671,7 +673,8 @@ impl<T> Trait<T> for X {
/// fn that returns the type.
fn expected_projection(
self,
db: &mut DiagnosticBuilder<'_>,
// FIXME(eddyb) rename this since it's no longer a `DiagnosticBuilder`.
db: &mut Diagnostic,
proj_ty: &ty::ProjectionTy<'tcx>,
values: &ExpectedFound<Ty<'tcx>>,
body_owner_def_id: DefId,
@ -766,7 +769,8 @@ fn foo(&self) -> Self::T { String::new() }
/// a return type. This can occur when dealing with `TryStream` (#71035).
fn suggest_constraining_opaque_associated_type(
self,
db: &mut DiagnosticBuilder<'_>,
// FIXME(eddyb) rename this since it's no longer a `DiagnosticBuilder`.
db: &mut Diagnostic,
msg: &str,
proj_ty: &ty::ProjectionTy<'tcx>,
ty: Ty<'tcx>,
@ -802,7 +806,8 @@ fn foo(&self) -> Self::T { String::new() }
fn point_at_methods_that_satisfy_associated_type(
self,
db: &mut DiagnosticBuilder<'_>,
// FIXME(eddyb) rename this since it's no longer a `DiagnosticBuilder`.
db: &mut Diagnostic,
assoc_container_id: DefId,
current_method_ident: Option<Symbol>,
proj_ty_item_def_id: DefId,
@ -857,7 +862,8 @@ fn foo(&self) -> Self::T { String::new() }
fn point_at_associated_type(
self,
db: &mut DiagnosticBuilder<'_>,
// FIXME(eddyb) rename this since it's no longer a `DiagnosticBuilder`.
db: &mut Diagnostic,
body_owner_def_id: DefId,
found: Ty<'tcx>,
) -> bool {
@ -921,7 +927,8 @@ fn foo(&self) -> Self::T { String::new() }
/// type is defined on a supertrait of the one present in the bounds.
fn constrain_generic_bound_associated_type_structured_suggestion(
self,
db: &mut DiagnosticBuilder<'_>,
// FIXME(eddyb) rename this since it's no longer a `DiagnosticBuilder`.
db: &mut Diagnostic,
trait_ref: &ty::TraitRef<'tcx>,
bounds: hir::GenericBounds<'_>,
assoc: &ty::AssocItem,
@ -958,7 +965,8 @@ fn foo(&self) -> Self::T { String::new() }
/// associated type to a given type `ty`.
fn constrain_associated_type_structured_suggestion(
self,
db: &mut DiagnosticBuilder<'_>,
// FIXME(eddyb) rename this since it's no longer a `DiagnosticBuilder`.
db: &mut Diagnostic,
span: Span,
assoc: &ty::AssocItem,
assoc_substs: &[ty::GenericArg<'tcx>],