Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c475e23

Browse files
committedFeb 28, 2024
Auto merge of #121489 - nnethercote:diag-renaming, r=davidtwco
Diagnostic renaming Renaming various diagnostic types from `Diagnostic*` to `Diag*`. Part of rust-lang/compiler-team#722. There are more to do but this is enough for one PR. r? `@davidtwco`
2 parents bf9c7a6 + 8f3b007 commit c475e23

File tree

182 files changed

+1527
-1774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+1527
-1774
lines changed
 

‎compiler/rustc_ast_lowering/src/errors.rs‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use rustc_errors::{
2-
codes::*, AddToDiagnostic, DiagnosticArgFromDisplay, DiagnosticBuilder, EmissionGuarantee,
3-
SubdiagnosticMessageOp,
2+
codes::*, AddToDiagnostic, Diag, DiagArgFromDisplay, EmissionGuarantee, SubdiagnosticMessageOp,
43
};
54
use rustc_macros::{Diagnostic, Subdiagnostic};
65
use rustc_span::{symbol::Ident, Span, Symbol};
@@ -44,7 +43,7 @@ pub struct InvalidAbiReason(pub &'static str);
4443
impl AddToDiagnostic for InvalidAbiReason {
4544
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
4645
self,
47-
diag: &mut DiagnosticBuilder<'_, G>,
46+
diag: &mut Diag<'_, G>,
4847
_: F,
4948
) {
5049
#[allow(rustc::untranslatable_diagnostic)]
@@ -95,7 +94,7 @@ pub enum AssocTyParenthesesSub {
9594
pub struct MisplacedImplTrait<'a> {
9695
#[primary_span]
9796
pub span: Span,
98-
pub position: DiagnosticArgFromDisplay<'a>,
97+
pub position: DiagArgFromDisplay<'a>,
9998
}
10099

101100
#[derive(Diagnostic)]

‎compiler/rustc_ast_lowering/src/lib.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use rustc_data_structures::fingerprint::Fingerprint;
5151
use rustc_data_structures::sorted_map::SortedMap;
5252
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
5353
use rustc_data_structures::sync::Lrc;
54-
use rustc_errors::{DiagCtxt, DiagnosticArgFromDisplay, StashKey};
54+
use rustc_errors::{DiagArgFromDisplay, DiagCtxt, StashKey};
5555
use rustc_hir as hir;
5656
use rustc_hir::def::{DefKind, LifetimeRes, Namespace, PartialRes, PerNS, Res};
5757
use rustc_hir::def_id::{LocalDefId, LocalDefIdMap, CRATE_DEF_ID, LOCAL_CRATE};
@@ -1473,7 +1473,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
14731473
.create_feature_err(
14741474
MisplacedImplTrait {
14751475
span: t.span,
1476-
position: DiagnosticArgFromDisplay(&position),
1476+
position: DiagArgFromDisplay(&position),
14771477
},
14781478
feature,
14791479
)
@@ -1483,7 +1483,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
14831483
ImplTraitContext::Disallowed(position) => {
14841484
let guar = self.dcx().emit_err(MisplacedImplTrait {
14851485
span: t.span,
1486-
position: DiagnosticArgFromDisplay(&position),
1486+
position: DiagArgFromDisplay(&position),
14871487
});
14881488
hir::TyKind::Err(guar)
14891489
}

0 commit comments

Comments
 (0)
Please sign in to comment.