Skip to content

Commit 8feb2c6

Browse files
committed
Fix rustfmt::skip detection
1 parent fb7699d commit 8feb2c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clippy_lints/src/attrs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ impl EarlyLintPass for CfgAttrPass {
527527
if feature_item.check_name("rustfmt");
528528
// check for `rustfmt_skip` and `rustfmt::skip`
529529
if let Some(skip_item) = &items[1].meta_item();
530-
if skip_item.check_name("rustfmt_skip") || skip_item.check_name("skip");
530+
if skip_item.check_name("rustfmt_skip") ||
531+
skip_item.path.segments.last().expect("empty path in attribute").ident.name == "skip";
531532
// Only lint outer attributes, because custom inner attributes are unstable
532533
// Tracking issue: https://github.com/rust-lang/rust/issues/54726
533534
if let AttrStyle::Outer = attr.style;

0 commit comments

Comments
 (0)