Skip to content

Commit

Permalink
Add test for non-crate-level inner attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Sep 18, 2018
1 parent 30e25dd commit 72852fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion tests/ui/cfg_attr_lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg_attr(rustfmt, rustfmt_skip)]
fn main() {}
fn main() {
foo::f();
}

mod foo {
#![cfg_attr(rustfmt, rustfmt_skip)]

pub fn f() {}
}
8 changes: 7 additions & 1 deletion tests/ui/cfg_attr_lint.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@ error: `cfg_attr` is deprecated for rustfmt and got replaced by tool_attributes
|
= note: `-D clippy::deprecated-cfg-attr` implied by `-D warnings`

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

error: aborting due to 2 previous errors

0 comments on commit 72852fa

Please sign in to comment.