From 8feb2c6b2f7a6d32ce526678c068e7a5bfee4669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Mon, 18 Mar 2019 12:29:56 +0100 Subject: [PATCH] Fix rustfmt::skip detection --- clippy_lints/src/attrs.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs index b461b1364eff..71e07b330a9f 100644 --- a/clippy_lints/src/attrs.rs +++ b/clippy_lints/src/attrs.rs @@ -527,7 +527,8 @@ impl EarlyLintPass for CfgAttrPass { if feature_item.check_name("rustfmt"); // check for `rustfmt_skip` and `rustfmt::skip` if let Some(skip_item) = &items[1].meta_item(); - if skip_item.check_name("rustfmt_skip") || skip_item.check_name("skip"); + if skip_item.check_name("rustfmt_skip") || + skip_item.path.segments.last().expect("empty path in attribute").ident.name == "skip"; // Only lint outer attributes, because custom inner attributes are unstable // Tracking issue: https://github.com/rust-lang/rust/issues/54726 if let AttrStyle::Outer = attr.style;