Skip to content

Commit fb7699d

Browse files
committed
Rework clippy detection in attribute lint
1 parent 0ea5e38 commit fb7699d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clippy_lints/src/attrs.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,11 @@ fn check_clippy_lint_names(cx: &LateContext<'_, '_>, items: &[NestedMetaItem]) {
315315
let lint_store = cx.lints();
316316
for lint in items {
317317
if_chain! {
318-
if let Some(word) = lint.word();
319-
if let Some(tool_name) = word.is_scoped();
318+
if let Some(meta_item) = lint.meta_item();
319+
if meta_item.path.segments.len() > 1;
320+
if let tool_name = meta_item.path.segments[0].ident;
320321
if tool_name.as_str() == "clippy";
321-
let name = word.name();
322+
let name = meta_item.path.segments.last().unwrap().ident.name;
322323
if let CheckLintNameResult::Tool(Err((None, _))) = lint_store.check_lint_name(
323324
&name.as_str(),
324325
Some(tool_name.as_str()),

0 commit comments

Comments
 (0)