From 1b6f6051a8b62f966d28d63fe3c3637a29c410a4 Mon Sep 17 00:00:00 2001 From: flip1995 <9744647+flip1995@users.noreply.github.com> Date: Sat, 28 Jul 2018 17:34:52 +0200 Subject: [PATCH] Adapt ui-tests to the tool_lints --- tests/ui/absurd-extreme-comparisons.rs | 8 +++--- tests/ui/approx_const.rs | 6 ++--- tests/ui/arithmetic.rs | 6 ++--- tests/ui/assign_ops.rs | 4 ++- tests/ui/assign_ops2.rs | 4 +-- tests/ui/attrs.rs | 4 +-- tests/ui/bit_masks.rs | 10 +++---- tests/ui/blacklisted_name.rs | 6 ++--- tests/ui/block_in_if_condition.rs | 10 +++---- tests/ui/bool_comparison.rs | 4 +-- tests/ui/booleans.rs | 14 +++++----- tests/ui/borrow_box.rs | 6 ++--- tests/ui/box_vec.rs | 8 +++--- tests/ui/builtin-type-shadow.rs | 4 +-- tests/ui/bytecount.rs | 4 +-- tests/ui/cast.rs | 18 ++++++------- tests/ui/cast_alignment.rs | 6 +++-- tests/ui/cast_lossless_float.rs | 8 +++--- tests/ui/cast_lossless_integer.rs | 8 +++--- tests/ui/cast_size.rs | 6 +++-- tests/ui/char_lit_as_u8.rs | 4 +-- tests/ui/checked_unwrap.rs | 6 +++-- tests/ui/clone_on_copy_mut.rs | 4 ++- tests/ui/cmp_nan.rs | 6 ++--- tests/ui/cmp_null.rs | 4 +-- tests/ui/cmp_owned.rs | 6 ++--- tests/ui/collapsible_if.rs | 4 +-- tests/ui/complex_types.rs | 6 ++--- tests/ui/copies.rs | 14 +++++----- tests/ui/copy_iterator.rs | 4 ++- tests/ui/cstring.rs | 4 ++- tests/ui/cyclomatic_complexity.rs | 8 +++--- tests/ui/cyclomatic_complexity_attr_used.rs | 4 +-- tests/ui/decimal_literal_representation.rs | 4 +-- tests/ui/default_trait_access.rs | 4 ++- tests/ui/derive.rs | 4 +-- tests/ui/diverging_sub_expression.rs | 10 ++++--- tests/ui/dlist.rs | 6 +++-- tests/ui/doc.rs | 6 +++-- tests/ui/double_neg.rs | 4 +-- tests/ui/double_parens.rs | 4 +-- tests/ui/drop_forget_copy.rs | 6 ++--- tests/ui/drop_forget_ref.rs | 6 ++--- tests/ui/duplicate_underscore_argument.rs | 4 +-- tests/ui/duration_subsec.rs | 4 ++- tests/ui/else_if_without_else.rs | 6 +++-- tests/ui/empty_enum.rs | 4 +-- tests/ui/empty_line_after_outer_attribute.rs | 4 +-- tests/ui/entry.rs | 6 ++--- tests/ui/enum_glob_use.rs | 6 ++--- tests/ui/enum_variants.rs | 6 +++-- tests/ui/enums_clike.rs | 4 ++- tests/ui/eq_op.rs | 10 +++---- tests/ui/erasing_op.rs | 6 ++--- tests/ui/eta.rs | 6 ++--- tests/ui/eval_order_dependence.rs | 6 ++--- tests/ui/excessive_precision.rs | 6 ++--- tests/ui/explicit_write.rs | 4 ++- tests/ui/fallible_impl_from.rs | 4 ++- tests/ui/filter_methods.rs | 6 ++--- tests/ui/float_cmp.rs | 6 ++--- tests/ui/float_cmp_const.rs | 10 +++---- tests/ui/for_loop.rs | 24 ++++++++--------- tests/ui/format.rs | 6 ++--- tests/ui/formatting.rs | 8 +++--- tests/ui/functions.rs | 4 +-- tests/ui/fxhash.rs | 4 ++- tests/ui/identity_conversion.rs | 6 +++-- tests/ui/identity_op.rs | 6 ++--- tests/ui/if_let_redundant_pattern_matching.rs | 6 ++--- tests/ui/if_not_else.rs | 6 ++--- tests/ui/impl.rs | 4 ++- tests/ui/inconsistent_digit_grouping.rs | 4 +-- tests/ui/indexing_slicing.rs | 8 +++--- tests/ui/infallible_destructuring_match.rs | 4 ++- tests/ui/infinite_iter.rs | 10 +++---- tests/ui/infinite_loop.rs | 6 +++-- tests/ui/inline_fn_without_body.rs | 6 ++--- tests/ui/int_plus_one.rs | 6 ++--- tests/ui/invalid_upcast_comparisons.rs | 6 ++--- tests/ui/issue_2356.rs | 4 ++- tests/ui/item_after_statement.rs | 4 +-- tests/ui/large_digit_groups.rs | 4 +-- tests/ui/large_enum_variant.rs | 4 +-- tests/ui/len_zero.rs | 6 +++-- tests/ui/let_if_seq.rs | 6 ++--- tests/ui/let_return.rs | 6 ++--- tests/ui/let_unit.rs | 4 +-- tests/ui/lifetimes.rs | 6 ++--- tests/ui/literals.rs | 8 +++--- tests/ui/map_clone.rs | 6 ++--- tests/ui/matches.rs | 8 +++--- tests/ui/mem_forget.rs | 6 ++--- tests/ui/methods.rs | 14 +++++----- tests/ui/min_max.rs | 4 +-- tests/ui/missing-doc.rs | 22 +++++++++------- tests/ui/missing_inline.rs | 6 +++-- tests/ui/module_inception.rs | 6 ++--- tests/ui/modulo_one.rs | 6 ++--- tests/ui/mut_from_ref.rs | 6 ++--- tests/ui/mut_mut.rs | 6 ++--- tests/ui/mut_reference.rs | 6 ++--- tests/ui/mutex_atomic.rs | 6 ++--- tests/ui/needless_bool.rs | 18 ++++++------- tests/ui/needless_borrow.rs | 8 +++--- tests/ui/needless_borrowed_ref.rs | 4 +-- tests/ui/needless_continue.rs | 4 +-- tests/ui/needless_pass_by_value.rs | 6 +++-- tests/ui/needless_pass_by_value_proc_macro.rs | 4 +-- tests/ui/needless_return.rs | 4 +-- tests/ui/needless_update.rs | 6 ++--- tests/ui/neg_cmp_op_on_partial_ord.rs | 4 ++- tests/ui/neg_multiply.rs | 6 ++--- tests/ui/never_loop.rs | 6 ++--- tests/ui/new_without_default.rs | 4 ++- tests/ui/no_effect.rs | 8 +++--- tests/ui/non_copy_const.rs | 6 +++-- tests/ui/non_expressive_names.rs | 6 ++--- tests/ui/ok_if_let.rs | 4 +-- tests/ui/op_ref.rs | 4 +-- tests/ui/open_options.rs | 4 +-- tests/ui/option_map_unit_fn.rs | 4 ++- tests/ui/overflow_check_conditional.rs | 6 ++--- tests/ui/panic_unimplemented.rs | 4 +-- tests/ui/patterns.rs | 4 +-- tests/ui/precedence.rs | 8 +++--- tests/ui/print.rs | 6 ++--- tests/ui/print_literal.rs | 4 +-- tests/ui/print_with_newline.rs | 6 ++--- tests/ui/ptr_arg.rs | 6 +++-- tests/ui/range.rs | 4 +-- tests/ui/range_plus_minus_one.rs | 4 ++- tests/ui/redundant_closure_call.rs | 4 +-- tests/ui/redundant_field_names.rs | 4 ++- tests/ui/reference.rs | 10 +++---- tests/ui/regex.rs | 4 +-- tests/ui/replace_consts.rs | 6 +++-- tests/ui/result_map_unit_fn.rs | 4 ++- tests/ui/serde.rs | 4 +-- tests/ui/shadow.rs | 6 ++--- tests/ui/short_circuit_statement.rs | 4 +-- tests/ui/single_char_pattern.rs | 4 ++- tests/ui/single_match.rs | 4 ++- tests/ui/starts_ends_with.rs | 6 +++-- tests/ui/strings.rs | 12 ++++----- tests/ui/stutter.rs | 4 +-- tests/ui/suspicious_arithmetic_impl.rs | 4 +-- tests/ui/swap.rs | 6 ++--- tests/ui/temporary_assignment.rs | 4 +-- tests/ui/toplevel_ref_arg.rs | 4 +-- tests/ui/transmute.rs | 26 +++++++++---------- tests/ui/transmute_64bit.rs | 4 ++- tests/ui/trivially_copy_pass_by_ref.rs | 8 +++--- tests/ui/unicode.rs | 8 +++--- tests/ui/unit_arg.rs | 6 +++-- tests/ui/unit_cmp.rs | 6 ++--- tests/ui/unnecessary_clone.rs | 6 +++-- tests/ui/unnecessary_ref.rs | 4 ++- tests/ui/unneeded_field_pattern.rs | 4 +-- tests/ui/unreadable_literal.rs | 4 +-- tests/ui/unsafe_removed_from_name.rs | 4 +-- tests/ui/unused_io_amount.rs | 4 +-- tests/ui/unused_labels.rs | 6 ++--- tests/ui/unused_lt.rs | 6 ++--- tests/ui/unwrap_or.rs | 3 ++- tests/ui/use_self.rs | 8 +++--- tests/ui/used_underscore_binding.rs | 8 +++--- tests/ui/useless_asref.rs | 8 +++--- tests/ui/useless_attribute.rs | 4 +-- tests/ui/vec.rs | 6 ++--- tests/ui/while_loop.rs | 8 +++--- tests/ui/write_literal.rs | 4 ++- tests/ui/write_with_newline.rs | 6 +++-- tests/ui/writeln_empty_string.rs | 4 ++- tests/ui/wrong_self_convention.rs | 10 +++---- tests/ui/zero_div_zero.rs | 4 +-- 176 files changed, 597 insertions(+), 486 deletions(-) diff --git a/tests/ui/absurd-extreme-comparisons.rs b/tests/ui/absurd-extreme-comparisons.rs index 8c036e6c072..d08c8008ec9 100644 --- a/tests/ui/absurd-extreme-comparisons.rs +++ b/tests/ui/absurd-extreme-comparisons.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(absurd_extreme_comparisons)] -#![allow(unused, eq_op, no_effect, unnecessary_operation, needless_pass_by_value)] +#![warn(clippy::absurd_extreme_comparisons)] +#![allow(unused, clippy::eq_op, clippy::no_effect, clippy::unnecessary_operation, clippy::needless_pass_by_value)] fn main() { const Z: u32 = 0; @@ -27,7 +27,7 @@ fn main() { b >= true; false > b; u > 0; // ok - // this is handled by unit_cmp + // this is handled by clippy::unit_cmp () < {}; } diff --git a/tests/ui/approx_const.rs b/tests/ui/approx_const.rs index d353d9075d4..46ca2fbfb57 100644 --- a/tests/ui/approx_const.rs +++ b/tests/ui/approx_const.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#[warn(approx_constant)] -#[allow(unused, shadow_unrelated, similar_names, unreadable_literal)] +#[warn(clippy::approx_constant)] +#[allow(unused, clippy::shadow_unrelated, clippy::similar_names, clippy::unreadable_literal)] fn main() { let my_e = 2.7182; let almost_e = 2.718; diff --git a/tests/ui/arithmetic.rs b/tests/ui/arithmetic.rs index 7ed71b59707..e7aa9a18b8a 100644 --- a/tests/ui/arithmetic.rs +++ b/tests/ui/arithmetic.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(integer_arithmetic, float_arithmetic)] -#![allow(unused, shadow_reuse, shadow_unrelated, no_effect, unnecessary_operation)] +#![warn(clippy::integer_arithmetic, clippy::float_arithmetic)] +#![allow(unused, clippy::shadow_reuse, clippy::shadow_unrelated, clippy::no_effect, clippy::unnecessary_operation)] fn main() { let i = 1i32; 1 + i; diff --git a/tests/ui/assign_ops.rs b/tests/ui/assign_ops.rs index 7332b41fa0b..765dbb67990 100644 --- a/tests/ui/assign_ops.rs +++ b/tests/ui/assign_ops.rs @@ -1,5 +1,7 @@ +#![feature(tool_lints)] + #[allow(dead_code, unused_assignments)] -#[warn(assign_op_pattern)] +#[warn(clippy::assign_op_pattern)] fn main() { let mut a = 5; a = a + 1; diff --git a/tests/ui/assign_ops2.rs b/tests/ui/assign_ops2.rs index 2d3adc2a661..c3f5083bb1f 100644 --- a/tests/ui/assign_ops2.rs +++ b/tests/ui/assign_ops2.rs @@ -1,8 +1,8 @@ - +#![feature(tool_lints)] #[allow(unused_assignments)] -#[warn(misrefactored_assign_op, assign_op_pattern)] +#[warn(clippy::misrefactored_assign_op, clippy::assign_op_pattern)] fn main() { let mut a = 5; a += a + 1; diff --git a/tests/ui/attrs.rs b/tests/ui/attrs.rs index eb27b833ade..b1f0ca640aa 100644 --- a/tests/ui/attrs.rs +++ b/tests/ui/attrs.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(inline_always, deprecated_semver)] +#![warn(clippy::inline_always, clippy::deprecated_semver)] #[inline(always)] fn test_attr_lint() { diff --git a/tests/ui/bit_masks.rs b/tests/ui/bit_masks.rs index 4843b4eba0d..4111f344b66 100644 --- a/tests/ui/bit_masks.rs +++ b/tests/ui/bit_masks.rs @@ -1,11 +1,11 @@ - +#![feature(tool_lints)] const THREE_BITS : i64 = 7; const EVEN_MORE_REDIRECTION : i64 = THREE_BITS; -#[warn(bad_bit_mask)] -#[allow(ineffective_bit_mask, identity_op, no_effect, unnecessary_operation)] +#[warn(clippy::bad_bit_mask)] +#[allow(clippy::ineffective_bit_mask, clippy::identity_op, clippy::no_effect, clippy::unnecessary_operation)] fn main() { let x = 5; @@ -44,8 +44,8 @@ fn main() { ineffective(); } -#[warn(ineffective_bit_mask)] -#[allow(bad_bit_mask, no_effect, unnecessary_operation)] +#[warn(clippy::ineffective_bit_mask)] +#[allow(clippy::bad_bit_mask, clippy::no_effect, clippy::unnecessary_operation)] fn ineffective() { let x = 5; diff --git a/tests/ui/blacklisted_name.rs b/tests/ui/blacklisted_name.rs index 7baeb7bb75c..4e2e5388c98 100644 --- a/tests/ui/blacklisted_name.rs +++ b/tests/ui/blacklisted_name.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![allow(dead_code, similar_names, single_match, toplevel_ref_arg, unused_mut, unused_variables)] -#![warn(blacklisted_name)] +#![allow(dead_code, clippy::similar_names, clippy::single_match, clippy::toplevel_ref_arg, unused_mut, unused_variables)] +#![warn(clippy::blacklisted_name)] fn test(foo: ()) {} diff --git a/tests/ui/block_in_if_condition.rs b/tests/ui/block_in_if_condition.rs index 9e65a127af2..dd0e5503437 100644 --- a/tests/ui/block_in_if_condition.rs +++ b/tests/ui/block_in_if_condition.rs @@ -1,10 +1,10 @@ +#![feature(tool_lints)] - -#![warn(block_in_if_condition_expr)] -#![warn(block_in_if_condition_stmt)] -#![allow(unused, let_and_return)] -#![warn(nonminimal_bool)] +#![warn(clippy::block_in_if_condition_expr)] +#![warn(clippy::block_in_if_condition_stmt)] +#![allow(unused, clippy::let_and_return)] +#![warn(clippy::nonminimal_bool)] macro_rules! blocky { diff --git a/tests/ui/bool_comparison.rs b/tests/ui/bool_comparison.rs index f05b9894fea..144f9f4c631 100644 --- a/tests/ui/bool_comparison.rs +++ b/tests/ui/bool_comparison.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#[warn(bool_comparison)] +#[warn(clippy::bool_comparison)] fn main() { let x = true; if x == true { "yes" } else { "no" }; diff --git a/tests/ui/booleans.rs b/tests/ui/booleans.rs index fc16c12af28..eaa686c9a90 100644 --- a/tests/ui/booleans.rs +++ b/tests/ui/booleans.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] +#![warn(clippy::nonminimal_bool, clippy::logic_bug)] -#![warn(nonminimal_bool, logic_bug)] - -#[allow(unused, many_single_char_names)] +#[allow(unused, clippy::many_single_char_names)] fn main() { let a: bool = unimplemented!(); let b: bool = unimplemented!(); @@ -23,7 +23,7 @@ fn main() { let _ = !(!a && b); } -#[allow(unused, many_single_char_names)] +#[allow(unused, clippy::many_single_char_names)] fn equality_stuff() { let a: i32 = unimplemented!(); let b: i32 = unimplemented!(); @@ -39,7 +39,7 @@ fn equality_stuff() { let _ = a != b || !(a != b || c == d); } -#[allow(unused, many_single_char_names)] +#[allow(unused, clippy::many_single_char_names)] fn methods_with_negation() { let a: Option = unimplemented!(); let b: Result = unimplemented!(); @@ -59,7 +59,7 @@ fn methods_with_negation() { } // Simplified versions of https://github.com/rust-lang-nursery/rust-clippy/issues/2638 -// nonminimal_bool should only check the built-in Result and Some type, not +// clippy::nonminimal_bool should only check the built-in Result and Some type, not // any other types like the following. enum CustomResultOk { Ok, Err(E) } enum CustomResultErr { Ok, Err(E) } @@ -115,7 +115,7 @@ fn warn_for_built_in_methods_with_negation() { if !res.is_none() { } } -#[allow(neg_cmp_op_on_partial_ord)] +#[allow(clippy::neg_cmp_op_on_partial_ord)] fn dont_warn_for_negated_partial_ord_comparison() { let a: f64 = unimplemented!(); let b: f64 = unimplemented!(); diff --git a/tests/ui/borrow_box.rs b/tests/ui/borrow_box.rs index 394b810ed86..216dbebda67 100644 --- a/tests/ui/borrow_box.rs +++ b/tests/ui/borrow_box.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![deny(borrowed_box)] -#![allow(blacklisted_name)] +#![deny(clippy::borrowed_box)] +#![allow(clippy::blacklisted_name)] #![allow(unused_variables)] #![allow(dead_code)] diff --git a/tests/ui/box_vec.rs b/tests/ui/box_vec.rs index 75b3b62643e..bc5e8361d8b 100644 --- a/tests/ui/box_vec.rs +++ b/tests/ui/box_vec.rs @@ -1,9 +1,9 @@ +#![feature(tool_lints)] - -#![warn(clippy)] -#![allow(boxed_local, needless_pass_by_value)] -#![allow(blacklisted_name)] +#![warn(clippy::all)] +#![allow(clippy::boxed_local, clippy::needless_pass_by_value)] +#![allow(clippy::blacklisted_name)] macro_rules! boxit { ($init:expr, $x:ty) => { diff --git a/tests/ui/builtin-type-shadow.rs b/tests/ui/builtin-type-shadow.rs index 4c4f5cbd3fe..56892fc9483 100644 --- a/tests/ui/builtin-type-shadow.rs +++ b/tests/ui/builtin-type-shadow.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![warn(builtin_type_shadow)] +#![warn(clippy::builtin_type_shadow)] fn foo(a: u32) -> u32 { 42 diff --git a/tests/ui/bytecount.rs b/tests/ui/bytecount.rs index fc94667d968..7211284e4a0 100644 --- a/tests/ui/bytecount.rs +++ b/tests/ui/bytecount.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#[deny(naive_bytecount)] +#[deny(clippy::naive_bytecount)] fn main() { let x = vec![0_u8; 16]; diff --git a/tests/ui/cast.rs b/tests/ui/cast.rs index 833e5a55780..0668b16ff32 100644 --- a/tests/ui/cast.rs +++ b/tests/ui/cast.rs @@ -1,17 +1,17 @@ +#![feature(tool_lints)] - -#[warn(cast_precision_loss, cast_possible_truncation, cast_sign_loss, cast_possible_wrap, cast_lossless)] -#[allow(no_effect, unnecessary_operation)] +#[warn(clippy::cast_precision_loss, clippy::cast_possible_truncation, clippy::cast_sign_loss, clippy::cast_possible_wrap, clippy::cast_lossless)] +#[allow(clippy::no_effect, clippy::unnecessary_operation)] fn main() { - // Test cast_precision_loss + // Test clippy::cast_precision_loss 1i32 as f32; 1i64 as f32; 1i64 as f64; 1u32 as f32; 1u64 as f32; 1u64 as f64; - // Test cast_possible_truncation + // Test clippy::cast_possible_truncation 1f32 as i32; 1f32 as u32; 1f64 as f32; @@ -19,17 +19,17 @@ fn main() { 1i32 as u8; 1f64 as isize; 1f64 as usize; - // Test cast_possible_wrap + // Test clippy::cast_possible_wrap 1u8 as i8; 1u16 as i16; 1u32 as i32; 1u64 as i64; 1usize as isize; - // Test cast_lossless with casts from floating-point types + // Test clippy::cast_lossless with casts from floating-point types 1.0f32 as f64; - // Test cast_lossless with an expression wrapped in parens + // Test clippy::cast_lossless with an expression wrapped in parens (1u8 + 1u8) as u16; - // Test cast_sign_loss + // Test clippy::cast_sign_loss 1i32 as u32; 1isize as usize; // Extra checks for *size diff --git a/tests/ui/cast_alignment.rs b/tests/ui/cast_alignment.rs index 32e2f93169e..1f7606de649 100644 --- a/tests/ui/cast_alignment.rs +++ b/tests/ui/cast_alignment.rs @@ -1,11 +1,13 @@ +#![feature(tool_lints)] + //! Test casts for alignment issues #![feature(libc)] extern crate libc; -#[warn(cast_ptr_alignment)] -#[allow(no_effect, unnecessary_operation, cast_lossless)] +#[warn(clippy::cast_ptr_alignment)] +#[allow(clippy::no_effect, clippy::unnecessary_operation, clippy::cast_lossless)] fn main() { /* These should be warned against */ diff --git a/tests/ui/cast_lossless_float.rs b/tests/ui/cast_lossless_float.rs index 9e61059b630..437c4b67120 100644 --- a/tests/ui/cast_lossless_float.rs +++ b/tests/ui/cast_lossless_float.rs @@ -1,7 +1,9 @@ -#[warn(cast_lossless)] -#[allow(no_effect, unnecessary_operation)] +#![feature(tool_lints)] + +#[warn(clippy::cast_lossless)] +#[allow(clippy::no_effect, clippy::unnecessary_operation)] fn main() { - // Test cast_lossless with casts to floating-point types + // Test clippy::cast_lossless with casts to floating-point types 1i8 as f32; 1i8 as f64; 1u8 as f32; diff --git a/tests/ui/cast_lossless_integer.rs b/tests/ui/cast_lossless_integer.rs index 5f89d057c33..e06e653c6f5 100644 --- a/tests/ui/cast_lossless_integer.rs +++ b/tests/ui/cast_lossless_integer.rs @@ -1,8 +1,8 @@ - -#[warn(cast_lossless)] -#[allow(no_effect, unnecessary_operation)] +#![feature(tool_lints)] +#[warn(clippy::cast_lossless)] +#[allow(clippy::no_effect, clippy::unnecessary_operation)] fn main() { - // Test cast_lossless with casts to integer types + // Test clippy::cast_lossless with casts to integer types 1i8 as i16; 1i8 as i32; 1i8 as i64; diff --git a/tests/ui/cast_size.rs b/tests/ui/cast_size.rs index d0bef860c70..4c72f57165c 100644 --- a/tests/ui/cast_size.rs +++ b/tests/ui/cast_size.rs @@ -1,5 +1,7 @@ -#[warn(cast_precision_loss, cast_possible_truncation, cast_sign_loss, cast_possible_wrap, cast_lossless)] -#[allow(no_effect, unnecessary_operation)] +#![feature(tool_lints)] + +#[warn(clippy::cast_precision_loss, clippy::cast_possible_truncation, clippy::cast_sign_loss, clippy::cast_possible_wrap, clippy::cast_lossless)] +#[allow(clippy::no_effect, clippy::unnecessary_operation)] fn main() { // Casting from *size 1isize as i8; diff --git a/tests/ui/char_lit_as_u8.rs b/tests/ui/char_lit_as_u8.rs index c69181c7649..f9937ede351 100644 --- a/tests/ui/char_lit_as_u8.rs +++ b/tests/ui/char_lit_as_u8.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(char_lit_as_u8)] +#![warn(clippy::char_lit_as_u8)] #![allow(unused_variables)] fn main() { let c = 'a' as u8; diff --git a/tests/ui/checked_unwrap.rs b/tests/ui/checked_unwrap.rs index 2b5118fa814..b3979245d36 100644 --- a/tests/ui/checked_unwrap.rs +++ b/tests/ui/checked_unwrap.rs @@ -1,5 +1,7 @@ -#![deny(panicking_unwrap, unnecessary_unwrap)] -#![allow(if_same_then_else)] +#![feature(tool_lints)] + +#![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)] +#![allow(clippy::if_same_then_else)] fn main() { let x = Some(()); diff --git a/tests/ui/clone_on_copy_mut.rs b/tests/ui/clone_on_copy_mut.rs index 5b491573c3f..77dffc67670 100644 --- a/tests/ui/clone_on_copy_mut.rs +++ b/tests/ui/clone_on_copy_mut.rs @@ -1,3 +1,5 @@ +#![feature(tool_lints)] + pub fn dec_read_dec(i: &mut i32) -> i32 { *i -= 1; let ret = *i; @@ -5,7 +7,7 @@ pub fn dec_read_dec(i: &mut i32) -> i32 { ret } -#[allow(trivially_copy_pass_by_ref)] +#[allow(clippy::trivially_copy_pass_by_ref)] pub fn minus_1(i: &i32) -> i32 { dec_read_dec(&mut i.clone()) } diff --git a/tests/ui/cmp_nan.rs b/tests/ui/cmp_nan.rs index 71dfdd43da7..fdebb7da18a 100644 --- a/tests/ui/cmp_nan.rs +++ b/tests/ui/cmp_nan.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#[warn(cmp_nan)] -#[allow(float_cmp, no_effect, unnecessary_operation)] +#[warn(clippy::cmp_nan)] +#[allow(clippy::float_cmp, clippy::no_effect, clippy::unnecessary_operation)] fn main() { let x = 5f32; x == std::f32::NAN; diff --git a/tests/ui/cmp_null.rs b/tests/ui/cmp_null.rs index 0f463bcfc30..e10b3e104ec 100644 --- a/tests/ui/cmp_null.rs +++ b/tests/ui/cmp_null.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![warn(cmp_null)] +#![warn(clippy::cmp_null)] #![allow(unused_mut)] use std::ptr; diff --git a/tests/ui/cmp_owned.rs b/tests/ui/cmp_owned.rs index 36d3140d246..713975c4404 100644 --- a/tests/ui/cmp_owned.rs +++ b/tests/ui/cmp_owned.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#[warn(cmp_owned)] -#[allow(unnecessary_operation)] +#[warn(clippy::cmp_owned)] +#[allow(clippy::unnecessary_operation)] fn main() { fn with_to_string(x : &str) { x != "foo".to_string(); diff --git a/tests/ui/collapsible_if.rs b/tests/ui/collapsible_if.rs index de22352e311..d40be631933 100644 --- a/tests/ui/collapsible_if.rs +++ b/tests/ui/collapsible_if.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#[warn(collapsible_if)] +#[warn(clippy::collapsible_if)] fn main() { let x = "hello"; let y = "world"; diff --git a/tests/ui/complex_types.rs b/tests/ui/complex_types.rs index 7719a7a8632..a6875793c83 100644 --- a/tests/ui/complex_types.rs +++ b/tests/ui/complex_types.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(clippy)] -#![allow(unused, needless_pass_by_value)] +#![warn(clippy::all)] +#![allow(unused, clippy::needless_pass_by_value)] #![feature(associated_type_defaults)] type Alias = Vec>>; // no warning here diff --git a/tests/ui/copies.rs b/tests/ui/copies.rs index 65a565c68ec..064c7fc1c59 100644 --- a/tests/ui/copies.rs +++ b/tests/ui/copies.rs @@ -1,5 +1,7 @@ -#![allow(blacklisted_name, collapsible_if, cyclomatic_complexity, eq_op, needless_continue, - needless_return, never_loop, no_effect, zero_divided_by_zero)] +#![feature(tool_lints)] + +#![allow(clippy::blacklisted_name, clippy::collapsible_if, clippy::cyclomatic_complexity, clippy::eq_op, clippy::needless_continue, + clippy::needless_return, clippy::never_loop, clippy::no_effect, clippy::zero_divided_by_zero)] fn bar(_: T) {} fn foo() -> bool { unimplemented!() } @@ -14,8 +16,8 @@ pub enum Abc { C, } -#[warn(if_same_then_else)] -#[warn(match_same_arms)] +#[warn(clippy::if_same_then_else)] +#[warn(clippy::match_same_arms)] fn if_same_then_else() -> Result<&'static str, ()> { if true { Foo { bar: 42 }; @@ -340,8 +342,8 @@ fn if_same_then_else() -> Result<&'static str, ()> { } } -#[warn(ifs_same_cond)] -#[allow(if_same_then_else)] // all empty blocks +#[warn(clippy::ifs_same_cond)] +#[allow(clippy::if_same_then_else)] // all empty blocks fn ifs_same_cond() { let a = 0; let b = false; diff --git a/tests/ui/copy_iterator.rs b/tests/ui/copy_iterator.rs index 1b65cc4f8cc..5ccb9910c1e 100644 --- a/tests/ui/copy_iterator.rs +++ b/tests/ui/copy_iterator.rs @@ -1,4 +1,6 @@ -#![warn(copy_iterator)] +#![feature(tool_lints)] + +#![warn(clippy::copy_iterator)] #[derive(Copy, Clone)] struct Countdown(u8); diff --git a/tests/ui/cstring.rs b/tests/ui/cstring.rs index 8b7b0b66bc6..e68874d5409 100644 --- a/tests/ui/cstring.rs +++ b/tests/ui/cstring.rs @@ -1,6 +1,8 @@ +#![feature(tool_lints)] + fn main() {} -#[allow(result_unwrap_used)] +#[allow(clippy::result_unwrap_used)] fn temporary_cstring() { use std::ffi::CString; diff --git a/tests/ui/cyclomatic_complexity.rs b/tests/ui/cyclomatic_complexity.rs index 7166ed25948..84e2a1b6583 100644 --- a/tests/ui/cyclomatic_complexity.rs +++ b/tests/ui/cyclomatic_complexity.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![allow(clippy)] -#![warn(cyclomatic_complexity)] +#![allow(clippy::all)] +#![warn(clippy::cyclomatic_complexity)] #![allow(unused)] fn main() { @@ -172,7 +172,7 @@ fn bar() { #[test] #[clippy::cyclomatic_complexity = "0"] -/// Tests are usually complex but simple at the same time. `cyclomatic_complexity` used to give +/// Tests are usually complex but simple at the same time. `clippy::cyclomatic_complexity` used to give /// lots of false-positives in tests. fn dont_warn_on_tests() { match 99 { diff --git a/tests/ui/cyclomatic_complexity_attr_used.rs b/tests/ui/cyclomatic_complexity_attr_used.rs index dbd4e438a12..fd8be25e670 100644 --- a/tests/ui/cyclomatic_complexity_attr_used.rs +++ b/tests/ui/cyclomatic_complexity_attr_used.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![warn(cyclomatic_complexity)] +#![warn(clippy::cyclomatic_complexity)] #![warn(unused)] fn main() { diff --git a/tests/ui/decimal_literal_representation.rs b/tests/ui/decimal_literal_representation.rs index 5463b8957f3..472ea618571 100644 --- a/tests/ui/decimal_literal_representation.rs +++ b/tests/ui/decimal_literal_representation.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#[warn(decimal_literal_representation)] +#[warn(clippy::decimal_literal_representation)] #[allow(unused_variables)] fn main() { let good = ( // Hex: diff --git a/tests/ui/default_trait_access.rs b/tests/ui/default_trait_access.rs index 675e64246fa..ba8886cd6a4 100644 --- a/tests/ui/default_trait_access.rs +++ b/tests/ui/default_trait_access.rs @@ -1,4 +1,6 @@ -#![warn(default_trait_access)] +#![feature(tool_lints)] + +#![warn(clippy::default_trait_access)] use std::default::Default as D2; use std::string; diff --git a/tests/ui/derive.rs b/tests/ui/derive.rs index f43b8c382a4..ae54c0290bc 100644 --- a/tests/ui/derive.rs +++ b/tests/ui/derive.rs @@ -1,9 +1,9 @@ - +#![feature(tool_lints)] #![feature(untagged_unions)] #![allow(dead_code)] -#![warn(expl_impl_clone_on_copy)] +#![warn(clippy::expl_impl_clone_on_copy)] use std::hash::{Hash, Hasher}; diff --git a/tests/ui/diverging_sub_expression.rs b/tests/ui/diverging_sub_expression.rs index b89a2f1bcaf..a8284dca326 100644 --- a/tests/ui/diverging_sub_expression.rs +++ b/tests/ui/diverging_sub_expression.rs @@ -1,9 +1,11 @@ +#![feature(tool_lints)] + #![feature(never_type)] -#![warn(diverging_sub_expression)] -#![allow(match_same_arms, logic_bug)] +#![warn(clippy::diverging_sub_expression)] +#![allow(clippy::match_same_arms, clippy::logic_bug)] -#[allow(empty_loop)] +#[allow(clippy::empty_loop)] fn diverge() -> ! { loop {} } struct A; @@ -12,7 +14,7 @@ impl A { fn foo(&self) -> ! { diverge() } } -#[allow(unused_variables, unnecessary_operation, short_circuit_statement)] +#[allow(unused_variables, clippy::unnecessary_operation, clippy::short_circuit_statement)] fn main() { let b = true; b || diverge(); diff --git a/tests/ui/dlist.rs b/tests/ui/dlist.rs index 1318ed78717..395ff217497 100644 --- a/tests/ui/dlist.rs +++ b/tests/ui/dlist.rs @@ -1,9 +1,11 @@ +#![feature(tool_lints)] + #![feature(alloc)] #![feature(associated_type_defaults)] -#![warn(linkedlist)] -#![allow(dead_code, needless_pass_by_value)] +#![warn(clippy::linkedlist)] +#![allow(dead_code, clippy::needless_pass_by_value)] extern crate alloc; use alloc::collections::linked_list::LinkedList; diff --git a/tests/ui/doc.rs b/tests/ui/doc.rs index 45e25409b12..d48007a9347 100644 --- a/tests/ui/doc.rs +++ b/tests/ui/doc.rs @@ -1,9 +1,11 @@ +#![feature(tool_lints)] + //! This file tests for the DOC_MARKDOWN lint #![allow(dead_code)] -#![warn(doc_markdown)] +#![warn(clippy::doc_markdown)] /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there) /// Markdown is _weird_. I mean _really weird_. This \_ is ok. So is `_`. But not Foo::some_fun @@ -50,7 +52,7 @@ fn test_units() { } /// This test has [a link_with_underscores][chunked-example] inside it. See #823. -/// See also [the issue tracker](https://github.com/rust-lang-nursery/rust-clippy/search?q=doc_markdown&type=Issues) +/// See also [the issue tracker](https://github.com/rust-lang-nursery/rust-clippy/search?q=clippy::doc_markdown&type=Issues) /// on GitHub (which is a camel-cased word, but is OK). And here is another [inline link][inline_link]. /// It can also be [inline_link2]. /// diff --git a/tests/ui/double_neg.rs b/tests/ui/double_neg.rs index 641e334fd16..0ec13900f99 100644 --- a/tests/ui/double_neg.rs +++ b/tests/ui/double_neg.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#[warn(double_neg)] +#[warn(clippy::double_neg)] fn main() { let x = 1; -x; diff --git a/tests/ui/double_parens.rs b/tests/ui/double_parens.rs index 19d17732867..8d81ee16fe9 100644 --- a/tests/ui/double_parens.rs +++ b/tests/ui/double_parens.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(double_parens)] +#![warn(clippy::double_parens)] #![allow(dead_code)] fn dummy_fn(_: T) {} diff --git a/tests/ui/drop_forget_copy.rs b/tests/ui/drop_forget_copy.rs index 9fef06b0ede..aa70490f8ab 100644 --- a/tests/ui/drop_forget_copy.rs +++ b/tests/ui/drop_forget_copy.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(drop_copy, forget_copy)] -#![allow(toplevel_ref_arg, drop_ref, forget_ref, unused_mut)] +#![warn(clippy::drop_copy, clippy::forget_copy)] +#![allow(clippy::toplevel_ref_arg, clippy::drop_ref, clippy::forget_ref, unused_mut)] use std::mem::{drop, forget}; use std::vec::Vec; diff --git a/tests/ui/drop_forget_ref.rs b/tests/ui/drop_forget_ref.rs index e8ab6a0d5d1..bb4781db71b 100644 --- a/tests/ui/drop_forget_ref.rs +++ b/tests/ui/drop_forget_ref.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(drop_ref, forget_ref)] -#![allow(toplevel_ref_arg, similar_names, needless_pass_by_value)] +#![warn(clippy::drop_ref, clippy::forget_ref)] +#![allow(clippy::toplevel_ref_arg, clippy::similar_names, clippy::needless_pass_by_value)] use std::mem::{drop, forget}; diff --git a/tests/ui/duplicate_underscore_argument.rs b/tests/ui/duplicate_underscore_argument.rs index df00f56aa62..e54920c1b56 100644 --- a/tests/ui/duplicate_underscore_argument.rs +++ b/tests/ui/duplicate_underscore_argument.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(duplicate_underscore_argument)] +#![warn(clippy::duplicate_underscore_argument)] #[allow(dead_code, unused)] fn join_the_dark_side(darth: i32, _darth: i32) {} diff --git a/tests/ui/duration_subsec.rs b/tests/ui/duration_subsec.rs index 8c75c5f2fcd..d732a0228d5 100644 --- a/tests/ui/duration_subsec.rs +++ b/tests/ui/duration_subsec.rs @@ -1,4 +1,6 @@ -#![warn(duration_subsec)] +#![feature(tool_lints)] + +#![warn(clippy::duration_subsec)] use std::time::Duration; diff --git a/tests/ui/else_if_without_else.rs b/tests/ui/else_if_without_else.rs index 4f019819eff..3776aecf54f 100644 --- a/tests/ui/else_if_without_else.rs +++ b/tests/ui/else_if_without_else.rs @@ -1,5 +1,7 @@ -#![warn(clippy)] -#![warn(else_if_without_else)] +#![feature(tool_lints)] + +#![warn(clippy::all)] +#![warn(clippy::else_if_without_else)] fn bla1() -> bool { unimplemented!() } fn bla2() -> bool { unimplemented!() } diff --git a/tests/ui/empty_enum.rs b/tests/ui/empty_enum.rs index c6e6946de86..3398b71eead 100644 --- a/tests/ui/empty_enum.rs +++ b/tests/ui/empty_enum.rs @@ -1,8 +1,8 @@ - +#![feature(tool_lints)] #![allow(dead_code)] -#![warn(empty_enum)] +#![warn(clippy::empty_enum)] enum Empty {} diff --git a/tests/ui/empty_line_after_outer_attribute.rs b/tests/ui/empty_line_after_outer_attribute.rs index 30063dac0a4..c46a0496a73 100644 --- a/tests/ui/empty_line_after_outer_attribute.rs +++ b/tests/ui/empty_line_after_outer_attribute.rs @@ -1,5 +1,5 @@ - -#![warn(empty_line_after_outer_attr)] +#![feature(tool_lints)] +#![warn(clippy::empty_line_after_outer_attr)] // This should produce a warning #[crate_type = "lib"] diff --git a/tests/ui/entry.rs b/tests/ui/entry.rs index ccbc7038f13..955b0a6e917 100644 --- a/tests/ui/entry.rs +++ b/tests/ui/entry.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] +#![allow(unused, clippy::needless_pass_by_value)] -#![allow(unused, needless_pass_by_value)] - -#![warn(map_entry)] +#![warn(clippy::map_entry)] use std::collections::{BTreeMap, HashMap}; use std::hash::Hash; diff --git a/tests/ui/enum_glob_use.rs b/tests/ui/enum_glob_use.rs index efb37fbe49d..47082f8f3e6 100644 --- a/tests/ui/enum_glob_use.rs +++ b/tests/ui/enum_glob_use.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(clippy, clippy_pedantic)] -#![allow(unused_imports, dead_code, missing_docs_in_private_items)] +#![warn(clippy::all, clippy::pedantic)] +#![allow(unused_imports, dead_code, clippy::missing_docs_in_private_items)] use std::cmp::Ordering::*; diff --git a/tests/ui/enum_variants.rs b/tests/ui/enum_variants.rs index 222c76c25b7..4ddb7207a30 100644 --- a/tests/ui/enum_variants.rs +++ b/tests/ui/enum_variants.rs @@ -1,6 +1,8 @@ +#![feature(tool_lints)] + #![feature(non_ascii_idents)] -#![warn(clippy, pub_enum_variant_names)] +#![warn(clippy::all, clippy::pub_enum_variant_names)] enum FakeCallType { CALL, CREATE @@ -93,7 +95,7 @@ pub enum PubSeall { WithOut, } -#[allow(pub_enum_variant_names)] +#[allow(clippy::pub_enum_variant_names)] mod allowed { pub enum PubAllowed { SomeThis, diff --git a/tests/ui/enums_clike.rs b/tests/ui/enums_clike.rs index 618603683e8..8212f12b3db 100644 --- a/tests/ui/enums_clike.rs +++ b/tests/ui/enums_clike.rs @@ -1,7 +1,9 @@ +#![feature(tool_lints)] + // ignore-x86 -#![warn(clippy)] +#![warn(clippy::all)] #![allow(unused)] diff --git a/tests/ui/eq_op.rs b/tests/ui/eq_op.rs index ef573b2b91a..a88866436dd 100644 --- a/tests/ui/eq_op.rs +++ b/tests/ui/eq_op.rs @@ -1,10 +1,10 @@ +#![feature(tool_lints)] - -#[warn(eq_op)] -#[allow(identity_op, double_parens, many_single_char_names)] -#[allow(no_effect, unused_variables, unnecessary_operation, short_circuit_statement)] -#[warn(nonminimal_bool)] +#[warn(clippy::eq_op)] +#[allow(clippy::identity_op, clippy::double_parens, clippy::many_single_char_names)] +#[allow(clippy::no_effect, unused_variables, clippy::unnecessary_operation, clippy::short_circuit_statement)] +#[warn(clippy::nonminimal_bool)] fn main() { // simple values and comparisons 1 == 1; diff --git a/tests/ui/erasing_op.rs b/tests/ui/erasing_op.rs index e5143146f26..02745ac5d91 100644 --- a/tests/ui/erasing_op.rs +++ b/tests/ui/erasing_op.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#[allow(no_effect)] -#[warn(erasing_op)] +#[allow(clippy::no_effect)] +#[warn(clippy::erasing_op)] fn main() { let x: u8 = 0; diff --git a/tests/ui/eta.rs b/tests/ui/eta.rs index 6e0b6f8cacd..4dd46f20e76 100644 --- a/tests/ui/eta.rs +++ b/tests/ui/eta.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![allow(unknown_lints, unused, no_effect, redundant_closure_call, many_single_char_names, needless_pass_by_value, option_map_unit_fn, trivially_copy_pass_by_ref)] -#![warn(redundant_closure, needless_borrow)] +#![allow(unknown_lints, unused, clippy::no_effect, clippy::redundant_closure_call, clippy::many_single_char_names, clippy::needless_pass_by_value, clippy::option_map_unit_fn, clippy::trivially_copy_pass_by_ref)] +#![warn(clippy::redundant_closure, clippy::needless_borrow)] fn main() { let a = Some(1u8).map(|a| foo(a)); diff --git a/tests/ui/eval_order_dependence.rs b/tests/ui/eval_order_dependence.rs index e7ccb190d2c..b240dde06f8 100644 --- a/tests/ui/eval_order_dependence.rs +++ b/tests/ui/eval_order_dependence.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#[warn(eval_order_dependence)] -#[allow(unused_assignments, unused_variables, many_single_char_names, no_effect, dead_code, blacklisted_name)] +#[warn(clippy::eval_order_dependence)] +#[allow(unused_assignments, unused_variables, clippy::many_single_char_names, clippy::no_effect, dead_code, clippy::blacklisted_name)] fn main() { let mut x = 0; let a = { x = 1; 1 } + x; diff --git a/tests/ui/excessive_precision.rs b/tests/ui/excessive_precision.rs index 88f24d27dbc..b44364d6beb 100644 --- a/tests/ui/excessive_precision.rs +++ b/tests/ui/excessive_precision.rs @@ -1,6 +1,6 @@ - -#![warn(excessive_precision)] -#![allow(print_literal)] +#![feature(tool_lints)] +#![warn(clippy::excessive_precision)] +#![allow(clippy::print_literal)] fn main() { // Consts diff --git a/tests/ui/explicit_write.rs b/tests/ui/explicit_write.rs index 71992123ceb..9d6d13c84c5 100644 --- a/tests/ui/explicit_write.rs +++ b/tests/ui/explicit_write.rs @@ -1,4 +1,6 @@ -#![warn(explicit_write)] +#![feature(tool_lints)] + +#![warn(clippy::explicit_write)] fn stdout() -> String { diff --git a/tests/ui/fallible_impl_from.rs b/tests/ui/fallible_impl_from.rs index db118919071..5e33cca59fa 100644 --- a/tests/ui/fallible_impl_from.rs +++ b/tests/ui/fallible_impl_from.rs @@ -1,4 +1,6 @@ -#![deny(fallible_impl_from)] +#![feature(tool_lints)] + +#![deny(clippy::fallible_impl_from)] // docs example struct Foo(i32); diff --git a/tests/ui/filter_methods.rs b/tests/ui/filter_methods.rs index 29230c48ea3..d7a50a58838 100644 --- a/tests/ui/filter_methods.rs +++ b/tests/ui/filter_methods.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(clippy, clippy_pedantic)] -#![allow(missing_docs_in_private_items)] +#![warn(clippy::all, clippy::pedantic)] +#![allow(clippy::missing_docs_in_private_items)] fn main() { let _: Vec<_> = vec![5; 6].into_iter() diff --git a/tests/ui/float_cmp.rs b/tests/ui/float_cmp.rs index 9dd9ea9b04d..d5b02fb706f 100644 --- a/tests/ui/float_cmp.rs +++ b/tests/ui/float_cmp.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(float_cmp)] -#![allow(unused, no_effect, unnecessary_operation, cast_lossless)] +#![warn(clippy::float_cmp)] +#![allow(unused, clippy::no_effect, clippy::unnecessary_operation, clippy::cast_lossless)] use std::ops::Add; diff --git a/tests/ui/float_cmp_const.rs b/tests/ui/float_cmp_const.rs index adf2ab70368..279400604a2 100644 --- a/tests/ui/float_cmp_const.rs +++ b/tests/ui/float_cmp_const.rs @@ -1,9 +1,9 @@ +#![feature(tool_lints)] - -#![warn(float_cmp_const)] -#![allow(float_cmp)] -#![allow(unused, no_effect, unnecessary_operation)] +#![warn(clippy::float_cmp_const)] +#![allow(clippy::float_cmp)] +#![allow(unused, clippy::no_effect, clippy::unnecessary_operation)] const ONE: f32 = 1.0; const TWO: f32 = 2.0; @@ -36,7 +36,7 @@ fn main() { ONE != ::std::f32::INFINITY; ONE == ::std::f32::NEG_INFINITY; - // no errors, but will warn float_cmp if '#![allow(float_cmp)]' above is removed + // no errors, but will warn clippy::float_cmp if '#![allow(float_cmp)]' above is removed let w = 1.1; v == w; v != w; diff --git a/tests/ui/for_loop.rs b/tests/ui/for_loop.rs index bc0c3172bf0..39eee64883c 100644 --- a/tests/ui/for_loop.rs +++ b/tests/ui/for_loop.rs @@ -1,4 +1,4 @@ - +#![feature(tool_lints)] use std::collections::*; @@ -7,7 +7,7 @@ use std::rc::Rc; static STATIC: [usize; 4] = [0, 1, 8, 16]; const CONST: [usize; 4] = [0, 1, 8, 16]; -#[warn(clippy)] +#[warn(clippy::all)] fn for_loop_over_option_and_result() { let option = Some(1); let result = option.ok_or("x not found"); @@ -27,7 +27,7 @@ fn for_loop_over_option_and_result() { println!("{}", x); } - // make sure LOOP_OVER_NEXT lint takes precedence when next() is the last call + // make sure LOOP_OVER_NEXT lint takes clippy::precedence when next() is the last call // in the chain for x in v.iter().next() { println!("{}", x); @@ -73,11 +73,11 @@ impl Unrelated { } } -#[warn(needless_range_loop, explicit_iter_loop, explicit_into_iter_loop, iter_next_loop, reverse_range_loop, - explicit_counter_loop, for_kv_map)] -#[warn(unused_collect)] -#[allow(linkedlist, shadow_unrelated, unnecessary_mut_passed, cyclomatic_complexity, similar_names)] -#[allow(many_single_char_names, unused_variables)] +#[warn(clippy::needless_range_loop, clippy::explicit_iter_loop, clippy::explicit_into_iter_loop, clippy::iter_next_loop, clippy::reverse_range_loop, + clippy::explicit_counter_loop, clippy::for_kv_map)] +#[warn(clippy::unused_collect)] +#[allow(clippy::linkedlist, clippy::shadow_unrelated, clippy::unnecessary_mut_passed, clippy::cyclomatic_complexity, clippy::similar_names)] +#[allow(clippy::many_single_char_names, unused_variables)] fn main() { const MAX_LEN: usize = 42; @@ -429,7 +429,7 @@ fn main() { } } -#[allow(used_underscore_binding)] +#[allow(clippy::used_underscore_binding)] fn test_for_kv_map() { let m: HashMap = HashMap::new(); @@ -456,7 +456,7 @@ fn partition(v: &mut [T]) -> usize { const LOOP_OFFSET: usize = 5000; -#[warn(needless_range_loop)] +#[warn(clippy::needless_range_loop)] pub fn manual_copy(src: &[i32], dst: &mut [i32], dst2: &mut [i32]) { // plain manual memcpy for i in 0..src.len() { @@ -542,14 +542,14 @@ pub fn manual_copy(src: &[i32], dst: &mut [i32], dst2: &mut [i32]) { } } -#[warn(needless_range_loop)] +#[warn(clippy::needless_range_loop)] pub fn manual_clone(src: &[String], dst: &mut [String]) { for i in 0..src.len() { dst[i] = src[i].clone(); } } -#[warn(needless_range_loop)] +#[warn(clippy::needless_range_loop)] pub fn manual_copy_same_destination(dst: &mut [i32], d: usize, s: usize) { // Same source and destination - don't trigger lint for i in 0..dst.len() { diff --git a/tests/ui/format.rs b/tests/ui/format.rs index 783c6ea095d..8f31d92ac3c 100644 --- a/tests/ui/format.rs +++ b/tests/ui/format.rs @@ -1,6 +1,6 @@ - -#![allow(print_literal)] -#![warn(useless_format)] +#![feature(tool_lints)] +#![allow(clippy::print_literal)] +#![warn(clippy::useless_format)] struct Foo(pub String); diff --git a/tests/ui/formatting.rs b/tests/ui/formatting.rs index 20b1c1655a7..74d42f08f5a 100644 --- a/tests/ui/formatting.rs +++ b/tests/ui/formatting.rs @@ -1,11 +1,11 @@ +#![feature(tool_lints)] - -#![warn(clippy)] +#![warn(clippy::all)] #![allow(unused_variables)] #![allow(unused_assignments)] -#![allow(if_same_then_else)] -#![allow(deref_addrof)] +#![allow(clippy::if_same_then_else)] +#![allow(clippy::deref_addrof)] fn foo() -> bool { true } diff --git a/tests/ui/functions.rs b/tests/ui/functions.rs index 5688c471d86..ab5ce5b06d8 100644 --- a/tests/ui/functions.rs +++ b/tests/ui/functions.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(clippy)] +#![warn(clippy::all)] #![allow(dead_code)] #![allow(unused_unsafe)] diff --git a/tests/ui/fxhash.rs b/tests/ui/fxhash.rs index c6ed9436a51..1376b9442b6 100644 --- a/tests/ui/fxhash.rs +++ b/tests/ui/fxhash.rs @@ -1,4 +1,6 @@ -#![warn(default_hash_types)] +#![feature(tool_lints)] + +#![warn(clippy::default_hash_types)] #![feature(rustc_private)] extern crate rustc_data_structures; diff --git a/tests/ui/identity_conversion.rs b/tests/ui/identity_conversion.rs index 8f5bd12bc9f..b9ad8d06ad5 100644 --- a/tests/ui/identity_conversion.rs +++ b/tests/ui/identity_conversion.rs @@ -1,4 +1,6 @@ -#![deny(identity_conversion)] +#![feature(tool_lints)] + +#![deny(clippy::identity_conversion)] fn test_generic(val: T) -> T { let _ = T::from(val); @@ -28,7 +30,7 @@ fn main() { let _: String = "foo".into(); let _: String = From::from("foo"); let _ = String::from("foo"); - #[allow(identity_conversion)] + #[allow(clippy::identity_conversion)] { let _: String = "foo".into(); let _ = String::from("foo"); diff --git a/tests/ui/identity_op.rs b/tests/ui/identity_op.rs index 1ed9f974d43..ae8c66faa41 100644 --- a/tests/ui/identity_op.rs +++ b/tests/ui/identity_op.rs @@ -1,12 +1,12 @@ - +#![feature(tool_lints)] const ONE : i64 = 1; const NEG_ONE : i64 = -1; const ZERO : i64 = 0; -#[allow(eq_op, no_effect, unnecessary_operation, double_parens)] -#[warn(identity_op)] +#[allow(clippy::eq_op, clippy::no_effect, clippy::unnecessary_operation, clippy::double_parens)] +#[warn(clippy::identity_op)] fn main() { let x = 0; diff --git a/tests/ui/if_let_redundant_pattern_matching.rs b/tests/ui/if_let_redundant_pattern_matching.rs index 0963caa62e2..90265853f00 100644 --- a/tests/ui/if_let_redundant_pattern_matching.rs +++ b/tests/ui/if_let_redundant_pattern_matching.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(clippy)] -#![warn(if_let_redundant_pattern_matching)] +#![warn(clippy::all)] +#![warn(clippy::if_let_redundant_pattern_matching)] fn main() { diff --git a/tests/ui/if_not_else.rs b/tests/ui/if_not_else.rs index 9436af70cb8..bb16e16700b 100644 --- a/tests/ui/if_not_else.rs +++ b/tests/ui/if_not_else.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(clippy)] -#![warn(if_not_else)] +#![warn(clippy::all)] +#![warn(clippy::if_not_else)] fn bla() -> bool { unimplemented!() } diff --git a/tests/ui/impl.rs b/tests/ui/impl.rs index 9e10dbade4e..7da0e04e59e 100644 --- a/tests/ui/impl.rs +++ b/tests/ui/impl.rs @@ -1,5 +1,7 @@ +#![feature(tool_lints)] + #![allow(dead_code)] -#![warn(multiple_inherent_impl)] +#![warn(clippy::multiple_inherent_impl)] struct MyStruct; diff --git a/tests/ui/inconsistent_digit_grouping.rs b/tests/ui/inconsistent_digit_grouping.rs index ed6dc06edb1..056d8761109 100644 --- a/tests/ui/inconsistent_digit_grouping.rs +++ b/tests/ui/inconsistent_digit_grouping.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#[warn(inconsistent_digit_grouping)] +#[warn(clippy::inconsistent_digit_grouping)] #[allow(unused_variables)] fn main() { let good = (123, 1_234, 1_2345_6789, 123_f32, 1_234.12_f32, 1_234.123_4_f32, 1.123_456_7_f32); diff --git a/tests/ui/indexing_slicing.rs b/tests/ui/indexing_slicing.rs index e39dc92367c..b9f1c4a4a5d 100644 --- a/tests/ui/indexing_slicing.rs +++ b/tests/ui/indexing_slicing.rs @@ -1,7 +1,9 @@ +#![feature(tool_lints)] + #![feature(plugin)] -#![warn(indexing_slicing)] -#![warn(out_of_bounds_indexing)] -#![allow(no_effect, unnecessary_operation)] +#![warn(clippy::indexing_slicing)] +#![warn(clippy::out_of_bounds_indexing)] +#![allow(clippy::no_effect, clippy::unnecessary_operation)] fn main() { let x = [1, 2, 3, 4]; diff --git a/tests/ui/infallible_destructuring_match.rs b/tests/ui/infallible_destructuring_match.rs index 6f3d7a3ff2b..b3e2835d72f 100644 --- a/tests/ui/infallible_destructuring_match.rs +++ b/tests/ui/infallible_destructuring_match.rs @@ -1,5 +1,7 @@ +#![feature(tool_lints)] + #![feature(exhaustive_patterns, never_type)] -#![allow(let_and_return)] +#![allow(clippy::let_and_return)] enum SingleVariantEnum { Variant(i32), diff --git a/tests/ui/infinite_iter.rs b/tests/ui/infinite_iter.rs index a7841416671..44fa934aa26 100644 --- a/tests/ui/infinite_iter.rs +++ b/tests/ui/infinite_iter.rs @@ -1,11 +1,11 @@ - +#![feature(tool_lints)] use std::iter::repeat; -#[allow(trivially_copy_pass_by_ref)] +#[allow(clippy::trivially_copy_pass_by_ref)] fn square_is_lower_64(x: &u32) -> bool { x * x < 64 } -#[allow(maybe_infinite_iter)] -#[deny(infinite_iter)] +#[allow(clippy::maybe_infinite_iter)] +#[deny(clippy::infinite_iter)] fn infinite_iters() { repeat(0_u8).collect::>(); // infinite iter (0..8_u32).take_while(square_is_lower_64).cycle().count(); // infinite iter @@ -19,7 +19,7 @@ fn infinite_iters() { (0..).next(); // iterator is not exhausted } -#[deny(maybe_infinite_iter)] +#[deny(clippy::maybe_infinite_iter)] fn potential_infinite_iters() { (0..).zip((0..).take_while(square_is_lower_64)).count(); // maybe infinite iter repeat(42).take_while(|x| *x == 42).chain(0..42).max(); // maybe infinite iter diff --git a/tests/ui/infinite_loop.rs b/tests/ui/infinite_loop.rs index 9e801911602..9449a295e3a 100644 --- a/tests/ui/infinite_loop.rs +++ b/tests/ui/infinite_loop.rs @@ -1,4 +1,6 @@ -#![allow(trivially_copy_pass_by_ref)] +#![feature(tool_lints)] + +#![allow(clippy::trivially_copy_pass_by_ref)] fn fn_val(i: i32) -> i32 { unimplemented!() } @@ -7,7 +9,7 @@ fn fn_mutref(i: &mut i32) { unimplemented!() } fn fooi() -> i32 { unimplemented!() } fn foob() -> bool { unimplemented!() } -#[allow(many_single_char_names)] +#[allow(clippy::many_single_char_names)] fn immutable_condition() { // Should warn when all vars mentioned are immutable let y = 0; diff --git a/tests/ui/inline_fn_without_body.rs b/tests/ui/inline_fn_without_body.rs index 76e50e56780..830da6d1124 100644 --- a/tests/ui/inline_fn_without_body.rs +++ b/tests/ui/inline_fn_without_body.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(inline_fn_without_body)] -#![allow(inline_always)] +#![warn(clippy::inline_fn_without_body)] +#![allow(clippy::inline_always)] trait Foo { #[inline] diff --git a/tests/ui/int_plus_one.rs b/tests/ui/int_plus_one.rs index a9e059f4a3e..1eb0e49290f 100644 --- a/tests/ui/int_plus_one.rs +++ b/tests/ui/int_plus_one.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#[allow(no_effect, unnecessary_operation)] -#[warn(int_plus_one)] +#[allow(clippy::no_effect, clippy::unnecessary_operation)] +#[warn(clippy::int_plus_one)] fn main() { let x = 1i32; let y = 0i32; diff --git a/tests/ui/invalid_upcast_comparisons.rs b/tests/ui/invalid_upcast_comparisons.rs index 5bf0bfdcb98..0a700518f8f 100644 --- a/tests/ui/invalid_upcast_comparisons.rs +++ b/tests/ui/invalid_upcast_comparisons.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(invalid_upcast_comparisons)] -#![allow(unused, eq_op, no_effect, unnecessary_operation, cast_lossless)] +#![warn(clippy::invalid_upcast_comparisons)] +#![allow(unused, clippy::eq_op, clippy::no_effect, clippy::unnecessary_operation, clippy::cast_lossless)] fn mk_value() -> T { unimplemented!() } diff --git a/tests/ui/issue_2356.rs b/tests/ui/issue_2356.rs index d4cefb0f1e3..398e0d1d1f0 100644 --- a/tests/ui/issue_2356.rs +++ b/tests/ui/issue_2356.rs @@ -1,4 +1,6 @@ -#![deny(while_let_on_iterator)] +#![feature(tool_lints)] + +#![deny(clippy::while_let_on_iterator)] use std::iter::Iterator; diff --git a/tests/ui/item_after_statement.rs b/tests/ui/item_after_statement.rs index 710a1adca56..9626a59ed02 100644 --- a/tests/ui/item_after_statement.rs +++ b/tests/ui/item_after_statement.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![warn(items_after_statements)] +#![warn(clippy::items_after_statements)] fn ok() { fn foo() { println!("foo"); } diff --git a/tests/ui/large_digit_groups.rs b/tests/ui/large_digit_groups.rs index 5d0fb11dbea..af569ea7566 100644 --- a/tests/ui/large_digit_groups.rs +++ b/tests/ui/large_digit_groups.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#[warn(large_digit_groups)] +#[warn(clippy::large_digit_groups)] #[allow(unused_variables)] fn main() { let good = (0b1011_i64, 0o1_234_u32, 0x1_234_567, 1_2345_6789, 1234_f32, 1_234.12_f32, 1_234.123_f32, 1.123_4_f32); diff --git a/tests/ui/large_enum_variant.rs b/tests/ui/large_enum_variant.rs index aaf3e2924b3..cd1772ad1d1 100644 --- a/tests/ui/large_enum_variant.rs +++ b/tests/ui/large_enum_variant.rs @@ -1,9 +1,9 @@ - +#![feature(tool_lints)] #![allow(dead_code)] #![allow(unused_variables)] -#![warn(large_enum_variant)] +#![warn(clippy::large_enum_variant)] enum LargeEnum { A(i32), diff --git a/tests/ui/len_zero.rs b/tests/ui/len_zero.rs index 2e71c2761fa..b188db5186e 100644 --- a/tests/ui/len_zero.rs +++ b/tests/ui/len_zero.rs @@ -1,4 +1,6 @@ -#![warn(len_without_is_empty, len_zero)] +#![feature(tool_lints)] + +#![warn(clippy::len_without_is_empty, clippy::len_zero)] #![allow(dead_code, unused)] pub struct PubOne; @@ -19,7 +21,7 @@ impl PubOne { // Identical to PubOne, but with an allow attribute on the impl complaining len pub struct PubAllowed; -#[allow(len_without_is_empty)] +#[allow(clippy::len_without_is_empty)] impl PubAllowed { pub fn len(self: &Self) -> isize { 1 diff --git a/tests/ui/let_if_seq.rs b/tests/ui/let_if_seq.rs index 564a67d2c8e..102b72f3e25 100644 --- a/tests/ui/let_if_seq.rs +++ b/tests/ui/let_if_seq.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![allow(unused_variables, unused_assignments, similar_names, blacklisted_name)] -#![warn(useless_let_if_seq)] +#![allow(unused_variables, unused_assignments, clippy::similar_names, clippy::blacklisted_name)] +#![warn(clippy::useless_let_if_seq)] fn f() -> bool { true } fn g(x: i32) -> i32 { x + 1 } diff --git a/tests/ui/let_return.rs b/tests/ui/let_return.rs index 1083603b2d6..9b584d6e293 100644 --- a/tests/ui/let_return.rs +++ b/tests/ui/let_return.rs @@ -1,8 +1,8 @@ - +#![feature(tool_lints)] #![allow(unused)] -#![warn(let_and_return)] +#![warn(clippy::let_and_return)] fn test() -> i32 { let _y = 0; // no warning @@ -37,7 +37,7 @@ fn test_nowarn_3() -> (i32, i32) { } fn test_nowarn_4() -> i32 { - // this should technically warn, but not b/c of let_and_return, but b/c of useless type + // this should technically warn, but not b/c of clippy::let_and_return, but b/c of useless type let x: i32 = 5; x } diff --git a/tests/ui/let_unit.rs b/tests/ui/let_unit.rs index 032dc85f2cd..187ff9d1358 100644 --- a/tests/ui/let_unit.rs +++ b/tests/ui/let_unit.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(let_unit_value)] +#![warn(clippy::let_unit_value)] #![allow(unused_variables)] macro_rules! let_and_return { diff --git a/tests/ui/lifetimes.rs b/tests/ui/lifetimes.rs index 0322d42e81f..aa5640f4e22 100644 --- a/tests/ui/lifetimes.rs +++ b/tests/ui/lifetimes.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(needless_lifetimes, extra_unused_lifetimes)] -#![allow(dead_code, needless_pass_by_value, trivially_copy_pass_by_ref)] +#![warn(clippy::needless_lifetimes, clippy::extra_unused_lifetimes)] +#![allow(dead_code, clippy::needless_pass_by_value, clippy::trivially_copy_pass_by_ref)] fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) { } diff --git a/tests/ui/literals.rs b/tests/ui/literals.rs index 581fbbb70c9..d45da257ad4 100644 --- a/tests/ui/literals.rs +++ b/tests/ui/literals.rs @@ -1,6 +1,8 @@ -#![warn(mixed_case_hex_literals)] -#![warn(unseparated_literal_suffix)] -#![warn(zero_prefixed_literal)] +#![feature(tool_lints)] + +#![warn(clippy::mixed_case_hex_literals)] +#![warn(clippy::unseparated_literal_suffix)] +#![warn(clippy::zero_prefixed_literal)] #![allow(dead_code)] fn main() { diff --git a/tests/ui/map_clone.rs b/tests/ui/map_clone.rs index f11d21d2dfa..90c95be2c1c 100644 --- a/tests/ui/map_clone.rs +++ b/tests/ui/map_clone.rs @@ -1,9 +1,9 @@ +#![feature(tool_lints)] +#![warn(clippy::map_clone)] -#![warn(map_clone)] - -#![allow(clone_on_copy, unused)] +#![allow(clippy::clone_on_copy, unused)] use std::ops::Deref; diff --git a/tests/ui/matches.rs b/tests/ui/matches.rs index e339aeb9c6a..92befb25a7e 100644 --- a/tests/ui/matches.rs +++ b/tests/ui/matches.rs @@ -1,10 +1,10 @@ - +#![feature(tool_lints)] #![feature(exclusive_range_pattern)] -#![warn(clippy)] -#![allow(unused, if_let_redundant_pattern_matching)] -#![warn(single_match_else, match_same_arms)] +#![warn(clippy::all)] +#![allow(unused, clippy::if_let_redundant_pattern_matching)] +#![warn(clippy::single_match_else, clippy::match_same_arms)] enum ExprNode { ExprAddrOf, diff --git a/tests/ui/mem_forget.rs b/tests/ui/mem_forget.rs index 991a402e207..96d333a7170 100644 --- a/tests/ui/mem_forget.rs +++ b/tests/ui/mem_forget.rs @@ -1,4 +1,4 @@ - +#![feature(tool_lints)] @@ -8,8 +8,8 @@ use std::rc::Rc; use std::mem::forget as forgetSomething; use std::mem as memstuff; -#[warn(mem_forget)] -#[allow(forget_copy)] +#[warn(clippy::mem_forget)] +#[allow(clippy::forget_copy)] fn main() { let five: i32 = 5; forgetSomething(five); diff --git a/tests/ui/methods.rs b/tests/ui/methods.rs index 220b08caaf7..37f4cb2f71e 100644 --- a/tests/ui/methods.rs +++ b/tests/ui/methods.rs @@ -1,10 +1,10 @@ - +#![feature(tool_lints)] #![feature(const_fn)] -#![warn(clippy, clippy_pedantic, option_unwrap_used)] -#![allow(blacklisted_name, unused, print_stdout, non_ascii_literal, new_without_default, - new_without_default_derive, missing_docs_in_private_items, needless_pass_by_value, - default_trait_access, use_self)] +#![warn(clippy::all, clippy::pedantic, clippy::option_unwrap_used)] +#![allow(clippy::blacklisted_name, unused, clippy::print_stdout, clippy::non_ascii_literal, clippy::new_without_default, + clippy::new_without_default_derive, clippy::missing_docs_in_private_items, clippy::needless_pass_by_value, + clippy::default_trait_access, clippy::use_self)] use std::collections::BTreeMap; use std::collections::HashMap; @@ -42,7 +42,7 @@ struct Lt<'a> { impl<'a> Lt<'a> { // The lifetime is different, but that’s irrelevant, see #734 - #[allow(needless_lifetimes)] + #[allow(clippy::needless_lifetimes)] pub fn new<'b>(s: &'b str) -> Lt<'b> { unimplemented!() } } @@ -438,7 +438,7 @@ fn iter_skip_next() { let _ = foo.filter().skip(42).next(); } -#[allow(similar_names)] +#[allow(clippy::similar_names)] fn main() { let opt = Some(0); let _ = opt.unwrap(); diff --git a/tests/ui/min_max.rs b/tests/ui/min_max.rs index 9b29f73b2ac..9866933f9fe 100644 --- a/tests/ui/min_max.rs +++ b/tests/ui/min_max.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(clippy)] +#![warn(clippy::all)] use std::cmp::{min, max}; use std::cmp::min as my_min; diff --git a/tests/ui/missing-doc.rs b/tests/ui/missing-doc.rs index cbd6439d47e..6968adb312b 100644 --- a/tests/ui/missing-doc.rs +++ b/tests/ui/missing-doc.rs @@ -1,3 +1,5 @@ +#![feature(tool_lints)] + /* This file incorporates work covered by the following copyright and * permission notice: * Copyright 2013 The Rust Project Developers. See the COPYRIGHT @@ -13,7 +15,7 @@ -#![warn(missing_docs_in_private_items)] +#![warn(clippy::missing_docs_in_private_items)] // When denying at the crate level, be sure to not get random warnings from the // injected intrinsics by the compiler. @@ -36,7 +38,7 @@ pub struct PubFoo { b: isize, } -#[allow(missing_docs_in_private_items)] +#[allow(clippy::missing_docs_in_private_items)] pub struct PubFoo2 { pub a: isize, pub c: isize, @@ -49,7 +51,7 @@ pub mod pub_module_no_dox {} pub fn foo() {} pub fn foo2() {} fn foo3() {} -#[allow(missing_docs_in_private_items)] pub fn foo4() {} +#[allow(clippy::missing_docs_in_private_items)] pub fn foo4() {} /// dox pub trait A { @@ -59,7 +61,7 @@ pub trait A { fn foo_with_impl(&self) {} } -#[allow(missing_docs_in_private_items)] +#[allow(clippy::missing_docs_in_private_items)] trait B { fn foo(&self); fn foo_with_impl(&self) {} @@ -70,7 +72,7 @@ pub trait C { fn foo_with_impl(&self) {} } -#[allow(missing_docs_in_private_items)] +#[allow(clippy::missing_docs_in_private_items)] pub trait D { fn dummy(&self) { } } @@ -98,10 +100,10 @@ impl PubFoo { /// dox pub fn foo1() {} fn foo2() {} - #[allow(missing_docs_in_private_items)] pub fn foo3() {} + #[allow(clippy::missing_docs_in_private_items)] pub fn foo3() {} } -#[allow(missing_docs_in_private_items)] +#[allow(clippy::missing_docs_in_private_items)] trait F { fn a(); fn b(&self); @@ -146,7 +148,7 @@ pub enum PubBaz2 { }, } -#[allow(missing_docs_in_private_items)] +#[allow(clippy::missing_docs_in_private_items)] pub enum PubBaz3 { PubBaz3A { b: isize @@ -160,7 +162,7 @@ pub fn baz() {} const FOO: u32 = 0; /// dox pub const FOO1: u32 = 0; -#[allow(missing_docs_in_private_items)] +#[allow(clippy::missing_docs_in_private_items)] pub const FOO2: u32 = 0; #[doc(hidden)] pub const FOO3: u32 = 0; @@ -170,7 +172,7 @@ pub const FOO4: u32 = 0; static BAR: u32 = 0; /// dox pub static BAR1: u32 = 0; -#[allow(missing_docs_in_private_items)] +#[allow(clippy::missing_docs_in_private_items)] pub static BAR2: u32 = 0; #[doc(hidden)] pub static BAR3: u32 = 0; diff --git a/tests/ui/missing_inline.rs b/tests/ui/missing_inline.rs index 38f59033071..7fbb01c6d2b 100644 --- a/tests/ui/missing_inline.rs +++ b/tests/ui/missing_inline.rs @@ -1,3 +1,5 @@ +#![feature(tool_lints)] + /* This file incorporates work covered by the following copyright and * permission notice: * Copyright 2013 The Rust Project Developers. See the COPYRIGHT @@ -10,7 +12,7 @@ * option. This file may not be copied, modified, or distributed * except according to those terms. */ -#![warn(missing_inline_in_public_items)] +#![warn(clippy::missing_inline_in_public_items)] #![crate_type = "dylib"] // When denying at the crate level, be sure to not get random warnings from the // injected intrinsics by the compiler. @@ -32,7 +34,7 @@ pub fn pub_foo() {} // missing #[inline] #[inline] pub fn pub_foo_inline() {} // ok #[inline(always)] pub fn pub_foo_inline_always() {} // ok -#[allow(missing_inline_in_public_items)] +#[allow(clippy::missing_inline_in_public_items)] pub fn pub_foo_no_inline() {} trait Bar { diff --git a/tests/ui/module_inception.rs b/tests/ui/module_inception.rs index 77bd446c569..b6917020ea2 100644 --- a/tests/ui/module_inception.rs +++ b/tests/ui/module_inception.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![warn(module_inception)] +#![warn(clippy::module_inception)] mod foo { mod bar { @@ -16,7 +16,7 @@ mod foo { // No warning. See . mod bar { - #[allow(module_inception)] + #[allow(clippy::module_inception)] mod bar { } } diff --git a/tests/ui/modulo_one.rs b/tests/ui/modulo_one.rs index 847ea1d9ab6..7dcec04baf9 100644 --- a/tests/ui/modulo_one.rs +++ b/tests/ui/modulo_one.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(modulo_one)] -#![allow(no_effect, unnecessary_operation)] +#![warn(clippy::modulo_one)] +#![allow(clippy::no_effect, clippy::unnecessary_operation)] fn main() { 10 % 1; diff --git a/tests/ui/mut_from_ref.rs b/tests/ui/mut_from_ref.rs index 3fc464083c4..b75fa92f098 100644 --- a/tests/ui/mut_from_ref.rs +++ b/tests/ui/mut_from_ref.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![allow(unused, trivially_copy_pass_by_ref)] -#![warn(mut_from_ref)] +#![allow(unused, clippy::trivially_copy_pass_by_ref)] +#![warn(clippy::mut_from_ref)] struct Foo; diff --git a/tests/ui/mut_mut.rs b/tests/ui/mut_mut.rs index 658ae18466f..4656d27648f 100644 --- a/tests/ui/mut_mut.rs +++ b/tests/ui/mut_mut.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![allow(unused, no_effect, unnecessary_operation)] -#![warn(mut_mut)] +#![allow(unused, clippy::no_effect, clippy::unnecessary_operation)] +#![warn(clippy::mut_mut)] diff --git a/tests/ui/mut_reference.rs b/tests/ui/mut_reference.rs index 34185f6a9c2..38b0e25e07c 100644 --- a/tests/ui/mut_reference.rs +++ b/tests/ui/mut_reference.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![allow(unused_variables, trivially_copy_pass_by_ref)] +#![allow(unused_variables, clippy::trivially_copy_pass_by_ref)] fn takes_an_immutable_reference(a: &i32) {} fn takes_a_mutable_reference(a: &mut i32) {} @@ -16,7 +16,7 @@ impl MyStruct { } } -#[warn(unnecessary_mut_passed)] +#[warn(clippy::unnecessary_mut_passed)] fn main() { // Functions takes_an_immutable_reference(&mut 42); diff --git a/tests/ui/mutex_atomic.rs b/tests/ui/mutex_atomic.rs index 96502738456..3eefbb97ab8 100644 --- a/tests/ui/mutex_atomic.rs +++ b/tests/ui/mutex_atomic.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(clippy)] -#![warn(mutex_integer)] +#![warn(clippy::all)] +#![warn(clippy::mutex_integer)] fn main() { use std::sync::Mutex; diff --git a/tests/ui/needless_bool.rs b/tests/ui/needless_bool.rs index 1213539c827..4e6f65ed0dd 100644 --- a/tests/ui/needless_bool.rs +++ b/tests/ui/needless_bool.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] +#![warn(clippy::needless_bool)] -#![warn(needless_bool)] - -#[allow(if_same_then_else)] +#[allow(clippy::if_same_then_else)] fn main() { let x = true; let y = false; @@ -20,32 +20,32 @@ fn main() { bool_ret6(x, x); } -#[allow(if_same_then_else, needless_return)] +#[allow(clippy::if_same_then_else, clippy::needless_return)] fn bool_ret(x: bool) -> bool { if x { return true } else { return true }; } -#[allow(if_same_then_else, needless_return)] +#[allow(clippy::if_same_then_else, clippy::needless_return)] fn bool_ret2(x: bool) -> bool { if x { return false } else { return false }; } -#[allow(needless_return)] +#[allow(clippy::needless_return)] fn bool_ret3(x: bool) -> bool { if x { return true } else { return false }; } -#[allow(needless_return)] +#[allow(clippy::needless_return)] fn bool_ret5(x: bool, y: bool) -> bool { if x && y { return true } else { return false }; } -#[allow(needless_return)] +#[allow(clippy::needless_return)] fn bool_ret4(x: bool) -> bool { if x { return false } else { return true }; } -#[allow(needless_return)] +#[allow(clippy::needless_return)] fn bool_ret6(x: bool, y: bool) -> bool { if x && y { return false } else { return true }; } diff --git a/tests/ui/needless_borrow.rs b/tests/ui/needless_borrow.rs index b086f0214a9..61384c43fa9 100644 --- a/tests/ui/needless_borrow.rs +++ b/tests/ui/needless_borrow.rs @@ -1,11 +1,13 @@ +#![feature(tool_lints)] + use std::borrow::Cow; -#[allow(trivially_copy_pass_by_ref)] +#[allow(clippy::trivially_copy_pass_by_ref)] fn x(y: &i32) -> i32 { *y } -#[warn(clippy, needless_borrow)] +#[warn(clippy::all, clippy::needless_borrow)] #[allow(unused_variables)] fn main() { let a = 5; @@ -42,7 +44,7 @@ trait Trait {} impl<'a> Trait for &'a str {} fn h(_: &Trait) {} -#[warn(needless_borrow)] +#[warn(clippy::needless_borrow)] #[allow(dead_code)] fn issue_1432() { let mut v = Vec::::new(); diff --git a/tests/ui/needless_borrowed_ref.rs b/tests/ui/needless_borrowed_ref.rs index 75ffa211180..000ecd32da4 100644 --- a/tests/ui/needless_borrowed_ref.rs +++ b/tests/ui/needless_borrowed_ref.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#[warn(needless_borrowed_reference)] +#[warn(clippy::needless_borrowed_reference)] #[allow(unused_variables)] fn main() { let mut v = Vec::::new(); diff --git a/tests/ui/needless_continue.rs b/tests/ui/needless_continue.rs index 3574b0fb3fd..4fe523e48de 100644 --- a/tests/ui/needless_continue.rs +++ b/tests/ui/needless_continue.rs @@ -1,4 +1,4 @@ - +#![feature(tool_lints)] macro_rules! zero { @@ -9,7 +9,7 @@ macro_rules! nonzero { ($x:expr) => (!zero!($x)); } -#[warn(needless_continue)] +#[warn(clippy::needless_continue)] fn main() { let mut i = 1; while i < 10 { diff --git a/tests/ui/needless_pass_by_value.rs b/tests/ui/needless_pass_by_value.rs index 322df0b8798..783386fab01 100644 --- a/tests/ui/needless_pass_by_value.rs +++ b/tests/ui/needless_pass_by_value.rs @@ -1,5 +1,7 @@ -#![warn(needless_pass_by_value)] -#![allow(dead_code, single_match, if_let_redundant_pattern_matching, many_single_char_names, option_option)] +#![feature(tool_lints)] + +#![warn(clippy::needless_pass_by_value)] +#![allow(dead_code, clippy::single_match, clippy::if_let_redundant_pattern_matching, clippy::many_single_char_names, clippy::option_option)] use std::borrow::Borrow; use std::convert::AsRef; diff --git a/tests/ui/needless_pass_by_value_proc_macro.rs b/tests/ui/needless_pass_by_value_proc_macro.rs index 652e11fee9d..6b1305fa2d8 100644 --- a/tests/ui/needless_pass_by_value_proc_macro.rs +++ b/tests/ui/needless_pass_by_value_proc_macro.rs @@ -1,7 +1,7 @@ - +#![feature(tool_lints)] #![crate_type = "proc-macro"] -#![warn(needless_pass_by_value)] +#![warn(clippy::needless_pass_by_value)] extern crate proc_macro; diff --git a/tests/ui/needless_return.rs b/tests/ui/needless_return.rs index 4739ded7b7e..a834563eca3 100644 --- a/tests/ui/needless_return.rs +++ b/tests/ui/needless_return.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(needless_return)] +#![warn(clippy::needless_return)] fn test_end_of_fn() -> bool { if true { diff --git a/tests/ui/needless_update.rs b/tests/ui/needless_update.rs index 35d5730dda1..675c60e2477 100644 --- a/tests/ui/needless_update.rs +++ b/tests/ui/needless_update.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(needless_update)] -#![allow(no_effect)] +#![warn(clippy::needless_update)] +#![allow(clippy::no_effect)] struct S { pub a: i32, diff --git a/tests/ui/neg_cmp_op_on_partial_ord.rs b/tests/ui/neg_cmp_op_on_partial_ord.rs index e739908bc28..3a472bf6995 100644 --- a/tests/ui/neg_cmp_op_on_partial_ord.rs +++ b/tests/ui/neg_cmp_op_on_partial_ord.rs @@ -1,10 +1,12 @@ +#![feature(tool_lints)] + //! This test case utilizes `f64` an easy example for `PartialOrd` only types //! but the lint itself actually validates any expression where the left //! operand implements `PartialOrd` but not `Ord`. use std::cmp::Ordering; -#[warn(neg_cmp_op_on_partial_ord)] +#[warn(clippy::neg_cmp_op_on_partial_ord)] fn main() { let a_value = 1.0; diff --git a/tests/ui/neg_multiply.rs b/tests/ui/neg_multiply.rs index 367d2d5edfb..b1a1879a3fc 100644 --- a/tests/ui/neg_multiply.rs +++ b/tests/ui/neg_multiply.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(neg_multiply)] -#![allow(no_effect, unnecessary_operation)] +#![warn(clippy::neg_multiply)] +#![allow(clippy::no_effect, clippy::unnecessary_operation)] use std::ops::Mul; diff --git a/tests/ui/never_loop.rs b/tests/ui/never_loop.rs index 20500126662..bb6d76b06cd 100644 --- a/tests/ui/never_loop.rs +++ b/tests/ui/never_loop.rs @@ -1,10 +1,10 @@ +#![feature(tool_lints)] - -#![allow(single_match, unused_assignments, unused_variables, while_immutable_condition)] +#![allow(clippy::single_match, unused_assignments, unused_variables, clippy::while_immutable_condition)] fn test1() { let mut x = 0; - loop { // never_loop + loop { // clippy::never_loop x += 1; if x == 1 { return diff --git a/tests/ui/new_without_default.rs b/tests/ui/new_without_default.rs index c06c9f9e962..bf63e9336e5 100644 --- a/tests/ui/new_without_default.rs +++ b/tests/ui/new_without_default.rs @@ -1,8 +1,10 @@ +#![feature(tool_lints)] + #![feature(const_fn)] #![allow(dead_code)] -#![warn(new_without_default, new_without_default_derive)] +#![warn(clippy::new_without_default, clippy::new_without_default_derive)] pub struct Foo; diff --git a/tests/ui/no_effect.rs b/tests/ui/no_effect.rs index 54028cd8b2b..2913ecdbf59 100644 --- a/tests/ui/no_effect.rs +++ b/tests/ui/no_effect.rs @@ -1,11 +1,13 @@ +#![feature(tool_lints)] + #![feature(box_syntax)] -#![warn(no_effect, unnecessary_operation)] +#![warn(clippy::no_effect, clippy::unnecessary_operation)] #![allow(dead_code)] #![allow(path_statements)] -#![allow(deref_addrof)] -#![allow(redundant_field_names)] +#![allow(clippy::deref_addrof)] +#![allow(clippy::redundant_field_names)] #![feature(untagged_unions)] struct Unit; diff --git a/tests/ui/non_copy_const.rs b/tests/ui/non_copy_const.rs index d7391577d23..4e086333b0c 100644 --- a/tests/ui/non_copy_const.rs +++ b/tests/ui/non_copy_const.rs @@ -1,5 +1,7 @@ +#![feature(tool_lints)] + #![feature(const_string_new, const_vec_new)] -#![allow(ref_in_deref, dead_code)] +#![allow(clippy::ref_in_deref, dead_code)] use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering}; use std::cell::Cell; @@ -30,7 +32,7 @@ const NO_ANN: &Display = &70; static STATIC_TUPLE: (AtomicUsize, String) = (ATOMIC, STRING); //^ there should be no lints on this line -#[allow(declare_interior_mutable_const)] +#[allow(clippy::declare_interior_mutable_const)] const ONCE_INIT: Once = Once::new(); trait Trait: Copy { diff --git a/tests/ui/non_expressive_names.rs b/tests/ui/non_expressive_names.rs index 7149bf8f3e7..7b5db015d77 100644 --- a/tests/ui/non_expressive_names.rs +++ b/tests/ui/non_expressive_names.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(clippy,similar_names)] -#![allow(unused, println_empty_string)] +#![warn(clippy::all,clippy::similar_names)] +#![allow(unused, clippy::println_empty_string)] struct Foo { diff --git a/tests/ui/ok_if_let.rs b/tests/ui/ok_if_let.rs index fdc01bcc7bc..46d85bb9cd0 100644 --- a/tests/ui/ok_if_let.rs +++ b/tests/ui/ok_if_let.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(if_let_some_result)] +#![warn(clippy::if_let_some_result)] fn str_to_int(x: &str) -> i32 { if let Some(y) = x.parse().ok() { diff --git a/tests/ui/op_ref.rs b/tests/ui/op_ref.rs index 9eb697571b6..a85a2c8bb51 100644 --- a/tests/ui/op_ref.rs +++ b/tests/ui/op_ref.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![allow(unused_variables, blacklisted_name)] +#![allow(unused_variables, clippy::blacklisted_name)] use std::collections::HashSet; diff --git a/tests/ui/open_options.rs b/tests/ui/open_options.rs index 514808d41f1..38b3dd7e49d 100644 --- a/tests/ui/open_options.rs +++ b/tests/ui/open_options.rs @@ -1,9 +1,9 @@ - +#![feature(tool_lints)] use std::fs::OpenOptions; #[allow(unused_must_use)] -#[warn(nonsensical_open_options)] +#[warn(clippy::nonsensical_open_options)] fn main() { OpenOptions::new().read(true).truncate(true).open("foo.txt"); OpenOptions::new().append(true).truncate(true).open("foo.txt"); diff --git a/tests/ui/option_map_unit_fn.rs b/tests/ui/option_map_unit_fn.rs index 06531e29032..e86cc99c522 100644 --- a/tests/ui/option_map_unit_fn.rs +++ b/tests/ui/option_map_unit_fn.rs @@ -1,4 +1,6 @@ -#![warn(option_map_unit_fn)] +#![feature(tool_lints)] + +#![warn(clippy::option_map_unit_fn)] #![allow(unused)] fn do_nothing(_: T) {} diff --git a/tests/ui/overflow_check_conditional.rs b/tests/ui/overflow_check_conditional.rs index 889c339c8fd..5c3cc5b08a9 100644 --- a/tests/ui/overflow_check_conditional.rs +++ b/tests/ui/overflow_check_conditional.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![allow(many_single_char_names)] -#![warn(overflow_check_conditional)] +#![allow(clippy::many_single_char_names)] +#![warn(clippy::overflow_check_conditional)] fn main() { let a: u32 = 1; diff --git a/tests/ui/panic_unimplemented.rs b/tests/ui/panic_unimplemented.rs index 33050633f7f..693dc921be3 100644 --- a/tests/ui/panic_unimplemented.rs +++ b/tests/ui/panic_unimplemented.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(panic_params, unimplemented)] +#![warn(clippy::panic_params, clippy::unimplemented)] fn missing() { if true { diff --git a/tests/ui/patterns.rs b/tests/ui/patterns.rs index 65e319e2f88..70f86afbacb 100644 --- a/tests/ui/patterns.rs +++ b/tests/ui/patterns.rs @@ -1,7 +1,7 @@ - +#![feature(tool_lints)] #![allow(unused)] -#![warn(clippy)] +#![warn(clippy::all)] fn main() { let v = Some(true); diff --git a/tests/ui/precedence.rs b/tests/ui/precedence.rs index aacd90cdf92..95476dd4f51 100644 --- a/tests/ui/precedence.rs +++ b/tests/ui/precedence.rs @@ -1,9 +1,9 @@ +#![feature(tool_lints)] - -#[warn(precedence)] -#[allow(identity_op)] -#[allow(eq_op)] +#[warn(clippy::precedence)] +#[allow(clippy::identity_op)] +#[allow(clippy::eq_op)] macro_rules! trip { ($a:expr) => { diff --git a/tests/ui/print.rs b/tests/ui/print.rs index 8719a691d43..cee3e700036 100644 --- a/tests/ui/print.rs +++ b/tests/ui/print.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![allow(print_literal, write_literal)] -#![warn(print_stdout, use_debug)] +#![allow(clippy::print_literal, clippy::write_literal)] +#![warn(clippy::print_stdout, clippy::use_debug)] use std::fmt::{Debug, Display, Formatter, Result}; diff --git a/tests/ui/print_literal.rs b/tests/ui/print_literal.rs index 620349bab33..46b91d40f8c 100644 --- a/tests/ui/print_literal.rs +++ b/tests/ui/print_literal.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![warn(print_literal)] +#![warn(clippy::print_literal)] fn main() { // these should be fine diff --git a/tests/ui/print_with_newline.rs b/tests/ui/print_with_newline.rs index 906fa987d17..5efee5abfc8 100644 --- a/tests/ui/print_with_newline.rs +++ b/tests/ui/print_with_newline.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![allow(print_literal)] -#![warn(print_with_newline)] +#![allow(clippy::print_literal)] +#![warn(clippy::print_with_newline)] fn main() { print!("Hello\n"); diff --git a/tests/ui/ptr_arg.rs b/tests/ui/ptr_arg.rs index ce572be7ad8..e76221355ae 100644 --- a/tests/ui/ptr_arg.rs +++ b/tests/ui/ptr_arg.rs @@ -1,5 +1,7 @@ -#![allow(unused, many_single_char_names)] -#![warn(ptr_arg)] +#![feature(tool_lints)] + +#![allow(unused, clippy::many_single_char_names)] +#![warn(clippy::ptr_arg)] use std::borrow::Cow; diff --git a/tests/ui/range.rs b/tests/ui/range.rs index 7291fd5d5d3..df3ce12689b 100644 --- a/tests/ui/range.rs +++ b/tests/ui/range.rs @@ -1,11 +1,11 @@ - +#![feature(tool_lints)] struct NotARange; impl NotARange { fn step_by(&self, _: u32) {} } -#[warn(iterator_step_by_zero, range_zip_with_len)] +#[warn(clippy::iterator_step_by_zero, clippy::range_zip_with_len)] fn main() { let _ = (0..1).step_by(0); // No warning for non-zero step diff --git a/tests/ui/range_plus_minus_one.rs b/tests/ui/range_plus_minus_one.rs index 31574a4aeed..12a1312de36 100644 --- a/tests/ui/range_plus_minus_one.rs +++ b/tests/ui/range_plus_minus_one.rs @@ -1,8 +1,10 @@ +#![feature(tool_lints)] + fn f() -> usize { 42 } -#[warn(range_plus_one)] +#[warn(clippy::range_plus_one)] fn main() { for _ in 0..2 { } for _ in 0..=2 { } diff --git a/tests/ui/redundant_closure_call.rs b/tests/ui/redundant_closure_call.rs index ab3897bc315..b09ed9a3574 100644 --- a/tests/ui/redundant_closure_call.rs +++ b/tests/ui/redundant_closure_call.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(redundant_closure_call)] +#![warn(clippy::redundant_closure_call)] fn main() { let a = (|| 42)(); diff --git a/tests/ui/redundant_field_names.rs b/tests/ui/redundant_field_names.rs index dc8548754d2..b379aa661cb 100644 --- a/tests/ui/redundant_field_names.rs +++ b/tests/ui/redundant_field_names.rs @@ -1,4 +1,6 @@ -#![warn(redundant_field_names)] +#![feature(tool_lints)] + +#![warn(clippy::redundant_field_names)] #![allow(unused_variables)] #![feature(inclusive_range, inclusive_range_fields, inclusive_range_methods)] diff --git a/tests/ui/reference.rs b/tests/ui/reference.rs index 0bd000082e8..97a0030a99a 100644 --- a/tests/ui/reference.rs +++ b/tests/ui/reference.rs @@ -1,4 +1,4 @@ - +#![feature(tool_lints)] fn get_number() -> usize { @@ -9,9 +9,9 @@ fn get_reference(n : &usize) -> &usize { n } -#[allow(many_single_char_names, double_parens)] +#[allow(clippy::many_single_char_names, clippy::double_parens)] #[allow(unused_variables)] -#[warn(deref_addrof)] +#[warn(clippy::deref_addrof)] fn main() { let a = 10; let aref = &a; @@ -38,7 +38,7 @@ fn main() { let b = **&aref; //This produces a suggestion of 'let b = *&a;' which - //will trigger the 'deref_addrof' lint again + //will trigger the 'clippy::deref_addrof' lint again let b = **&&a; { @@ -48,7 +48,7 @@ fn main() { { //This produces a suggestion of 'let y = *&mut x' which - //will trigger the 'deref_addrof' lint again + //will trigger the 'clippy::deref_addrof' lint again let mut x = 10; let y = **&mut &mut x; } diff --git a/tests/ui/regex.rs b/tests/ui/regex.rs index b80aaa2df32..e3837e104f4 100644 --- a/tests/ui/regex.rs +++ b/tests/ui/regex.rs @@ -1,8 +1,8 @@ - +#![feature(tool_lints)] #![allow(unused)] -#![warn(invalid_regex, trivial_regex, regex_macro)] +#![warn(clippy::invalid_regex, clippy::trivial_regex, clippy::regex_macro)] extern crate regex; diff --git a/tests/ui/replace_consts.rs b/tests/ui/replace_consts.rs index 71d4ea98e07..8420b368d3d 100644 --- a/tests/ui/replace_consts.rs +++ b/tests/ui/replace_consts.rs @@ -1,6 +1,8 @@ +#![feature(tool_lints)] + #![feature(integer_atomics)] -#![allow(blacklisted_name)] -#![deny(replace_consts)] +#![allow(clippy::blacklisted_name)] +#![deny(clippy::replace_consts)] use std::sync::atomic::*; use std::sync::{ONCE_INIT, Once}; diff --git a/tests/ui/result_map_unit_fn.rs b/tests/ui/result_map_unit_fn.rs index dd163439d78..8cac6a9c827 100644 --- a/tests/ui/result_map_unit_fn.rs +++ b/tests/ui/result_map_unit_fn.rs @@ -1,5 +1,7 @@ +#![feature(tool_lints)] + #![feature(never_type)] -#![warn(result_map_unit_fn)] +#![warn(clippy::result_map_unit_fn)] #![allow(unused)] fn do_nothing(_: T) {} diff --git a/tests/ui/serde.rs b/tests/ui/serde.rs index 792ebc9b0ea..65c2c344da7 100644 --- a/tests/ui/serde.rs +++ b/tests/ui/serde.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![warn(serde_api_misuse)] +#![warn(clippy::serde_api_misuse)] #![allow(dead_code)] extern crate serde; diff --git a/tests/ui/shadow.rs b/tests/ui/shadow.rs index 79c1030d48b..c73acf5c5dd 100644 --- a/tests/ui/shadow.rs +++ b/tests/ui/shadow.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(clippy, clippy_pedantic, shadow_same, shadow_reuse, shadow_unrelated)] -#![allow(unused_parens, unused_variables, missing_docs_in_private_items)] +#![warn(clippy::all, clippy::pedantic, clippy::shadow_same, clippy::shadow_reuse, clippy::shadow_unrelated)] +#![allow(unused_parens, unused_variables, clippy::missing_docs_in_private_items)] fn id(x: T) -> T { x } diff --git a/tests/ui/short_circuit_statement.rs b/tests/ui/short_circuit_statement.rs index 0f5773623be..e9cb8e4ad8c 100644 --- a/tests/ui/short_circuit_statement.rs +++ b/tests/ui/short_circuit_statement.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(short_circuit_statement)] +#![warn(clippy::short_circuit_statement)] fn main() { f() && g(); diff --git a/tests/ui/single_char_pattern.rs b/tests/ui/single_char_pattern.rs index 577a0e27090..147f974b999 100644 --- a/tests/ui/single_char_pattern.rs +++ b/tests/ui/single_char_pattern.rs @@ -1,3 +1,5 @@ +#![feature(tool_lints)] + use std::collections::HashSet; fn main() { @@ -9,7 +11,7 @@ fn main() { let y = "x"; x.split(y); // Not yet testing for multi-byte characters - // Changing `r.len() == 1` to `r.chars().count() == 1` in `lint_single_char_pattern` + // Changing `r.len() == 1` to `r.chars().count() == 1` in `lint_clippy::single_char_pattern` // should have done this but produced an ICE // // We may not want to suggest changing these anyway diff --git a/tests/ui/single_match.rs b/tests/ui/single_match.rs index b064eed5711..c0c82adafb5 100644 --- a/tests/ui/single_match.rs +++ b/tests/ui/single_match.rs @@ -1,4 +1,6 @@ -#![warn(single_match)] +#![feature(tool_lints)] + +#![warn(clippy::single_match)] fn dummy() { } diff --git a/tests/ui/starts_ends_with.rs b/tests/ui/starts_ends_with.rs index d47c8a5b076..adea56cf9a2 100644 --- a/tests/ui/starts_ends_with.rs +++ b/tests/ui/starts_ends_with.rs @@ -1,8 +1,10 @@ +#![feature(tool_lints)] + #![allow(dead_code)] fn main() {} -#[allow(unnecessary_operation)] +#[allow(clippy::unnecessary_operation)] fn starts_with() { "".chars().next() == Some(' '); Some(' ') != "".chars().next(); @@ -30,7 +32,7 @@ fn chars_cmp_with_unwrap() { } } -#[allow(unnecessary_operation)] +#[allow(clippy::unnecessary_operation)] fn ends_with() { "".chars().last() == Some(' '); Some(' ') != "".chars().last(); diff --git a/tests/ui/strings.rs b/tests/ui/strings.rs index 66d24a3c070..86819e3fd5c 100644 --- a/tests/ui/strings.rs +++ b/tests/ui/strings.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#[warn(string_add)] -#[allow(string_add_assign)] +#[warn(clippy::string_add)] +#[allow(clippy::string_add_assign)] fn add_only() { // ignores assignment distinction let mut x = "".to_owned(); @@ -16,7 +16,7 @@ fn add_only() { // ignores assignment distinction assert_eq!(&x, &z); } -#[warn(string_add_assign)] +#[warn(clippy::string_add_assign)] fn add_assign_only() { let mut x = "".to_owned(); @@ -30,7 +30,7 @@ fn add_assign_only() { assert_eq!(&x, &z); } -#[warn(string_add, string_add_assign)] +#[warn(clippy::string_add, clippy::string_add_assign)] fn both() { let mut x = "".to_owned(); @@ -45,7 +45,7 @@ fn both() { } #[allow(dead_code, unused_variables)] -#[warn(string_lit_as_bytes)] +#[warn(clippy::string_lit_as_bytes)] fn str_lit_as_bytes() { let bs = "hello there".as_bytes(); diff --git a/tests/ui/stutter.rs b/tests/ui/stutter.rs index 761339b0a8e..de67bb1aff5 100644 --- a/tests/ui/stutter.rs +++ b/tests/ui/stutter.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![warn(stutter)] +#![warn(clippy::stutter)] #![allow(dead_code)] mod foo { diff --git a/tests/ui/suspicious_arithmetic_impl.rs b/tests/ui/suspicious_arithmetic_impl.rs index 9f6fce2495a..04e235c690b 100644 --- a/tests/ui/suspicious_arithmetic_impl.rs +++ b/tests/ui/suspicious_arithmetic_impl.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(suspicious_arithmetic_impl)] +#![warn(clippy::suspicious_arithmetic_impl)] use std::ops::{Add, AddAssign, Mul, Sub, Div}; #[derive(Copy, Clone)] diff --git a/tests/ui/swap.rs b/tests/ui/swap.rs index d1d12641c46..377319e8faa 100644 --- a/tests/ui/swap.rs +++ b/tests/ui/swap.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(clippy)] -#![allow(blacklisted_name, unused_assignments)] +#![warn(clippy::all)] +#![allow(clippy::blacklisted_name, unused_assignments)] struct Foo(u32); diff --git a/tests/ui/temporary_assignment.rs b/tests/ui/temporary_assignment.rs index 8f25aad72bb..1d0cffcfc0a 100644 --- a/tests/ui/temporary_assignment.rs +++ b/tests/ui/temporary_assignment.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(temporary_assignment)] +#![warn(clippy::temporary_assignment)] use std::ops::{Deref, DerefMut}; diff --git a/tests/ui/toplevel_ref_arg.rs b/tests/ui/toplevel_ref_arg.rs index a0d6dd2dabd..86eb7fa5565 100644 --- a/tests/ui/toplevel_ref_arg.rs +++ b/tests/ui/toplevel_ref_arg.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(clippy)] +#![warn(clippy::all)] #![allow(unused)] fn the_answer(ref mut x: u8) { diff --git a/tests/ui/transmute.rs b/tests/ui/transmute.rs index 54e1734e141..34d50da11ca 100644 --- a/tests/ui/transmute.rs +++ b/tests/ui/transmute.rs @@ -1,4 +1,4 @@ - +#![feature(tool_lints)] #![allow(dead_code)] @@ -16,8 +16,8 @@ fn my_vec() -> MyVec { vec![] } -#[allow(needless_lifetimes, transmute_ptr_to_ptr)] -#[warn(useless_transmute)] +#[allow(clippy::needless_lifetimes, clippy::transmute_ptr_to_ptr)] +#[warn(clippy::useless_transmute)] unsafe fn _generic<'a, T, U: 'a>(t: &'a T) { let _: &'a T = core::intrinsics::transmute(t); @@ -30,7 +30,7 @@ unsafe fn _generic<'a, T, U: 'a>(t: &'a T) { let _: *const U = core::intrinsics::transmute(t); } -#[warn(transmute_ptr_to_ref)] +#[warn(clippy::transmute_ptr_to_ref)] unsafe fn _ptr_to_ref(p: *const T, m: *mut T, o: *const U, om: *mut U) { let _: &T = std::mem::transmute(p); let _: &T = &*p; @@ -54,7 +54,7 @@ unsafe fn _ptr_to_ref(p: *const T, m: *mut T, o: *const U, om: *mut U) { let _: &T = &*(om as *const T); } -#[warn(transmute_ptr_to_ref)] +#[warn(clippy::transmute_ptr_to_ref)] fn issue1231() { struct Foo<'a, T: 'a> { bar: &'a T, @@ -70,7 +70,7 @@ fn issue1231() { unsafe { std::mem::transmute::<_, Bar>(raw) }; } -#[warn(useless_transmute)] +#[warn(clippy::useless_transmute)] fn useless() { unsafe { let _: Vec = core::intrinsics::transmute(my_vec()); @@ -101,7 +101,7 @@ fn useless() { struct Usize(usize); -#[warn(crosspointer_transmute)] +#[warn(clippy::crosspointer_transmute)] fn crosspointer() { let mut int: Usize = Usize(0); let int_const_ptr: *const Usize = &int as *const Usize; @@ -118,18 +118,18 @@ fn crosspointer() { } } -#[warn(transmute_int_to_char)] +#[warn(clippy::transmute_int_to_char)] fn int_to_char() { let _: char = unsafe { std::mem::transmute(0_u32) }; let _: char = unsafe { std::mem::transmute(0_i32) }; } -#[warn(transmute_int_to_bool)] +#[warn(clippy::transmute_int_to_bool)] fn int_to_bool() { let _: bool = unsafe { std::mem::transmute(0_u8) }; } -#[warn(transmute_int_to_float)] +#[warn(clippy::transmute_int_to_float)] fn int_to_float() { let _: f32 = unsafe { std::mem::transmute(0_u32) }; let _: f32 = unsafe { std::mem::transmute(0_i32) }; @@ -144,13 +144,13 @@ fn bytes_to_str(b: &[u8], mb: &mut [u8]) { // of transmute // Make sure we can do static lifetime transmutes -#[warn(transmute_ptr_to_ptr)] +#[warn(clippy::transmute_ptr_to_ptr)] unsafe fn transmute_lifetime_to_static<'a, T>(t: &'a T) -> &'static T { std::mem::transmute::<&'a T, &'static T>(t) } // Make sure we can do non-static lifetime transmutes -#[warn(transmute_ptr_to_ptr)] +#[warn(clippy::transmute_ptr_to_ptr)] unsafe fn transmute_lifetime<'a, 'b, T>(t: &'a T, u: &'b T) -> &'b T { std::mem::transmute::<&'a T, &'b T>(t) } @@ -163,7 +163,7 @@ struct GenericParam { t: T, } -#[warn(transmute_ptr_to_ptr)] +#[warn(clippy::transmute_ptr_to_ptr)] fn transmute_ptr_to_ptr() { let ptr = &1u32 as *const u32; let mut_ptr = &mut 1u32 as *mut u32; diff --git a/tests/ui/transmute_64bit.rs b/tests/ui/transmute_64bit.rs index 65240c80a48..539b403cff9 100644 --- a/tests/ui/transmute_64bit.rs +++ b/tests/ui/transmute_64bit.rs @@ -1,9 +1,11 @@ +#![feature(tool_lints)] + //ignore-x86 //no-ignore-x86_64 -#[warn(wrong_transmute)] +#[warn(clippy::wrong_transmute)] fn main() { unsafe { let _: *const usize = std::mem::transmute(6.0f64); diff --git a/tests/ui/trivially_copy_pass_by_ref.rs b/tests/ui/trivially_copy_pass_by_ref.rs index a1a1de1e439..e3dbe510a47 100644 --- a/tests/ui/trivially_copy_pass_by_ref.rs +++ b/tests/ui/trivially_copy_pass_by_ref.rs @@ -1,4 +1,6 @@ -#![allow(many_single_char_names, blacklisted_name, redundant_field_names)] +#![feature(tool_lints)] + +#![allow(clippy::many_single_char_names, clippy::blacklisted_name, clippy::redundant_field_names)] #[derive(Copy, Clone)] struct Foo(u32); @@ -19,7 +21,7 @@ fn good_return_implicit_lt_ref(foo: &Foo) -> &u32 { &foo.0 } -#[allow(needless_lifetimes)] +#[allow(clippy::needless_lifetimes)] fn good_return_explicit_lt_ref<'a>(foo: &'a Foo) -> &'a u32 { &foo.0 } @@ -30,7 +32,7 @@ fn good_return_implicit_lt_struct(foo: &Foo) -> FooRef { } } -#[allow(needless_lifetimes)] +#[allow(clippy::needless_lifetimes)] fn good_return_explicit_lt_struct<'a>(foo: &'a Foo) -> FooRef<'a> { FooRef { foo, diff --git a/tests/ui/unicode.rs b/tests/ui/unicode.rs index 5bb0e7edfed..b997d6d3f14 100644 --- a/tests/ui/unicode.rs +++ b/tests/ui/unicode.rs @@ -1,19 +1,19 @@ +#![feature(tool_lints)] - -#[warn(zero_width_space)] +#[warn(clippy::zero_width_space)] fn zero() { print!("Here >​< is a ZWS, and ​another"); print!("This\u{200B}is\u{200B}fine"); } -#[warn(unicode_not_nfc)] +#[warn(clippy::unicode_not_nfc)] fn canon() { print!("̀àh?"); print!("a\u{0300}h?"); // also okay } -#[warn(non_ascii_literal)] +#[warn(clippy::non_ascii_literal)] fn uni() { print!("Üben!"); print!("\u{DC}ben!"); // this is okay diff --git a/tests/ui/unit_arg.rs b/tests/ui/unit_arg.rs index 8f290446b5e..2f743f227b8 100644 --- a/tests/ui/unit_arg.rs +++ b/tests/ui/unit_arg.rs @@ -1,5 +1,7 @@ -#![warn(unit_arg)] -#![allow(no_effect)] +#![feature(tool_lints)] + +#![warn(clippy::unit_arg)] +#![allow(clippy::no_effect)] use std::fmt::Debug; diff --git a/tests/ui/unit_cmp.rs b/tests/ui/unit_cmp.rs index 2b6d757845f..bd79d0f8189 100644 --- a/tests/ui/unit_cmp.rs +++ b/tests/ui/unit_cmp.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(unit_cmp)] -#![allow(no_effect, unnecessary_operation)] +#![warn(clippy::unit_cmp)] +#![allow(clippy::no_effect, clippy::unnecessary_operation)] #[derive(PartialEq)] pub struct ContainsUnit(()); // should be fine diff --git a/tests/ui/unnecessary_clone.rs b/tests/ui/unnecessary_clone.rs index 96166ed4f13..7a2fc4ac1f6 100644 --- a/tests/ui/unnecessary_clone.rs +++ b/tests/ui/unnecessary_clone.rs @@ -1,4 +1,6 @@ -#![warn(clone_on_ref_ptr)] +#![feature(tool_lints)] + +#![warn(clippy::clone_on_ref_ptr)] #![allow(unused)] use std::collections::HashSet; @@ -40,7 +42,7 @@ fn clone_on_ref_ptr() { sync::Weak::clone(&arc_weak); let x = Arc::new(SomeImpl); - let _: Arc = x.clone(); + let _: Arc = x.clone(); } fn clone_on_copy_generic(t: T) { diff --git a/tests/ui/unnecessary_ref.rs b/tests/ui/unnecessary_ref.rs index 53b970dfa72..afc920832ce 100644 --- a/tests/ui/unnecessary_ref.rs +++ b/tests/ui/unnecessary_ref.rs @@ -1,3 +1,5 @@ +#![feature(tool_lints)] + #![feature(tool_attributes)] #![feature(stmt_expr_attributes)] @@ -5,7 +7,7 @@ struct Outer { inner: u32, } -#[deny(ref_in_deref)] +#[deny(clippy::ref_in_deref)] fn main() { let outer = Outer { inner: 0 }; let inner = (&outer).inner; diff --git a/tests/ui/unneeded_field_pattern.rs b/tests/ui/unneeded_field_pattern.rs index 8c960602264..88b91235df6 100644 --- a/tests/ui/unneeded_field_pattern.rs +++ b/tests/ui/unneeded_field_pattern.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![warn(unneeded_field_pattern)] +#![warn(clippy::unneeded_field_pattern)] #[allow(dead_code, unused)] struct Foo { diff --git a/tests/ui/unreadable_literal.rs b/tests/ui/unreadable_literal.rs index 0ec757cfbcf..df3539e38e8 100644 --- a/tests/ui/unreadable_literal.rs +++ b/tests/ui/unreadable_literal.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#[warn(unreadable_literal)] +#[warn(clippy::unreadable_literal)] #[allow(unused_variables)] fn main() { let good = (0b1011_i64, 0o1_234_u32, 0x1_234_567, 65536, 1_2345_6789, 1234_f32, 1_234.12_f32, 1_234.123_f32, 1.123_4_f32); diff --git a/tests/ui/unsafe_removed_from_name.rs b/tests/ui/unsafe_removed_from_name.rs index 29f34d31a8e..41b98975d53 100644 --- a/tests/ui/unsafe_removed_from_name.rs +++ b/tests/ui/unsafe_removed_from_name.rs @@ -1,8 +1,8 @@ - +#![feature(tool_lints)] #![allow(unused_imports)] #![allow(dead_code)] -#![warn(unsafe_removed_from_name)] +#![warn(clippy::unsafe_removed_from_name)] use std::cell::{UnsafeCell as TotallySafeCell}; diff --git a/tests/ui/unused_io_amount.rs b/tests/ui/unused_io_amount.rs index ea72c1b1b70..53bcbce9dbf 100644 --- a/tests/ui/unused_io_amount.rs +++ b/tests/ui/unused_io_amount.rs @@ -1,8 +1,8 @@ - +#![feature(tool_lints)] #![allow(dead_code)] -#![warn(unused_io_amount)] +#![warn(clippy::unused_io_amount)] use std::io; diff --git a/tests/ui/unused_labels.rs b/tests/ui/unused_labels.rs index 115121dc275..b76fcad1699 100644 --- a/tests/ui/unused_labels.rs +++ b/tests/ui/unused_labels.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![allow(dead_code, items_after_statements, never_loop)] -#![warn(unused_label)] +#![allow(dead_code, clippy::items_after_statements, clippy::never_loop)] +#![warn(clippy::unused_label)] fn unused_label() { 'label: for i in 1..2 { diff --git a/tests/ui/unused_lt.rs b/tests/ui/unused_lt.rs index 8b166a34d29..e5c5e893504 100644 --- a/tests/ui/unused_lt.rs +++ b/tests/ui/unused_lt.rs @@ -1,7 +1,7 @@ +#![feature(tool_lints)] - -#![allow(unused, dead_code, needless_lifetimes, needless_pass_by_value, trivially_copy_pass_by_ref)] -#![warn(extra_unused_lifetimes)] +#![allow(unused, dead_code, clippy::needless_lifetimes, clippy::needless_pass_by_value, clippy::trivially_copy_pass_by_ref)] +#![warn(clippy::extra_unused_lifetimes)] fn empty() { diff --git a/tests/ui/unwrap_or.rs b/tests/ui/unwrap_or.rs index 79e3900fef0..682c42dc935 100644 --- a/tests/ui/unwrap_or.rs +++ b/tests/ui/unwrap_or.rs @@ -1,4 +1,5 @@ -#![warn(clippy)] +#![feature(tool_lints)] +#![warn(clippy::all)] fn main() { let s = Some(String::from("test string")).unwrap_or("Fail".to_string()).len(); diff --git a/tests/ui/use_self.rs b/tests/ui/use_self.rs index 689c9d68d12..8d18d848ae0 100644 --- a/tests/ui/use_self.rs +++ b/tests/ui/use_self.rs @@ -1,6 +1,8 @@ -#![warn(use_self)] +#![feature(tool_lints)] + +#![warn(clippy::use_self)] #![allow(dead_code)] -#![allow(should_implement_trait)] +#![allow(clippy::should_implement_trait)] fn main() {} @@ -64,7 +66,7 @@ mod lifetimes { } } -#[allow(boxed_local)] +#[allow(clippy::boxed_local)] mod traits { use std::ops::Mul; diff --git a/tests/ui/used_underscore_binding.rs b/tests/ui/used_underscore_binding.rs index 60a2c4e8b4c..c1e1c9af5db 100644 --- a/tests/ui/used_underscore_binding.rs +++ b/tests/ui/used_underscore_binding.rs @@ -1,9 +1,9 @@ +#![feature(tool_lints)] +#![warn(clippy::all)] -#![warn(clippy)] - -#![allow(blacklisted_name)] -#![warn(used_underscore_binding)] +#![allow(clippy::blacklisted_name)] +#![warn(clippy::used_underscore_binding)] macro_rules! test_macro { () => {{ diff --git a/tests/ui/useless_asref.rs b/tests/ui/useless_asref.rs index 7508cdc7b43..52994566e09 100644 --- a/tests/ui/useless_asref.rs +++ b/tests/ui/useless_asref.rs @@ -1,10 +1,12 @@ -#![deny(useless_asref)] -#![allow(trivially_copy_pass_by_ref)] +#![feature(tool_lints)] + +#![deny(clippy::useless_asref)] +#![allow(clippy::trivially_copy_pass_by_ref)] use std::fmt::Debug; struct FakeAsRef; -#[allow(should_implement_trait)] +#[allow(clippy::should_implement_trait)] impl FakeAsRef { fn as_ref(&self) -> &Self { self } } diff --git a/tests/ui/useless_attribute.rs b/tests/ui/useless_attribute.rs index 68c7d2007a6..300fcfa2b70 100644 --- a/tests/ui/useless_attribute.rs +++ b/tests/ui/useless_attribute.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![warn(useless_attribute)] +#![warn(clippy::useless_attribute)] #[allow(dead_code, unused_extern_crates)] #[cfg_attr(feature = "cargo-clippy", allow(dead_code, unused_extern_crates))] diff --git a/tests/ui/vec.rs b/tests/ui/vec.rs index 23e43872454..78a49f2580a 100644 --- a/tests/ui/vec.rs +++ b/tests/ui/vec.rs @@ -1,13 +1,13 @@ +#![feature(tool_lints)] - -#![warn(useless_vec)] +#![warn(clippy::useless_vec)] #[derive(Debug)] struct NonCopy; fn on_slice(_: &[u8]) {} -#[allow(ptr_arg)] +#[allow(clippy::ptr_arg)] fn on_vec(_: &Vec) {} struct Line { diff --git a/tests/ui/while_loop.rs b/tests/ui/while_loop.rs index 23a9ce80eb1..0b8691d57b4 100644 --- a/tests/ui/while_loop.rs +++ b/tests/ui/while_loop.rs @@ -1,8 +1,8 @@ +#![feature(tool_lints)] - -#![warn(while_let_loop, empty_loop, while_let_on_iterator)] -#![allow(dead_code, never_loop, unused, cyclomatic_complexity)] +#![warn(clippy::while_let_loop, clippy::empty_loop, clippy::while_let_on_iterator)] +#![allow(dead_code, clippy::never_loop, unused, clippy::cyclomatic_complexity)] fn main() { let y = Some(true); @@ -184,7 +184,7 @@ fn refutable() { } } - // should not trigger while_let_loop lint because break passes an expression + // should not trigger clippy::while_let_loop lint because break passes an expression let a = Some(10); let b = loop { if let Some(c) = a { diff --git a/tests/ui/write_literal.rs b/tests/ui/write_literal.rs index 48dfcd0ea3e..5ef4c15f409 100644 --- a/tests/ui/write_literal.rs +++ b/tests/ui/write_literal.rs @@ -1,5 +1,7 @@ +#![feature(tool_lints)] + #![allow(unused_must_use)] -#![warn(write_literal)] +#![warn(clippy::write_literal)] use std::io::Write; diff --git a/tests/ui/write_with_newline.rs b/tests/ui/write_with_newline.rs index 8badbd65726..e060459a411 100644 --- a/tests/ui/write_with_newline.rs +++ b/tests/ui/write_with_newline.rs @@ -1,5 +1,7 @@ -#![allow(write_literal)] -#![warn(write_with_newline)] +#![feature(tool_lints)] + +#![allow(clippy::write_literal)] +#![warn(clippy::write_with_newline)] use std::io::Write; diff --git a/tests/ui/writeln_empty_string.rs b/tests/ui/writeln_empty_string.rs index faccfd8291c..81dfdcdc0d0 100644 --- a/tests/ui/writeln_empty_string.rs +++ b/tests/ui/writeln_empty_string.rs @@ -1,5 +1,7 @@ +#![feature(tool_lints)] + #![allow(unused_must_use)] -#![warn(writeln_empty_string)] +#![warn(clippy::writeln_empty_string)] use std::io::Write; fn main() { diff --git a/tests/ui/wrong_self_convention.rs b/tests/ui/wrong_self_convention.rs index 07a93d6889b..1e718c1c648 100644 --- a/tests/ui/wrong_self_convention.rs +++ b/tests/ui/wrong_self_convention.rs @@ -1,9 +1,9 @@ +#![feature(tool_lints)] - -#![warn(wrong_self_convention)] -#![warn(wrong_pub_self_convention)] -#![allow(dead_code, trivially_copy_pass_by_ref)] +#![warn(clippy::wrong_self_convention)] +#![warn(clippy::wrong_pub_self_convention)] +#![allow(dead_code, clippy::trivially_copy_pass_by_ref)] fn main() {} @@ -26,7 +26,7 @@ impl Foo { pub fn to_i64(self) {} pub fn from_i64(self) {} // check whether the lint can be allowed at the function level - #[allow(wrong_self_convention)] + #[allow(clippy::wrong_self_convention)] pub fn from_cake(self) {} fn as_x>(_: F) { } diff --git a/tests/ui/zero_div_zero.rs b/tests/ui/zero_div_zero.rs index 65e1e239980..7927e8b8ac7 100644 --- a/tests/ui/zero_div_zero.rs +++ b/tests/ui/zero_div_zero.rs @@ -1,8 +1,8 @@ - +#![feature(tool_lints)] #[allow(unused_variables)] -#[warn(zero_divided_by_zero)] +#[warn(clippy::zero_divided_by_zero)] fn main() { let nan = 0.0 / 0.0; let f64_nan = 0.0 / 0.0f64;