From fb7699d9e5fc7bcf0c1cbebd0f847bce5ee89f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Mon, 18 Mar 2019 12:29:09 +0100 Subject: [PATCH] Rework clippy detection in attribute lint --- clippy_lints/src/attrs.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs index e7810152dc1..b461b1364ef 100644 --- a/clippy_lints/src/attrs.rs +++ b/clippy_lints/src/attrs.rs @@ -315,10 +315,11 @@ fn check_clippy_lint_names(cx: &LateContext<'_, '_>, items: &[NestedMetaItem]) { let lint_store = cx.lints(); for lint in items { if_chain! { - if let Some(word) = lint.word(); - if let Some(tool_name) = word.is_scoped(); + if let Some(meta_item) = lint.meta_item(); + if meta_item.path.segments.len() > 1; + if let tool_name = meta_item.path.segments[0].ident; if tool_name.as_str() == "clippy"; - let name = word.name(); + let name = meta_item.path.segments.last().unwrap().ident.name; if let CheckLintNameResult::Tool(Err((None, _))) = lint_store.check_lint_name( &name.as_str(), Some(tool_name.as_str()),