]> git.lizzy.rs Git - rust.git/blob - src/docs/deprecated_cfg_attr.txt
[Arithmetic] Consider literals
[rust.git] / src / docs / deprecated_cfg_attr.txt
1 ### What it does
2 Checks for `#[cfg_attr(rustfmt, rustfmt_skip)]` and suggests to replace it
3 with `#[rustfmt::skip]`.
4
5 ### Why is this bad?
6 Since tool_attributes ([rust-lang/rust#44690](https://github.com/rust-lang/rust/issues/44690))
7 are stable now, they should be used instead of the old `cfg_attr(rustfmt)` attributes.
8
9 ### Known problems
10 This lint doesn't detect crate level inner attributes, because they get
11 processed before the PreExpansionPass lints get executed. See
12 [#3123](https://github.com/rust-lang/rust-clippy/pull/3123#issuecomment-422321765)
13
14 ### Example
15 ```
16 #[cfg_attr(rustfmt, rustfmt_skip)]
17 fn main() { }
18 ```
19
20 Use instead:
21 ```
22 #[rustfmt::skip]
23 fn main() { }
24 ```