Skip to content

Commit 8cd2008

Browse files
committed
Replace cfg_attr(rustfmt... thingies
1 parent bb2f6a5 commit 8cd2008

File tree

7 files changed

+18
-13
lines changed

7 files changed

+18
-13
lines changed

clippy_lints/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#![allow(stable_features)]
1212
#![feature(iterator_find_map)]
1313
#![feature(macro_at_most_once_rep)]
14+
#![feature(tool_attributes)]
1415
#![feature(rust_2018_preview)]
1516

1617
extern crate cargo_metadata;

clippy_lints/src/loops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarUsedAfterLoopVisitor<'a, 'tcx> {
17781778

17791779
/// Return true if the type of expr is one that provides `IntoIterator` impls
17801780
/// for `&T` and `&mut T`, such as `Vec`.
1781-
#[cfg_attr(rustfmt, rustfmt_skip)]
1781+
#[rustfmt::skip]
17821782
fn is_ref_iterable_type(cx: &LateContext, e: &Expr) -> bool {
17831783
// no walk_ptrs_ty: calling iter() on a reference can make sense because it
17841784
// will allow further borrows afterwards

clippy_lints/src/matches.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MatchPass {
197197
}
198198
}
199199

200-
#[cfg_attr(rustfmt, rustfmt_skip)]
200+
#[rustfmt::skip]
201201
fn check_single_match(cx: &LateContext, ex: &Expr, arms: &[Arm], expr: &Expr) {
202202
if arms.len() == 2 &&
203203
arms[0].pats.len() == 1 && arms[0].guard.is_none() &&

clippy_lints/src/methods.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ enum Convention {
18211821
StartsWith(&'static str),
18221822
}
18231823

1824-
#[cfg_attr(rustfmt, rustfmt_skip)]
1824+
#[rustfmt::skip]
18251825
const CONVENTIONS: [(Convention, &[SelfKind]); 6] = [
18261826
(Convention::Eq("new"), &[SelfKind::No]),
18271827
(Convention::StartsWith("as_"), &[SelfKind::Ref, SelfKind::RefMut]),
@@ -1831,7 +1831,7 @@ const CONVENTIONS: [(Convention, &[SelfKind]); 6] = [
18311831
(Convention::StartsWith("to_"), &[SelfKind::Ref]),
18321832
];
18331833

1834-
#[cfg_attr(rustfmt, rustfmt_skip)]
1834+
#[rustfmt::skip]
18351835
const TRAIT_METHODS: [(&str, usize, SelfKind, OutType, &str); 30] = [
18361836
("add", 2, SelfKind::Value, OutType::Any, "std::ops::Add"),
18371837
("as_mut", 1, SelfKind::RefMut, OutType::Ref, "std::convert::AsMut"),
@@ -1865,7 +1865,7 @@ const TRAIT_METHODS: [(&str, usize, SelfKind, OutType, &str); 30] = [
18651865
("sub", 2, SelfKind::Value, OutType::Any, "std::ops::Sub"),
18661866
];
18671867

1868-
#[cfg_attr(rustfmt, rustfmt_skip)]
1868+
#[rustfmt::skip]
18691869
const PATTERN_METHODS: [(&str, usize); 17] = [
18701870
("contains", 1),
18711871
("starts_with", 1),

clippy_lints/src/non_expressive_names.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct SimilarNamesLocalVisitor<'a, 'tcx: 'a> {
8888

8989
// this list contains lists of names that are allowed to be similar
9090
// the assumption is that no name is ever contained in multiple lists.
91-
#[cfg_attr(rustfmt, rustfmt_skip)]
91+
#[rustfmt::skip]
9292
const WHITELIST: &[&[&str]] = &[
9393
&["parsed", "parser"],
9494
&["lhs", "rhs"],

tests/needless_continue_helpers.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
#![feature(tool_attributes)]
2+
13
// Tests for the various helper functions used by the needless_continue
24
// lint that don't belong in utils.
35

46
extern crate clippy_lints;
57
use clippy_lints::needless_continue::{erode_block, erode_from_back, erode_from_front};
68

79
#[test]
8-
#[cfg_attr(rustfmt, rustfmt_skip)]
10+
#[rustfmt::skip]
911
fn test_erode_from_back() {
1012
let input = "\
1113
{
@@ -23,7 +25,7 @@ fn test_erode_from_back() {
2325
}
2426

2527
#[test]
26-
#[cfg_attr(rustfmt, rustfmt_skip)]
28+
#[rustfmt::skip]
2729
fn test_erode_from_back_no_brace() {
2830
let input = "\
2931
let x = 5;
@@ -35,7 +37,7 @@ let y = something();
3537
}
3638

3739
#[test]
38-
#[cfg_attr(rustfmt, rustfmt_skip)]
40+
#[rustfmt::skip]
3941
fn test_erode_from_front() {
4042
let input = "
4143
{
@@ -54,7 +56,7 @@ fn test_erode_from_front() {
5456
}
5557

5658
#[test]
57-
#[cfg_attr(rustfmt, rustfmt_skip)]
59+
#[rustfmt::skip]
5860
fn test_erode_from_front_no_brace() {
5961
let input = "
6062
something();
@@ -70,7 +72,7 @@ fn test_erode_from_front_no_brace() {
7072
}
7173

7274
#[test]
73-
#[cfg_attr(rustfmt, rustfmt_skip)]
75+
#[rustfmt::skip]
7476
fn test_erode_block() {
7577

7678
let input = "

tests/trim_multiline.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![feature(tool_attributes)]
2+
13
/// test the multiline-trim function
24
extern crate clippy_lints;
35

@@ -13,7 +15,7 @@ fn test_single_line() {
1315
}
1416

1517
#[test]
16-
#[cfg_attr(rustfmt, rustfmt_skip)]
18+
#[rustfmt::skip]
1719
fn test_block() {
1820
assert_eq!("\
1921
if x {
@@ -38,7 +40,7 @@ if x {
3840
}
3941

4042
#[test]
41-
#[cfg_attr(rustfmt, rustfmt_skip)]
43+
#[rustfmt::skip]
4244
fn test_empty_line() {
4345
assert_eq!("\
4446
if x {

0 commit comments

Comments
 (0)