Skip to content

Commit d722489

Browse files
authored
Merge pull request #2823 from flip1995/thingies_things
Replace cfg_attr(rustfmt... with rustfmt::skip
2 parents b109e10 + 12f2d61 commit d722489

8 files changed

+20
-15
lines changed

clippy_lints/src/lib.rs

+2-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
#![warn(rust_2018_idioms)]
1617

@@ -181,7 +182,7 @@ pub fn register_pre_expansion_lints(session: &rustc::session::Session, store: &m
181182
store.register_pre_expansion_pass(Some(session), box redundant_field_names::RedundantFieldNames);
182183
}
183184

184-
#[cfg_attr(rustfmt, rustfmt_skip)]
185+
#[rustfmt::skip]
185186
pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>) {
186187
let conf = match utils::conf::file_from_args(reg.args()) {
187188
Ok(file_name) => {

clippy_lints/src/loops.rs

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

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

clippy_lints/src/matches.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MatchPass {
199199
}
200200
}
201201

202-
#[cfg_attr(rustfmt, rustfmt_skip)]
202+
#[rustfmt::skip]
203203
fn check_single_match(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm], expr: &Expr) {
204204
if arms.len() == 2 &&
205205
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
@@ -1963,7 +1963,7 @@ enum Convention {
19631963
StartsWith(&'static str),
19641964
}
19651965

1966-
#[cfg_attr(rustfmt, rustfmt_skip)]
1966+
#[rustfmt::skip]
19671967
const CONVENTIONS: [(Convention, &[SelfKind]); 6] = [
19681968
(Convention::Eq("new"), &[SelfKind::No]),
19691969
(Convention::StartsWith("as_"), &[SelfKind::Ref, SelfKind::RefMut]),
@@ -1973,7 +1973,7 @@ const CONVENTIONS: [(Convention, &[SelfKind]); 6] = [
19731973
(Convention::StartsWith("to_"), &[SelfKind::Ref]),
19741974
];
19751975

1976-
#[cfg_attr(rustfmt, rustfmt_skip)]
1976+
#[rustfmt::skip]
19771977
const TRAIT_METHODS: [(&str, usize, SelfKind, OutType, &str); 30] = [
19781978
("add", 2, SelfKind::Value, OutType::Any, "std::ops::Add"),
19791979
("as_mut", 1, SelfKind::RefMut, OutType::Ref, "std::convert::AsMut"),
@@ -2007,7 +2007,7 @@ const TRAIT_METHODS: [(&str, usize, SelfKind, OutType, &str); 30] = [
20072007
("sub", 2, SelfKind::Value, OutType::Any, "std::ops::Sub"),
20082008
];
20092009

2010-
#[cfg_attr(rustfmt, rustfmt_skip)]
2010+
#[rustfmt::skip]
20112011
const PATTERN_METHODS: [(&str, usize); 17] = [
20122012
("contains", 1),
20132013
("starts_with", 1),

clippy_lints/src/new_without_default.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
158158
}
159159

160160
fn create_new_without_default_suggest_msg(ty: Ty<'_>) -> String {
161-
#[cfg_attr(rustfmt, rustfmt_skip)]
161+
#[rustfmt::skip]
162162
format!(
163163
"impl Default for {} {{
164164
fn default() -> Self {{

clippy_lints/src/non_expressive_names.rs

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

9090
// this list contains lists of names that are allowed to be similar
9191
// the assumption is that no name is ever contained in multiple lists.
92-
#[cfg_attr(rustfmt, rustfmt_skip)]
92+
#[rustfmt::skip]
9393
const WHITELIST: &[&[&str]] = &[
9494
&["parsed", "parser"],
9595
&["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)