Skip to content

Commit 72852fa

Browse files
committed
Add test for non-crate-level inner attributes
1 parent 30e25dd commit 72852fa

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

tests/ui/cfg_attr_lint.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,12 @@
66
#![cfg_attr(rustfmt, rustfmt_skip)]
77

88
#[cfg_attr(rustfmt, rustfmt_skip)]
9-
fn main() {}
9+
fn main() {
10+
foo::f();
11+
}
12+
13+
mod foo {
14+
#![cfg_attr(rustfmt, rustfmt_skip)]
15+
16+
pub fn f() {}
17+
}

tests/ui/cfg_attr_lint.stderr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@ error: `cfg_attr` is deprecated for rustfmt and got replaced by tool_attributes
66
|
77
= note: `-D clippy::deprecated-cfg-attr` implied by `-D warnings`
88

9-
error: aborting due to previous error
9+
error: `cfg_attr` is deprecated for rustfmt and got replaced by tool_attributes
10+
--> $DIR/cfg_attr_lint.rs:14:5
11+
|
12+
14 | #![cfg_attr(rustfmt, rustfmt_skip)]
13+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `#![rustfmt::skip]`
14+
15+
error: aborting due to 2 previous errors
1016

0 commit comments

Comments
 (0)