summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/deprecated_cfg_attr.txt
blob: 9f264887a057e3c4eb347abef608a7ab7dcc8c73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
### What it does
Checks for `#[cfg_attr(rustfmt, rustfmt_skip)]` and suggests to replace it
with `#[rustfmt::skip]`.

### Why is this bad?
Since tool_attributes ([rust-lang/rust#44690](https://github.com/rust-lang/rust/issues/44690))
are stable now, they should be used instead of the old `cfg_attr(rustfmt)` attributes.

### Known problems
This lint doesn't detect crate level inner attributes, because they get
processed before the PreExpansionPass lints get executed. See
[#3123](https://github.com/rust-lang/rust-clippy/pull/3123#issuecomment-422321765)

### Example
```
#[cfg_attr(rustfmt, rustfmt_skip)]
fn main() { }
```

Use instead:
```
#[rustfmt::skip]
fn main() { }
```