Skip to content

Commit 4f4248f

Browse files
committed
Fix rebase mistake
1 parent 798064c commit 4f4248f

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ use rustc_ast::walk_list;
1313
use rustc_ast::*;
1414
use rustc_ast_pretty::pprust::{self, State};
1515
use rustc_data_structures::fx::FxHashMap;
16-
use rustc_errors::fluent;
16+
use rustc_errors::{fluent, IntoDiagnostic};
1717
use rustc_macros::Subdiagnostic;
1818
use rustc_parse::validate_attr;
1919
use rustc_session::lint::builtin::{
2020
DEPRECATED_WHERE_CLAUSE_LOCATION, MISSING_ABI, PATTERNS_IN_FNS_WITHOUT_BODY,
2121
};
2222
use rustc_session::lint::{BuiltinLintDiagnostics, LintBuffer};
23-
use rustc_session::{Session, SessionDiagnostic};
23+
use rustc_session::Session;
2424
use rustc_span::source_map::Spanned;
2525
use rustc_span::symbol::{kw, sym, Ident};
2626
use rustc_span::Span;
@@ -399,7 +399,7 @@ impl<'a> AstValidator<'a> {
399399

400400
fn check_type_no_bounds<D>(&self, bounds: &[GenericBound], create_diag: impl FnOnce(Span) -> D)
401401
where
402-
D: SessionDiagnostic<'a>,
402+
D: IntoDiagnostic<'a>,
403403
{
404404
let span = match bounds {
405405
[] => return,
@@ -431,7 +431,7 @@ impl<'a> AstValidator<'a> {
431431
create_diag: impl FnOnce(Span, Span, Span) -> D,
432432
body: Option<Span>,
433433
) where
434-
D: SessionDiagnostic<'a>,
434+
D: IntoDiagnostic<'a>,
435435
{
436436
let Some(body) = body else {
437437
return;
@@ -502,7 +502,7 @@ impl<'a> AstValidator<'a> {
502502

503503
fn check_item_named<D>(&self, ident: Ident, create_diag: impl FnOnce(Span) -> D)
504504
where
505-
D: SessionDiagnostic<'a>,
505+
D: IntoDiagnostic<'a>,
506506
{
507507
if ident.name != kw::Underscore {
508508
return;

compiler/rustc_ast_passes/src/errors.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -461,15 +461,15 @@ pub struct GenericParamWrongOrder {
461461
pub correct_order: String,
462462
}
463463

464-
#[derive(SessionDiagnostic)]
464+
#[derive(Diagnostic)]
465465
#[diag(ast_passes::obsolete_auto_trait_syntax)]
466466
#[help]
467467
pub struct ObsoleteAutoTraitSyntax {
468468
#[primary_span]
469469
pub span: Span,
470470
}
471471

472-
#[derive(SessionDiagnostic)]
472+
#[derive(Diagnostic)]
473473
#[diag(ast_passes::unsafe_negative_impl, code = "E0198")]
474474
pub struct UnsafeNegativeImpl {
475475
#[primary_span]
@@ -480,7 +480,7 @@ pub struct UnsafeNegativeImpl {
480480
pub unsafe_span: Span,
481481
}
482482

483-
#[derive(SessionDiagnostic)]
483+
#[derive(Diagnostic)]
484484
#[diag(ast_passes::unsafe_inherent_impl, code = "E0197")]
485485
pub struct UnsafeInherentImpl {
486486
#[primary_span]
@@ -490,7 +490,7 @@ pub struct UnsafeInherentImpl {
490490
pub unsafe_span: Span,
491491
}
492492

493-
#[derive(SessionDiagnostic)]
493+
#[derive(Diagnostic)]
494494
#[diag(ast_passes::negative_inherent_impl)]
495495
pub struct NegativeInherentImpl {
496496
#[primary_span]
@@ -500,7 +500,7 @@ pub struct NegativeInherentImpl {
500500
pub negative_span: Span,
501501
}
502502

503-
#[derive(SessionDiagnostic)]
503+
#[derive(Diagnostic)]
504504
#[diag(ast_passes::default_inherent_impl)]
505505
#[note]
506506
pub struct DefaultInherentImpl {
@@ -511,7 +511,7 @@ pub struct DefaultInherentImpl {
511511
pub default_span: Span,
512512
}
513513

514-
#[derive(SessionDiagnostic)]
514+
#[derive(Diagnostic)]
515515
#[diag(ast_passes::const_inherent_impl)]
516516
#[note]
517517
pub struct ConstInherentImpl {
@@ -522,50 +522,50 @@ pub struct ConstInherentImpl {
522522
pub const_span: Span,
523523
}
524524

525-
#[derive(SessionDiagnostic)]
525+
#[derive(Diagnostic)]
526526
#[diag(ast_passes::unsafe_extern_block)]
527527
pub struct UnsafeExternBlock {
528528
#[primary_span]
529529
pub span: Span,
530530
}
531531

532-
#[derive(SessionDiagnostic)]
532+
#[derive(Diagnostic)]
533533
#[diag(ast_passes::unsafe_module)]
534534
pub struct UnsafeModule {
535535
#[primary_span]
536536
pub span: Span,
537537
}
538538

539-
#[derive(SessionDiagnostic)]
539+
#[derive(Diagnostic)]
540540
#[diag(ast_passes::empty_union)]
541541
pub struct EmptyUnion {
542542
#[primary_span]
543543
pub span: Span,
544544
}
545545

546-
#[derive(SessionDiagnostic)]
546+
#[derive(Diagnostic)]
547547
#[diag(ast_passes::ty_alias_with_where_clause)]
548548
#[note]
549549
pub struct TyAliasWithWhereClause {
550550
#[primary_span]
551551
pub span: Span,
552552
}
553553

554-
#[derive(SessionDiagnostic)]
554+
#[derive(Diagnostic)]
555555
#[diag(ast_passes::generic_param_with_default_not_trailing)]
556556
pub struct GenericParamWithDefaultNotTrailing {
557557
#[primary_span]
558558
pub span: Span,
559559
}
560560

561-
#[derive(SessionDiagnostic)]
561+
#[derive(Diagnostic)]
562562
#[diag(ast_passes::lifetime_nested_quantification, code = "E0316")]
563563
pub struct LifetimeNestedQuantification {
564564
#[primary_span]
565565
pub span: Span,
566566
}
567567

568-
#[derive(SessionDiagnostic)]
568+
#[derive(Diagnostic)]
569569
#[diag(ast_passes::super_trait_with_maybe)]
570570
#[note]
571571
pub struct SuperTraitWithMaybe {
@@ -574,14 +574,14 @@ pub struct SuperTraitWithMaybe {
574574
pub path_str: String,
575575
}
576576

577-
#[derive(SessionDiagnostic)]
577+
#[derive(Diagnostic)]
578578
#[diag(ast_passes::trait_object_with_maybe)]
579579
pub struct TraitObjectWithMaybe {
580580
#[primary_span]
581581
pub span: Span,
582582
}
583583

584-
#[derive(SessionDiagnostic)]
584+
#[derive(Diagnostic)]
585585
#[diag(ast_passes::forbidden_maybe_const)]
586586
#[note]
587587
pub struct ForbiddenMaybeConst {
@@ -610,14 +610,14 @@ impl AddToDiagnostic for DisallowTildeConstContext {
610610
}
611611
}
612612

613-
#[derive(SessionDiagnostic)]
613+
#[derive(Diagnostic)]
614614
#[diag(ast_passes::maybe_const_with_maybe_trait)]
615615
pub struct MaybeConstWithMaybeTrait {
616616
#[primary_span]
617617
pub span: Span,
618618
}
619619

620-
#[derive(SessionDiagnostic)]
620+
#[derive(Diagnostic)]
621621
#[diag(ast_passes::const_async_fn)]
622622
pub struct ConstAsyncFn {
623623
#[primary_span]
@@ -630,23 +630,23 @@ pub struct ConstAsyncFn {
630630
pub fn_span: Span,
631631
}
632632

633-
#[derive(SessionDiagnostic)]
633+
#[derive(Diagnostic)]
634634
#[diag(ast_passes::patterns_in_foreign_fns, code = "E0130")]
635635
pub struct PatternsInForeignFns {
636636
#[primary_span]
637637
#[label]
638638
pub span: Span,
639639
}
640640

641-
#[derive(SessionDiagnostic)]
641+
#[derive(Diagnostic)]
642642
#[diag(ast_passes::patterns_in_fns_without_body, code = "E0642")]
643643
pub struct PatternsInFnsWithoutBody {
644644
#[primary_span]
645645
#[label]
646646
pub span: Span,
647647
}
648648

649-
#[derive(SessionDiagnostic)]
649+
#[derive(Diagnostic)]
650650
#[diag(ast_passes::equality_constraint)]
651651
#[note]
652652
pub struct EqualityConstraint {
@@ -662,7 +662,7 @@ pub struct EqualityConstraintToAssocConstraintSuggestion {
662662
pub suggestion: Vec<(Span, String)>,
663663
}
664664

665-
impl AddSubdiagnostic for EqualityConstraintToAssocConstraintSuggestion {
665+
impl AddToDiagnostic for EqualityConstraintToAssocConstraintSuggestion {
666666
fn add_to_diagnostic(self, diag: &mut Diagnostic) {
667667
diag.set_arg("assoc_ty", self.assoc_ty);
668668
diag.multipart_suggestion(

0 commit comments

Comments
 (0)