Skip to content

Commit d0ef108

Browse files
committed
Rename DiagnosticArgFromDisplay as DiagArgFromDisplay.
1 parent 8199632 commit d0ef108

File tree

5 files changed

+20
-21
lines changed

5 files changed

+20
-21
lines changed

compiler/rustc_ast_lowering/src/errors.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use rustc_errors::{
2-
codes::*, AddToDiagnostic, Diag, DiagnosticArgFromDisplay, 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};
@@ -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

+3-3
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
}

compiler/rustc_errors/src/diagnostic_impls.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ use std::num::ParseIntError;
2020
use std::path::{Path, PathBuf};
2121
use std::process::ExitStatus;
2222

23-
pub struct DiagnosticArgFromDisplay<'a>(pub &'a dyn fmt::Display);
23+
pub struct DiagArgFromDisplay<'a>(pub &'a dyn fmt::Display);
2424

25-
impl IntoDiagnosticArg for DiagnosticArgFromDisplay<'_> {
25+
impl IntoDiagnosticArg for DiagArgFromDisplay<'_> {
2626
fn into_diagnostic_arg(self) -> DiagArgValue {
2727
self.0.to_string().into_diagnostic_arg()
2828
}
2929
}
3030

31-
impl<'a> From<&'a dyn fmt::Display> for DiagnosticArgFromDisplay<'a> {
31+
impl<'a> From<&'a dyn fmt::Display> for DiagArgFromDisplay<'a> {
3232
fn from(t: &'a dyn fmt::Display) -> Self {
33-
DiagnosticArgFromDisplay(t)
33+
DiagArgFromDisplay(t)
3434
}
3535
}
3636

37-
impl<'a, T: fmt::Display> From<&'a T> for DiagnosticArgFromDisplay<'a> {
37+
impl<'a, T: fmt::Display> From<&'a T> for DiagArgFromDisplay<'a> {
3838
fn from(t: &'a T) -> Self {
39-
DiagnosticArgFromDisplay(t)
39+
DiagArgFromDisplay(t)
4040
}
4141
}
4242

compiler/rustc_errors/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ pub use diagnostic::{
4242
IntoDiagnosticArg, StringPart, Subdiag, SubdiagnosticMessageOp,
4343
};
4444
pub use diagnostic_impls::{
45-
DiagnosticArgFromDisplay, DiagnosticSymbolList, ExpectedLifetimeParameter,
46-
IndicateAnonymousLifetime, SingleLabelManySpans,
45+
DiagArgFromDisplay, DiagnosticSymbolList, ExpectedLifetimeParameter, IndicateAnonymousLifetime,
46+
SingleLabelManySpans,
4747
};
4848
pub use emitter::ColorConfig;
4949
pub use rustc_error_messages::{

compiler/rustc_privacy/src/errors.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rustc_errors::{codes::*, DiagnosticArgFromDisplay};
1+
use rustc_errors::{codes::*, DiagArgFromDisplay};
22
use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
33
use rustc_span::{Span, Symbol};
44

@@ -36,7 +36,7 @@ pub struct ItemIsPrivate<'a> {
3636
#[label]
3737
pub span: Span,
3838
pub kind: &'a str,
39-
pub descr: DiagnosticArgFromDisplay<'a>,
39+
pub descr: DiagArgFromDisplay<'a>,
4040
}
4141

4242
#[derive(Diagnostic)]
@@ -55,7 +55,7 @@ pub struct InPublicInterface<'a> {
5555
pub span: Span,
5656
pub vis_descr: &'static str,
5757
pub kind: &'a str,
58-
pub descr: DiagnosticArgFromDisplay<'a>,
58+
pub descr: DiagArgFromDisplay<'a>,
5959
#[label(privacy_visibility_label)]
6060
pub vis_span: Span,
6161
}
@@ -72,7 +72,7 @@ pub struct ReportEffectiveVisibility {
7272
#[diag(privacy_from_private_dep_in_public_interface)]
7373
pub struct FromPrivateDependencyInPublicInterface<'a> {
7474
pub kind: &'a str,
75-
pub descr: DiagnosticArgFromDisplay<'a>,
75+
pub descr: DiagArgFromDisplay<'a>,
7676
pub krate: Symbol,
7777
}
7878

@@ -82,7 +82,7 @@ pub struct UnnameableTypesLint<'a> {
8282
#[label]
8383
pub span: Span,
8484
pub kind: &'a str,
85-
pub descr: DiagnosticArgFromDisplay<'a>,
85+
pub descr: DiagArgFromDisplay<'a>,
8686
pub reachable_vis: &'a str,
8787
pub reexported_vis: &'a str,
8888
}
@@ -96,11 +96,11 @@ pub struct PrivateInterfacesOrBoundsLint<'a> {
9696
#[label(privacy_item_label)]
9797
pub item_span: Span,
9898
pub item_kind: &'a str,
99-
pub item_descr: DiagnosticArgFromDisplay<'a>,
99+
pub item_descr: DiagArgFromDisplay<'a>,
100100
pub item_vis_descr: &'a str,
101101
#[note(privacy_ty_note)]
102102
pub ty_span: Span,
103103
pub ty_kind: &'a str,
104-
pub ty_descr: DiagnosticArgFromDisplay<'a>,
104+
pub ty_descr: DiagArgFromDisplay<'a>,
105105
pub ty_vis_descr: &'a str,
106106
}

0 commit comments

Comments
 (0)