diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 825093384fba..db3e0f20423b 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -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| { diff --git a/compiler/rustc_lint/src/hidden_unicode_codepoints.rs b/compiler/rustc_lint/src/hidden_unicode_codepoints.rs index 7106e75dba29..dc2f5c0e2967 100644 --- a/compiler/rustc_lint/src/hidden_unicode_codepoints.rs +++ b/compiler/rustc_lint/src/hidden_unicode_codepoints.rs @@ -121,6 +121,7 @@ impl EarlyLintPass for HiddenUnicodeCodepoints { } } + #[inline] fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &ast::Expr) { // byte strings are already handled well enough by `EscapeError::NonAsciiCharInByteString` match &expr.kind { diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index b5db94f8c068..df46e37eea8f 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -946,6 +946,7 @@ impl UnusedParens { } impl EarlyLintPass for UnusedParens { + #[inline] fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) { match e.kind { ExprKind::Let(ref pat, _, _) | ExprKind::ForLoop(ref pat, ..) => { @@ -1164,6 +1165,7 @@ impl EarlyLintPass for UnusedBraces { ::check_stmt(self, cx, s) } + #[inline] fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) { ::check_expr(self, cx, e);