@@ -497,9 +497,6 @@ pub struct LateContext<'tcx> {
497
497
/// Items accessible from the crate being checked.
498
498
pub effective_visibilities : & ' tcx EffectiveVisibilities ,
499
499
500
- /// The store of registered lints and the lint levels.
501
- pub lint_store : & ' tcx LintStore ,
502
-
503
500
pub last_node_with_lint_attrs : hir:: HirId ,
504
501
505
502
/// Generic type parameters in scope for the item we are in.
@@ -515,21 +512,14 @@ pub struct EarlyContext<'a> {
515
512
pub buffered : LintBuffer ,
516
513
}
517
514
518
- pub trait LintPassObject : Sized { }
519
-
520
- impl LintPassObject for EarlyLintPassObject { }
521
-
522
- impl LintPassObject for LateLintPassObject < ' _ > { }
523
-
524
- pub trait LintContext : Sized {
525
- type PassObject : LintPassObject ;
526
-
515
+ pub trait LintContext {
527
516
fn sess ( & self ) -> & Session ;
528
- fn lints ( & self ) -> & LintStore ;
529
517
530
- /// Emit a lint at the appropriate level, with an optional associated span and an existing diagnostic.
518
+ /// Emit a lint at the appropriate level, with an optional associated span and an existing
519
+ /// diagnostic.
531
520
///
532
- /// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
521
+ /// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed
522
+ /// explanation.
533
523
///
534
524
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
535
525
#[ rustc_lint_diagnostics]
@@ -1059,17 +1049,11 @@ impl<'a> EarlyContext<'a> {
1059
1049
}
1060
1050
1061
1051
impl < ' tcx > LintContext for LateContext < ' tcx > {
1062
- type PassObject = LateLintPassObject < ' tcx > ;
1063
-
1064
1052
/// Gets the overall compiler `Session` object.
1065
1053
fn sess ( & self ) -> & Session {
1066
1054
& self . tcx . sess
1067
1055
}
1068
1056
1069
- fn lints ( & self ) -> & LintStore {
1070
- & * self . lint_store
1071
- }
1072
-
1073
1057
#[ rustc_lint_diagnostics]
1074
1058
fn lookup < S : Into < MultiSpan > > (
1075
1059
& self ,
@@ -1094,17 +1078,11 @@ impl<'tcx> LintContext for LateContext<'tcx> {
1094
1078
}
1095
1079
1096
1080
impl LintContext for EarlyContext < ' _ > {
1097
- type PassObject = EarlyLintPassObject ;
1098
-
1099
1081
/// Gets the overall compiler `Session` object.
1100
1082
fn sess ( & self ) -> & Session {
1101
1083
& self . builder . sess ( )
1102
1084
}
1103
1085
1104
- fn lints ( & self ) -> & LintStore {
1105
- self . builder . lint_store ( )
1106
- }
1107
-
1108
1086
#[ rustc_lint_diagnostics]
1109
1087
fn lookup < S : Into < MultiSpan > > (
1110
1088
& self ,
0 commit comments