File tree 5 files changed +11
-11
lines changed
5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -143,13 +143,13 @@ impl Msrv {
143
143
None
144
144
}
145
145
146
- pub fn enter_lint_attrs ( & mut self , sess : & Session , attrs : & [ Attribute ] ) {
146
+ pub fn check_attributes ( & mut self , sess : & Session , attrs : & [ Attribute ] ) {
147
147
if let Some ( version) = Self :: parse_attr ( sess, attrs) {
148
148
self . stack . push ( version) ;
149
149
}
150
150
}
151
151
152
- pub fn exit_lint_attrs ( & mut self , sess : & Session , attrs : & [ Attribute ] ) {
152
+ pub fn check_attributes_post ( & mut self , sess : & Session , attrs : & [ Attribute ] ) {
153
153
if Self :: parse_attr ( sess, attrs) . is_some ( ) {
154
154
self . stack . pop ( ) ;
155
155
}
Original file line number Diff line number Diff line change @@ -158,10 +158,10 @@ impl<'tcx> LateLintPass<'tcx> for CognitiveComplexity {
158
158
}
159
159
}
160
160
161
- fn enter_lint_attrs ( & mut self , cx : & LateContext < ' tcx > , attrs : & ' tcx [ Attribute ] ) {
161
+ fn check_attributes ( & mut self , cx : & LateContext < ' tcx > , attrs : & ' tcx [ Attribute ] ) {
162
162
self . limit . push_attrs ( cx. sess ( ) , attrs, "cognitive_complexity" ) ;
163
163
}
164
- fn exit_lint_attrs ( & mut self , cx : & LateContext < ' tcx > , attrs : & ' tcx [ Attribute ] ) {
164
+ fn check_attributes_post ( & mut self , cx : & LateContext < ' tcx > , attrs : & ' tcx [ Attribute ] ) {
165
165
self . limit . pop_attrs ( cx. sess ( ) , attrs, "cognitive_complexity" ) ;
166
166
}
167
167
}
Original file line number Diff line number Diff line change @@ -162,12 +162,12 @@ impl MissingDoc {
162
162
impl_lint_pass ! ( MissingDoc => [ MISSING_DOCS_IN_PRIVATE_ITEMS ] ) ;
163
163
164
164
impl < ' tcx > LateLintPass < ' tcx > for MissingDoc {
165
- fn enter_lint_attrs ( & mut self , _: & LateContext < ' tcx > , attrs : & ' tcx [ ast:: Attribute ] ) {
165
+ fn check_attributes ( & mut self , _: & LateContext < ' tcx > , attrs : & ' tcx [ ast:: Attribute ] ) {
166
166
let doc_hidden = self . doc_hidden ( ) || is_doc_hidden ( attrs) ;
167
167
self . doc_hidden_stack . push ( doc_hidden) ;
168
168
}
169
169
170
- fn exit_lint_attrs ( & mut self , _: & LateContext < ' tcx > , _: & ' tcx [ ast:: Attribute ] ) {
170
+ fn check_attributes_post ( & mut self , _: & LateContext < ' tcx > , _: & ' tcx [ ast:: Attribute ] ) {
171
171
self . doc_hidden_stack . pop ( ) . expect ( "empty doc_hidden_stack" ) ;
172
172
}
173
173
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ impl LateLintPass<'_> for MsrvAttrImpl {
42
42
. filter ( |t| matches ! ( t. unpack( ) , GenericArgKind :: Type ( _) ) )
43
43
. any ( |t| match_type ( cx, t. expect_ty ( ) , & paths:: MSRV ) )
44
44
} )
45
- && !items. iter ( ) . any ( |item| item. ident . name == sym ! ( enter_lint_attrs ) )
45
+ && !items. iter ( ) . any ( |item| item. ident . name == sym ! ( check_attributes ) )
46
46
{
47
47
let context = if is_late_pass { "LateContext" } else { "EarlyContext" } ;
48
48
let lint_pass = if is_late_pass { "LateLintPass" } else { "EarlyLintPass" } ;
Original file line number Diff line number Diff line change @@ -131,14 +131,14 @@ use rustc_middle::hir::nested_filter;
131
131
#[ macro_export]
132
132
macro_rules! extract_msrv_attr {
133
133
( $context: ident) => {
134
- fn enter_lint_attrs ( & mut self , cx: & rustc_lint:: $context<' _>, attrs: & [ rustc_ast:: ast:: Attribute ] ) {
134
+ fn check_attributes ( & mut self , cx: & rustc_lint:: $context<' _>, attrs: & [ rustc_ast:: ast:: Attribute ] ) {
135
135
let sess = rustc_lint:: LintContext :: sess( cx) ;
136
- self . msrv. enter_lint_attrs ( sess, attrs) ;
136
+ self . msrv. check_attributes ( sess, attrs) ;
137
137
}
138
138
139
- fn exit_lint_attrs ( & mut self , cx: & rustc_lint:: $context<' _>, attrs: & [ rustc_ast:: ast:: Attribute ] ) {
139
+ fn check_attributes_post ( & mut self , cx: & rustc_lint:: $context<' _>, attrs: & [ rustc_ast:: ast:: Attribute ] ) {
140
140
let sess = rustc_lint:: LintContext :: sess( cx) ;
141
- self . msrv. exit_lint_attrs ( sess, attrs) ;
141
+ self . msrv. check_attributes_post ( sess, attrs) ;
142
142
}
143
143
} ;
144
144
}
You can’t perform that action at this time.
0 commit comments