Skip to content

Commit 733c7af

Browse files
committed
Rename {enter,exit}_lint_attrs to check_attributes{,_post}
1 parent 47265ad commit 733c7af

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

clippy_config/src/msrvs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ impl Msrv {
143143
None
144144
}
145145

146-
pub fn enter_lint_attrs(&mut self, sess: &Session, attrs: &[Attribute]) {
146+
pub fn check_attributes(&mut self, sess: &Session, attrs: &[Attribute]) {
147147
if let Some(version) = Self::parse_attr(sess, attrs) {
148148
self.stack.push(version);
149149
}
150150
}
151151

152-
pub fn exit_lint_attrs(&mut self, sess: &Session, attrs: &[Attribute]) {
152+
pub fn check_attributes_post(&mut self, sess: &Session, attrs: &[Attribute]) {
153153
if Self::parse_attr(sess, attrs).is_some() {
154154
self.stack.pop();
155155
}

clippy_lints/src/cognitive_complexity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ impl<'tcx> LateLintPass<'tcx> for CognitiveComplexity {
158158
}
159159
}
160160

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]) {
162162
self.limit.push_attrs(cx.sess(), attrs, "cognitive_complexity");
163163
}
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]) {
165165
self.limit.pop_attrs(cx.sess(), attrs, "cognitive_complexity");
166166
}
167167
}

clippy_lints/src/missing_doc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ impl MissingDoc {
162162
impl_lint_pass!(MissingDoc => [MISSING_DOCS_IN_PRIVATE_ITEMS]);
163163

164164
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]) {
166166
let doc_hidden = self.doc_hidden() || is_doc_hidden(attrs);
167167
self.doc_hidden_stack.push(doc_hidden);
168168
}
169169

170-
fn exit_lint_attrs(&mut self, _: &LateContext<'tcx>, _: &'tcx [ast::Attribute]) {
170+
fn check_attributes_post(&mut self, _: &LateContext<'tcx>, _: &'tcx [ast::Attribute]) {
171171
self.doc_hidden_stack.pop().expect("empty doc_hidden_stack");
172172
}
173173

clippy_lints/src/utils/internal_lints/msrv_attr_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl LateLintPass<'_> for MsrvAttrImpl {
4242
.filter(|t| matches!(t.unpack(), GenericArgKind::Type(_)))
4343
.any(|t| match_type(cx, t.expect_ty(), &paths::MSRV))
4444
})
45-
&& !items.iter().any(|item| item.ident.name == sym!(enter_lint_attrs))
45+
&& !items.iter().any(|item| item.ident.name == sym!(check_attributes))
4646
{
4747
let context = if is_late_pass { "LateContext" } else { "EarlyContext" };
4848
let lint_pass = if is_late_pass { "LateLintPass" } else { "EarlyLintPass" };

clippy_utils/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ use rustc_middle::hir::nested_filter;
131131
#[macro_export]
132132
macro_rules! extract_msrv_attr {
133133
($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]) {
135135
let sess = rustc_lint::LintContext::sess(cx);
136-
self.msrv.enter_lint_attrs(sess, attrs);
136+
self.msrv.check_attributes(sess, attrs);
137137
}
138138

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]) {
140140
let sess = rustc_lint::LintContext::sess(cx);
141-
self.msrv.exit_lint_attrs(sess, attrs);
141+
self.msrv.check_attributes_post(sess, attrs);
142142
}
143143
};
144144
}

0 commit comments

Comments
 (0)