Inline some hot lint pass functions.
These each have a single call site, due to being called from a "combined" lint pass.
This commit is contained in:
parent
ec117c0ebd
commit
b08fd6e8ef
3 changed files with 6 additions and 0 deletions
|
@ -96,6 +96,7 @@ fn pierce_parens(mut expr: &ast::Expr) -> &ast::Expr {
|
|||
}
|
||||
|
||||
impl EarlyLintPass for WhileTrue {
|
||||
#[inline]
|
||||
fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) {
|
||||
if let ast::ExprKind::While(cond, _, label) = &e.kind
|
||||
&& let cond = pierce_parens(cond)
|
||||
|
@ -360,6 +361,7 @@ impl EarlyLintPass for UnsafeCode {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) {
|
||||
if let ast::ExprKind::Block(ref blk, _) = e.kind {
|
||||
// Don't warn about generated blocks; that'll just pollute the output.
|
||||
|
@ -582,6 +584,7 @@ impl MissingDoc {
|
|||
}
|
||||
|
||||
impl<'tcx> LateLintPass<'tcx> for MissingDoc {
|
||||
#[inline]
|
||||
fn enter_lint_attrs(&mut self, _cx: &LateContext<'_>, attrs: &[ast::Attribute]) {
|
||||
let doc_hidden = self.doc_hidden()
|
||||
|| attrs.iter().any(|attr| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue