Skip to content

Commit

Permalink
Rename StructuredDiagnostic as StructuredDiag.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Mar 1, 2024
1 parent 5d81459 commit 79347f3
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/astconv/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::astconv::{
errors::prohibit_assoc_ty_binding, CreateInstantiationsForGenericArgsCtxt, ExplicitLateBound,
GenericArgCountMismatch, GenericArgCountResult, GenericArgPosition,
};
use crate::structured_errors::{GenericArgsInfo, StructuredDiagnostic, WrongNumberOfGenericArgs};
use crate::structured_errors::{GenericArgsInfo, StructuredDiag, WrongNumberOfGenericArgs};
use rustc_ast::ast::ParamKindOrd;
use rustc_errors::{
codes::*, struct_span_code_err, Applicability, Diag, ErrorGuaranteed, MultiSpan,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/structured_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub use self::{
use rustc_errors::{Diag, ErrCode};
use rustc_session::Session;

pub trait StructuredDiagnostic<'tcx> {
pub trait StructuredDiag<'tcx> {
fn session(&self) -> &Session;

fn code(&self) -> ErrCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{errors, structured_errors::StructuredDiagnostic};
use crate::{errors, structured_errors::StructuredDiag};
use rustc_errors::{codes::*, Diag};
use rustc_middle::ty::{Ty, TypeVisitableExt};
use rustc_session::Session;
Expand All @@ -11,7 +11,7 @@ pub struct MissingCastForVariadicArg<'tcx, 's> {
pub cast_ty: &'s str,
}

impl<'tcx> StructuredDiagnostic<'tcx> for MissingCastForVariadicArg<'tcx, '_> {
impl<'tcx> StructuredDiag<'tcx> for MissingCastForVariadicArg<'tcx, '_> {
fn session(&self) -> &Session {
self.sess
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{errors, structured_errors::StructuredDiagnostic};
use crate::{errors, structured_errors::StructuredDiag};
use rustc_errors::{codes::*, Diag};
use rustc_middle::ty::{Ty, TypeVisitableExt};
use rustc_session::Session;
Expand All @@ -11,7 +11,7 @@ pub struct SizedUnsizedCast<'tcx> {
pub cast_ty: String,
}

impl<'tcx> StructuredDiagnostic<'tcx> for SizedUnsizedCast<'tcx> {
impl<'tcx> StructuredDiag<'tcx> for SizedUnsizedCast<'tcx> {
fn session(&self) -> &Session {
self.sess
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::structured_errors::StructuredDiagnostic;
use crate::structured_errors::StructuredDiag;
use rustc_errors::{codes::*, pluralize, Applicability, Diag, MultiSpan};
use rustc_hir as hir;
use rustc_middle::ty::{self as ty, AssocItems, AssocKind, TyCtxt};
Expand Down Expand Up @@ -1097,7 +1097,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
}
}

impl<'tcx> StructuredDiagnostic<'tcx> for WrongNumberOfGenericArgs<'_, 'tcx> {
impl<'tcx> StructuredDiag<'tcx> for WrongNumberOfGenericArgs<'_, 'tcx> {
fn session(&self) -> &Session {
self.tcx.sess
}
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_hir_typeck/src/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
err.emit();
}
CastError::SizedUnsizedCast => {
use rustc_hir_analysis::structured_errors::{
SizedUnsizedCast, StructuredDiagnostic,
};
use rustc_hir_analysis::structured_errors::{SizedUnsizedCast, StructuredDiag};

SizedUnsizedCast {
sess: fcx.tcx.sess,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use rustc_hir::{ExprKind, Node, QPath};
use rustc_hir_analysis::astconv::AstConv;
use rustc_hir_analysis::check::intrinsicck::InlineAsmCtxt;
use rustc_hir_analysis::check::potentially_plural_count;
use rustc_hir_analysis::structured_errors::StructuredDiagnostic;
use rustc_hir_analysis::structured_errors::StructuredDiag;
use rustc_index::IndexVec;
use rustc_infer::infer::error_reporting::{FailureCode, ObligationCauseExt};
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
Expand Down

0 comments on commit 79347f3

Please sign in to comment.