Skip to content

Commit 573267c

Browse files
committed
Rename SubdiagnosticMessageOp as SubdiagMessageOp.
1 parent 60ea6e2 commit 573267c

File tree

18 files changed

+55
-57
lines changed

18 files changed

+55
-57
lines changed

compiler/rustc_ast_lowering/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rustc_errors::{
2-
codes::*, AddToDiagnostic, Diag, DiagArgFromDisplay, EmissionGuarantee, SubdiagnosticMessageOp,
2+
codes::*, AddToDiagnostic, Diag, DiagArgFromDisplay, EmissionGuarantee, SubdiagMessageOp,
33
};
44
use rustc_macros::{Diagnostic, Subdiagnostic};
55
use rustc_span::{symbol::Ident, Span, Symbol};
@@ -41,7 +41,7 @@ pub struct InvalidAbi {
4141
pub struct InvalidAbiReason(pub &'static str);
4242

4343
impl AddToDiagnostic for InvalidAbiReason {
44-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
44+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
4545
self,
4646
diag: &mut Diag<'_, G>,
4747
_: F,

compiler/rustc_ast_passes/src/errors.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use rustc_ast::ParamKindOrd;
44
use rustc_errors::{
5-
codes::*, AddToDiagnostic, Applicability, Diag, EmissionGuarantee, SubdiagnosticMessageOp,
5+
codes::*, AddToDiagnostic, Applicability, Diag, EmissionGuarantee, SubdiagMessageOp,
66
};
77
use rustc_macros::{Diagnostic, Subdiagnostic};
88
use rustc_span::{symbol::Ident, Span, Symbol};
@@ -374,7 +374,7 @@ pub struct EmptyLabelManySpans(pub Vec<Span>);
374374

375375
// The derive for `Vec<Span>` does multiple calls to `span_label`, adding commas between each
376376
impl AddToDiagnostic for EmptyLabelManySpans {
377-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
377+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
378378
self,
379379
diag: &mut Diag<'_, G>,
380380
_: F,
@@ -743,7 +743,7 @@ pub struct StableFeature {
743743
}
744744

745745
impl AddToDiagnostic for StableFeature {
746-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
746+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
747747
self,
748748
diag: &mut Diag<'_, G>,
749749
_: F,

compiler/rustc_builtin_macros/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use rustc_errors::{
22
codes::*, AddToDiagnostic, Diag, DiagCtxt, EmissionGuarantee, IntoDiagnostic, Level, MultiSpan,
3-
SingleLabelManySpans, SubdiagnosticMessageOp,
3+
SingleLabelManySpans, SubdiagMessageOp,
44
};
55
use rustc_macros::{Diagnostic, Subdiagnostic};
66
use rustc_span::{symbol::Ident, Span, Symbol};
@@ -590,7 +590,7 @@ pub(crate) struct FormatUnusedArg {
590590
// Allow the singular form to be a subdiagnostic of the multiple-unused
591591
// form of diagnostic.
592592
impl AddToDiagnostic for FormatUnusedArg {
593-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
593+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
594594
self,
595595
diag: &mut Diag<'_, G>,
596596
f: F,

compiler/rustc_errors/src/diagnostic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,14 @@ where
182182

183183
/// Add a subdiagnostic to an existing diagnostic where `f` is invoked on every message used
184184
/// (to optionally perform eager translation).
185-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
185+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
186186
self,
187187
diag: &mut Diag<'_, G>,
188188
f: F,
189189
);
190190
}
191191

192-
pub trait SubdiagnosticMessageOp<G> = Fn(&mut Diag<'_, G>, SubdiagMessage) -> SubdiagMessage;
192+
pub trait SubdiagMessageOp<G> = Fn(&mut Diag<'_, G>, SubdiagMessage) -> SubdiagMessage;
193193

194194
/// Trait implemented by lint types. This should not be implemented manually. Instead, use
195195
/// `#[derive(LintDiagnostic)]` -- see [rustc_macros::LintDiagnostic].

compiler/rustc_errors/src/diagnostic_impls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::diagnostic::DiagLocation;
22
use crate::{fluent_generated as fluent, AddToDiagnostic};
33
use crate::{
44
Diag, DiagArgValue, DiagCtxt, EmissionGuarantee, ErrCode, IntoDiagnostic, IntoDiagnosticArg,
5-
Level, SubdiagnosticMessageOp,
5+
Level, SubdiagMessageOp,
66
};
77
use rustc_ast as ast;
88
use rustc_ast_pretty::pprust;
@@ -298,7 +298,7 @@ pub struct SingleLabelManySpans {
298298
pub label: &'static str,
299299
}
300300
impl AddToDiagnostic for SingleLabelManySpans {
301-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
301+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
302302
self,
303303
diag: &mut Diag<'_, G>,
304304
_: F,

compiler/rustc_errors/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub use codes::*;
3939
pub use diagnostic::{
4040
AddToDiagnostic, BugAbort, DecorateLint, Diag, DiagArg, DiagArgMap, DiagArgName, DiagArgValue,
4141
DiagInner, DiagStyledString, EmissionGuarantee, FatalAbort, IntoDiagnostic, IntoDiagnosticArg,
42-
StringPart, Subdiag, SubdiagnosticMessageOp,
42+
StringPart, Subdiag, SubdiagMessageOp,
4343
};
4444
pub use diagnostic_impls::{
4545
DiagArgFromDisplay, DiagSymbolList, ExpectedLifetimeParameter, IndicateAnonymousLifetime,

compiler/rustc_hir_typeck/src/errors.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::borrow::Cow;
44
use crate::fluent_generated as fluent;
55
use rustc_errors::{
66
codes::*, AddToDiagnostic, Applicability, Diag, DiagArgValue, EmissionGuarantee,
7-
IntoDiagnosticArg, MultiSpan, SubdiagnosticMessageOp,
7+
IntoDiagnosticArg, MultiSpan, SubdiagMessageOp,
88
};
99
use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
1010
use rustc_middle::ty::Ty;
@@ -195,7 +195,7 @@ pub struct TypeMismatchFruTypo {
195195
}
196196

197197
impl AddToDiagnostic for TypeMismatchFruTypo {
198-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
198+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
199199
self,
200200
diag: &mut Diag<'_, G>,
201201
_f: F,
@@ -374,7 +374,7 @@ pub struct RemoveSemiForCoerce {
374374
}
375375

376376
impl AddToDiagnostic for RemoveSemiForCoerce {
377-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
377+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
378378
self,
379379
diag: &mut Diag<'_, G>,
380380
_f: F,
@@ -550,7 +550,7 @@ pub enum CastUnknownPointerSub {
550550
}
551551

552552
impl rustc_errors::AddToDiagnostic for CastUnknownPointerSub {
553-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
553+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
554554
self,
555555
diag: &mut Diag<'_, G>,
556556
f: F,

compiler/rustc_infer/src/errors/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use hir::GenericParamKind;
22
use rustc_errors::{
33
codes::*, AddToDiagnostic, Applicability, Diag, DiagMessage, DiagStyledString,
4-
EmissionGuarantee, IntoDiagnosticArg, MultiSpan, SubdiagnosticMessageOp,
4+
EmissionGuarantee, IntoDiagnosticArg, MultiSpan, SubdiagMessageOp,
55
};
66
use rustc_hir as hir;
77
use rustc_hir::FnRetTy;
@@ -225,7 +225,7 @@ pub enum RegionOriginNote<'a> {
225225
}
226226

227227
impl AddToDiagnostic for RegionOriginNote<'_> {
228-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
228+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
229229
self,
230230
diag: &mut Diag<'_, G>,
231231
_f: F,
@@ -290,7 +290,7 @@ pub enum LifetimeMismatchLabels {
290290
}
291291

292292
impl AddToDiagnostic for LifetimeMismatchLabels {
293-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
293+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
294294
self,
295295
diag: &mut Diag<'_, G>,
296296
_f: F,
@@ -338,7 +338,7 @@ pub struct AddLifetimeParamsSuggestion<'a> {
338338
}
339339

340340
impl AddToDiagnostic for AddLifetimeParamsSuggestion<'_> {
341-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
341+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
342342
self,
343343
diag: &mut Diag<'_, G>,
344344
_f: F,
@@ -440,7 +440,7 @@ pub struct IntroducesStaticBecauseUnmetLifetimeReq {
440440
}
441441

442442
impl AddToDiagnostic for IntroducesStaticBecauseUnmetLifetimeReq {
443-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
443+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
444444
mut self,
445445
diag: &mut Diag<'_, G>,
446446
_f: F,
@@ -759,7 +759,7 @@ pub struct ConsiderBorrowingParamHelp {
759759
}
760760

761761
impl AddToDiagnostic for ConsiderBorrowingParamHelp {
762-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
762+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
763763
self,
764764
diag: &mut Diag<'_, G>,
765765
f: F,
@@ -804,7 +804,7 @@ pub struct DynTraitConstraintSuggestion {
804804
}
805805

806806
impl AddToDiagnostic for DynTraitConstraintSuggestion {
807-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
807+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
808808
self,
809809
diag: &mut Diag<'_, G>,
810810
f: F,
@@ -851,7 +851,7 @@ pub struct ReqIntroducedLocations {
851851
}
852852

853853
impl AddToDiagnostic for ReqIntroducedLocations {
854-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
854+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
855855
mut self,
856856
diag: &mut Diag<'_, G>,
857857
f: F,
@@ -874,7 +874,7 @@ pub struct MoreTargeted {
874874
}
875875

876876
impl AddToDiagnostic for MoreTargeted {
877-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
877+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
878878
self,
879879
diag: &mut Diag<'_, G>,
880880
_f: F,
@@ -1297,7 +1297,7 @@ pub struct SuggestTuplePatternMany {
12971297
}
12981298

12991299
impl AddToDiagnostic for SuggestTuplePatternMany {
1300-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
1300+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
13011301
self,
13021302
diag: &mut Diag<'_, G>,
13031303
f: F,

compiler/rustc_infer/src/errors/note_and_explain.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
use crate::fluent_generated as fluent;
22
use crate::infer::error_reporting::nice_region_error::find_anon_type;
3-
use rustc_errors::{
4-
AddToDiagnostic, Diag, EmissionGuarantee, IntoDiagnosticArg, SubdiagnosticMessageOp,
5-
};
3+
use rustc_errors::{AddToDiagnostic, Diag, EmissionGuarantee, IntoDiagnosticArg, SubdiagMessageOp};
64
use rustc_middle::ty::{self, TyCtxt};
75
use rustc_span::{symbol::kw, Span};
86

@@ -162,7 +160,7 @@ impl RegionExplanation<'_> {
162160
}
163161

164162
impl AddToDiagnostic for RegionExplanation<'_> {
165-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
163+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
166164
self,
167165
diag: &mut Diag<'_, G>,
168166
f: F,

compiler/rustc_lint/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::fluent_generated as fluent;
2-
use rustc_errors::{codes::*, AddToDiagnostic, Diag, EmissionGuarantee, SubdiagnosticMessageOp};
2+
use rustc_errors::{codes::*, AddToDiagnostic, Diag, EmissionGuarantee, SubdiagMessageOp};
33
use rustc_macros::{Diagnostic, Subdiagnostic};
44
use rustc_session::lint::Level;
55
use rustc_span::{Span, Symbol};
@@ -24,7 +24,7 @@ pub enum OverruledAttributeSub {
2424
}
2525

2626
impl AddToDiagnostic for OverruledAttributeSub {
27-
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
27+
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
2828
self,
2929
diag: &mut Diag<'_, G>,
3030
_f: F,

0 commit comments

Comments
 (0)