Skip to content

Commit 54735e1

Browse files
committed
Rename StructuredDiagnostic as StructuredDiag.
1 parent f909b89 commit 54735e1

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

compiler/rustc_hir_analysis/src/astconv/generics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::astconv::{
33
errors::prohibit_assoc_ty_binding, CreateInstantiationsForGenericArgsCtxt, ExplicitLateBound,
44
GenericArgCountMismatch, GenericArgCountResult, GenericArgPosition,
55
};
6-
use crate::structured_errors::{GenericArgsInfo, StructuredDiagnostic, WrongNumberOfGenericArgs};
6+
use crate::structured_errors::{GenericArgsInfo, StructuredDiag, WrongNumberOfGenericArgs};
77
use rustc_ast::ast::ParamKindOrd;
88
use rustc_errors::{
99
codes::*, struct_span_code_err, Applicability, Diag, ErrorGuaranteed, MultiSpan,

compiler/rustc_hir_analysis/src/structured_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub use self::{
99
use rustc_errors::{Diag, ErrCode};
1010
use rustc_session::Session;
1111

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

1515
fn code(&self) -> ErrCode;

compiler/rustc_hir_analysis/src/structured_errors/missing_cast_for_variadic_arg.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{errors, structured_errors::StructuredDiagnostic};
1+
use crate::{errors, structured_errors::StructuredDiag};
22
use rustc_errors::{codes::*, Diag};
33
use rustc_middle::ty::{Ty, TypeVisitableExt};
44
use rustc_session::Session;
@@ -11,7 +11,7 @@ pub struct MissingCastForVariadicArg<'tcx, 's> {
1111
pub cast_ty: &'s str,
1212
}
1313

14-
impl<'tcx> StructuredDiagnostic<'tcx> for MissingCastForVariadicArg<'tcx, '_> {
14+
impl<'tcx> StructuredDiag<'tcx> for MissingCastForVariadicArg<'tcx, '_> {
1515
fn session(&self) -> &Session {
1616
self.sess
1717
}

compiler/rustc_hir_analysis/src/structured_errors/sized_unsized_cast.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{errors, structured_errors::StructuredDiagnostic};
1+
use crate::{errors, structured_errors::StructuredDiag};
22
use rustc_errors::{codes::*, Diag};
33
use rustc_middle::ty::{Ty, TypeVisitableExt};
44
use rustc_session::Session;
@@ -11,7 +11,7 @@ pub struct SizedUnsizedCast<'tcx> {
1111
pub cast_ty: String,
1212
}
1313

14-
impl<'tcx> StructuredDiagnostic<'tcx> for SizedUnsizedCast<'tcx> {
14+
impl<'tcx> StructuredDiag<'tcx> for SizedUnsizedCast<'tcx> {
1515
fn session(&self) -> &Session {
1616
self.sess
1717
}

compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::structured_errors::StructuredDiagnostic;
1+
use crate::structured_errors::StructuredDiag;
22
use rustc_errors::{codes::*, pluralize, Applicability, Diag, MultiSpan};
33
use rustc_hir as hir;
44
use rustc_middle::ty::{self as ty, AssocItems, AssocKind, TyCtxt};
@@ -1097,7 +1097,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
10971097
}
10981098
}
10991099

1100-
impl<'tcx> StructuredDiagnostic<'tcx> for WrongNumberOfGenericArgs<'_, 'tcx> {
1100+
impl<'tcx> StructuredDiag<'tcx> for WrongNumberOfGenericArgs<'_, 'tcx> {
11011101
fn session(&self) -> &Session {
11021102
self.tcx.sess
11031103
}

compiler/rustc_hir_typeck/src/cast.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
483483
err.emit();
484484
}
485485
CastError::SizedUnsizedCast => {
486-
use rustc_hir_analysis::structured_errors::{
487-
SizedUnsizedCast, StructuredDiagnostic,
488-
};
486+
use rustc_hir_analysis::structured_errors::{SizedUnsizedCast, StructuredDiag};
489487

490488
SizedUnsizedCast {
491489
sess: fcx.tcx.sess,

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use rustc_hir::{ExprKind, Node, QPath};
2727
use rustc_hir_analysis::astconv::AstConv;
2828
use rustc_hir_analysis::check::intrinsicck::InlineAsmCtxt;
2929
use rustc_hir_analysis::check::potentially_plural_count;
30-
use rustc_hir_analysis::structured_errors::StructuredDiagnostic;
30+
use rustc_hir_analysis::structured_errors::StructuredDiag;
3131
use rustc_index::IndexVec;
3232
use rustc_infer::infer::error_reporting::{FailureCode, ObligationCauseExt};
3333
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};

0 commit comments

Comments
 (0)