Skip to content

Commit 57fdd19

Browse files
committed
Rebase and fix
1 parent 0634b01 commit 57fdd19

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

compiler/rustc_infer/src/errors/mod.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use rustc_errors::{
44
MultiSpan, SubdiagnosticMessage,
55
};
66
use rustc_hir as hir;
7-
use rustc_hir::{FnRetTy, Ty};
7+
use rustc_hir::FnRetTy;
88
use rustc_macros::{Diagnostic, Subdiagnostic};
9-
use rustc_middle::ty::{Region, TyCtxt};
9+
use rustc_middle::ty::{Region, Ty, TyCtxt};
1010
use rustc_span::symbol::kw;
1111
use rustc_span::Symbol;
1212
use rustc_span::{symbol::Ident, BytePos, Span};
@@ -522,7 +522,7 @@ pub struct MismatchedStaticLifetime<'a> {
522522
pub implicit_static_lifetimes: Vec<ImplicitStaticLifetimeSubdiag>,
523523
}
524524

525-
#[derive(SessionDiagnostic)]
525+
#[derive(Diagnostic)]
526526
#[diag(infer::explicit_lifetime_required, code = "E0621")]
527527
pub struct ExplicitLifetimeRequired<'a> {
528528
#[primary_span]
@@ -542,7 +542,7 @@ pub struct ExplicitLifetimeRequired<'a> {
542542
pub new_ty: Ty<'a>,
543543
}
544544

545-
#[derive(SessionSubdiagnostic)]
545+
#[derive(Subdiagnostic)]
546546
pub enum ActualImplExplNotes {
547547
// Field names have to be different across all variants
548548
#[note(infer::actual_impl_expl_1)]
@@ -565,7 +565,7 @@ pub enum ActualImplExplNotes {
565565
},
566566
}
567567

568-
#[derive(SessionDiagnostic)]
568+
#[derive(Diagnostic)]
569569
#[diag(infer::trait_placeholder_mismatch)]
570570
pub struct TraitPlaceholderMismatch {
571571
#[primary_span]
@@ -587,7 +587,7 @@ pub struct ConsiderBorrowingParamHelp {
587587
pub spans: Vec<Span>,
588588
}
589589

590-
impl AddSubdiagnostic for ConsiderBorrowingParamHelp {
590+
impl AddToDiagnostic for ConsiderBorrowingParamHelp {
591591
fn add_to_diagnostic(self, diag: &mut rustc_errors::Diagnostic) {
592592
let mut type_param_span: MultiSpan = self.spans.clone().into();
593593
for &span in &self.spans {
@@ -597,11 +597,11 @@ impl AddSubdiagnostic for ConsiderBorrowingParamHelp {
597597
}
598598
}
599599

600-
#[derive(SessionSubdiagnostic)]
600+
#[derive(Subdiagnostic)]
601601
#[help(infer::tid_rel_help)]
602602
pub struct RelationshipHelp;
603603

604-
#[derive(SessionDiagnostic)]
604+
#[derive(Diagnostic)]
605605
#[diag(infer::trait_impl_diff)]
606606
pub struct TraitImplDiff {
607607
#[primary_span]
@@ -626,7 +626,7 @@ pub struct DynTraitConstraintSuggestion {
626626
pub ident: Ident,
627627
}
628628

629-
impl AddSubdiagnostic for DynTraitConstraintSuggestion {
629+
impl AddToDiagnostic for DynTraitConstraintSuggestion {
630630
fn add_to_diagnostic(self, diag: &mut rustc_errors::Diagnostic) {
631631
let mut multi_span: MultiSpan = vec![self.span].into();
632632
multi_span.push_span_label(self.span, fluent::infer::dtcs_has_lifetime_req_label);
@@ -641,7 +641,7 @@ impl AddSubdiagnostic for DynTraitConstraintSuggestion {
641641
}
642642
}
643643

644-
#[derive(SessionDiagnostic)]
644+
#[derive(Diagnostic)]
645645
#[diag(infer::but_calling_introduces, code = "E0772")]
646646
pub struct ButCallingIntroduces {
647647
#[label(infer::label1)]
@@ -667,7 +667,7 @@ pub struct ReqIntroducedLocations {
667667
pub add_label: bool,
668668
}
669669

670-
impl AddSubdiagnostic for ReqIntroducedLocations {
670+
impl AddToDiagnostic for ReqIntroducedLocations {
671671
fn add_to_diagnostic(mut self, diag: &mut rustc_errors::Diagnostic) {
672672
for sp in self.spans {
673673
self.span.push_span_label(sp, fluent::infer::ril_introduced_here);
@@ -685,15 +685,15 @@ pub struct MoreTargeted {
685685
pub ident: Symbol,
686686
}
687687

688-
impl AddSubdiagnostic for MoreTargeted {
688+
impl AddToDiagnostic for MoreTargeted {
689689
fn add_to_diagnostic(self, diag: &mut rustc_errors::Diagnostic) {
690690
diag.code(rustc_errors::error_code!(E0772));
691691
diag.set_primary_message(fluent::infer::more_targeted);
692692
diag.set_arg("ident", self.ident);
693693
}
694694
}
695695

696-
#[derive(SessionDiagnostic)]
696+
#[derive(Diagnostic)]
697697
#[diag(infer::but_needs_to_satisfy, code = "E0759")]
698698
pub struct ButNeedsToSatisfy {
699699
#[primary_span]

compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::infer::lexical_region_resolve::RegionResolutionError;
99
use crate::infer::{SubregionOrigin, TypeTrace};
1010
use crate::traits::{ObligationCauseCode, UnifyReceiverContext};
1111
use rustc_data_structures::fx::FxHashSet;
12-
use rustc_errors::{AddSubdiagnostic, Applicability, Diagnostic, ErrorGuaranteed, MultiSpan};
12+
use rustc_errors::{AddToDiagnostic, Applicability, Diagnostic, ErrorGuaranteed, MultiSpan};
1313
use rustc_hir::def_id::DefId;
1414
use rustc_hir::intravisit::{walk_ty, Visitor};
1515
use rustc_hir::{self as hir, GenericBound, Item, ItemKind, Lifetime, LifetimeName, Node, TyKind};

0 commit comments

Comments
 (0)