mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
Merge pull request #2823 from flip1995/thingies_things
Replace cfg_attr(rustfmt... with rustfmt::skip
This commit is contained in:
commit
d722489e71
8 changed files with 20 additions and 15 deletions
|
@ -11,6 +11,7 @@
|
|||
#![allow(stable_features)]
|
||||
#![feature(iterator_find_map)]
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
#![feature(tool_attributes)]
|
||||
#![feature(rust_2018_preview)]
|
||||
#![warn(rust_2018_idioms)]
|
||||
|
||||
|
@ -181,7 +182,7 @@ pub fn register_pre_expansion_lints(session: &rustc::session::Session, store: &m
|
|||
store.register_pre_expansion_pass(Some(session), box redundant_field_names::RedundantFieldNames);
|
||||
}
|
||||
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>) {
|
||||
let conf = match utils::conf::file_from_args(reg.args()) {
|
||||
Ok(file_name) => {
|
||||
|
|
|
@ -1787,7 +1787,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarUsedAfterLoopVisitor<'a, 'tcx> {
|
|||
|
||||
/// Return true if the type of expr is one that provides `IntoIterator` impls
|
||||
/// for `&T` and `&mut T`, such as `Vec`.
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
fn is_ref_iterable_type(cx: &LateContext<'_, '_>, e: &Expr) -> bool {
|
||||
// no walk_ptrs_ty: calling iter() on a reference can make sense because it
|
||||
// will allow further borrows afterwards
|
||||
|
|
|
@ -199,7 +199,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MatchPass {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
fn check_single_match(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm], expr: &Expr) {
|
||||
if arms.len() == 2 &&
|
||||
arms[0].pats.len() == 1 && arms[0].guard.is_none() &&
|
||||
|
|
|
@ -1963,7 +1963,7 @@ enum Convention {
|
|||
StartsWith(&'static str),
|
||||
}
|
||||
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
const CONVENTIONS: [(Convention, &[SelfKind]); 6] = [
|
||||
(Convention::Eq("new"), &[SelfKind::No]),
|
||||
(Convention::StartsWith("as_"), &[SelfKind::Ref, SelfKind::RefMut]),
|
||||
|
@ -1973,7 +1973,7 @@ const CONVENTIONS: [(Convention, &[SelfKind]); 6] = [
|
|||
(Convention::StartsWith("to_"), &[SelfKind::Ref]),
|
||||
];
|
||||
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
const TRAIT_METHODS: [(&str, usize, SelfKind, OutType, &str); 30] = [
|
||||
("add", 2, SelfKind::Value, OutType::Any, "std::ops::Add"),
|
||||
("as_mut", 1, SelfKind::RefMut, OutType::Ref, "std::convert::AsMut"),
|
||||
|
@ -2007,7 +2007,7 @@ const TRAIT_METHODS: [(&str, usize, SelfKind, OutType, &str); 30] = [
|
|||
("sub", 2, SelfKind::Value, OutType::Any, "std::ops::Sub"),
|
||||
];
|
||||
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
const PATTERN_METHODS: [(&str, usize); 17] = [
|
||||
("contains", 1),
|
||||
("starts_with", 1),
|
||||
|
|
|
@ -158,7 +158,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
|
|||
}
|
||||
|
||||
fn create_new_without_default_suggest_msg(ty: Ty<'_>) -> String {
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
format!(
|
||||
"impl Default for {} {{
|
||||
fn default() -> Self {{
|
||||
|
|
|
@ -89,7 +89,7 @@ struct SimilarNamesLocalVisitor<'a, 'tcx: 'a> {
|
|||
|
||||
// this list contains lists of names that are allowed to be similar
|
||||
// the assumption is that no name is ever contained in multiple lists.
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
const WHITELIST: &[&[&str]] = &[
|
||||
&["parsed", "parser"],
|
||||
&["lhs", "rhs"],
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![feature(tool_attributes)]
|
||||
|
||||
// Tests for the various helper functions used by the needless_continue
|
||||
// lint that don't belong in utils.
|
||||
|
||||
|
@ -5,7 +7,7 @@ extern crate clippy_lints;
|
|||
use clippy_lints::needless_continue::{erode_block, erode_from_back, erode_from_front};
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
fn test_erode_from_back() {
|
||||
let input = "\
|
||||
{
|
||||
|
@ -23,7 +25,7 @@ fn test_erode_from_back() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
fn test_erode_from_back_no_brace() {
|
||||
let input = "\
|
||||
let x = 5;
|
||||
|
@ -35,7 +37,7 @@ let y = something();
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
fn test_erode_from_front() {
|
||||
let input = "
|
||||
{
|
||||
|
@ -54,7 +56,7 @@ fn test_erode_from_front() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
fn test_erode_from_front_no_brace() {
|
||||
let input = "
|
||||
something();
|
||||
|
@ -70,7 +72,7 @@ fn test_erode_from_front_no_brace() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
fn test_erode_block() {
|
||||
|
||||
let input = "
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![feature(tool_attributes)]
|
||||
|
||||
/// test the multiline-trim function
|
||||
extern crate clippy_lints;
|
||||
|
||||
|
@ -13,7 +15,7 @@ fn test_single_line() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
fn test_block() {
|
||||
assert_eq!("\
|
||||
if x {
|
||||
|
@ -38,7 +40,7 @@ if x {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
fn test_empty_line() {
|
||||
assert_eq!("\
|
||||
if x {
|
||||
|
|
Loading…
Reference in a new issue