diff options
| author | Lzu Tao <taolzu@gmail.com> | 2019-12-01 19:26:33 +0700 |
|---|---|---|
| committer | Lzu Tao <taolzu@gmail.com> | 2019-12-01 19:38:01 +0700 |
| commit | 5488672d1f1ae02cc9910ecd67485affce996bc8 (patch) | |
| tree | dc1b6dc0bbcc5f6f8a0738c182647196bc409990 /clippy_lints/src/missing_inline.rs | |
| parent | e47ae20b5b480d09c7d6abced3e16478b0684190 (diff) | |
| download | rust-5488672d1f1ae02cc9910ecd67485affce996bc8.tar.gz rust-5488672d1f1ae02cc9910ecd67485affce996bc8.zip | |
account for external macro in MISSING_INLINE_IN_PUBLIC_ITEMS lint
Diffstat (limited to 'clippy_lints/src/missing_inline.rs')
| -rw-r--r-- | clippy_lints/src/missing_inline.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/missing_inline.rs b/clippy_lints/src/missing_inline.rs index d9cd78dcd41..927ead77a24 100644 --- a/clippy_lints/src/missing_inline.rs +++ b/clippy_lints/src/missing_inline.rs @@ -1,6 +1,6 @@ use crate::utils::span_lint; use rustc::hir; -use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc::lint::{self, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::{declare_lint_pass, declare_tool_lint}; use syntax::ast; use syntax::source_map::Span; @@ -81,7 +81,7 @@ declare_lint_pass!(MissingInline => [MISSING_INLINE_IN_PUBLIC_ITEMS]); impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingInline { fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) { - if is_executable(cx) { + if lint::in_external_macro(cx.sess(), it.span) || is_executable(cx) { return; } @@ -131,7 +131,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingInline { fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx hir::ImplItem) { use rustc::ty::{ImplContainer, TraitContainer}; - if is_executable(cx) { + if lint::in_external_macro(cx.sess(), impl_item.span) || is_executable(cx) { return; } |
