From edadbff4eadae43ec5f6845c69ad653566c0e6f3 Mon Sep 17 00:00:00 2001 From: messense Date: Mon, 3 Jul 2017 12:26:03 +0800 Subject: [PATCH 1/4] Fix compilation on rustc 1.20.0-nightly (067971139 2017-07-02) --- src/main.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1b3dd4f05e05..b8cc7adb083c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ extern crate rustc_plugin; extern crate syntax; use rustc_driver::{driver, CompilerCalls, RustcDefaultCalls, Compilation}; -use rustc::session::{config, Session}; +use rustc::session::{config, Session, CompileIncomplete}; use rustc::session::config::{Input, ErrorOutputType}; use std::path::PathBuf; use std::process::{self, Command}; @@ -278,10 +278,8 @@ pub fn main() { let mut ccc = ClippyCompilerCalls::new(clippy_enabled); let (result, _) = rustc_driver::run_compiler(&args, &mut ccc, None, None); - if let Err(err_count) = result { - if err_count > 0 { - std::process::exit(1); - } + if let Err(CompileIncomplete::Errored(_)) = result { + std::process::exit(1); } }) .expect("rustc_thread failed"); From 95f04f80fb50dc3c3648cbdd4ecefb9fe508f303 Mon Sep 17 00:00:00 2001 From: messense Date: Mon, 3 Jul 2017 12:37:14 +0800 Subject: [PATCH 2/4] Update ui tests --- tests/ui-posix/conf_non_existant.stderr | 2 +- tests/ui/builtin-type-shadow.stderr | 2 +- tests/ui/conf_bad_arg.stderr | 2 +- tests/ui/conf_bad_toml.stderr | 2 +- tests/ui/conf_bad_type.stderr | 2 +- tests/ui/conf_french_blacklisted_name.stderr | 12 ------ tests/ui/conf_path_non_string.stderr | 2 +- tests/ui/conf_unknown_key.stderr | 2 +- tests/ui/ices.stderr | 2 +- tests/ui/transmute.stderr | 44 -------------------- tests/ui/transmute_64bit.stderr | 2 - 11 files changed, 8 insertions(+), 66 deletions(-) diff --git a/tests/ui-posix/conf_non_existant.stderr b/tests/ui-posix/conf_non_existant.stderr index a7f000800014..7920bd35589d 100644 --- a/tests/ui-posix/conf_non_existant.stderr +++ b/tests/ui-posix/conf_non_existant.stderr @@ -1,4 +1,4 @@ error: error reading Clippy's configuration file: No such file or directory (os error 2) -error: aborting due to previous error(s) +error: aborting due to previous error diff --git a/tests/ui/builtin-type-shadow.stderr b/tests/ui/builtin-type-shadow.stderr index 59d034821235..269ff9a0eef5 100644 --- a/tests/ui/builtin-type-shadow.stderr +++ b/tests/ui/builtin-type-shadow.stderr @@ -15,5 +15,5 @@ error[E0308]: mismatched types = note: expected type `u32` found type `{integer}` -error: aborting due to previous error(s) +error: aborting due to previous error diff --git a/tests/ui/conf_bad_arg.stderr b/tests/ui/conf_bad_arg.stderr index 35f70338017e..92b3c82d4583 100644 --- a/tests/ui/conf_bad_arg.stderr +++ b/tests/ui/conf_bad_arg.stderr @@ -10,5 +10,5 @@ note: Clippy will use default configuration 4 | #![plugin(clippy(conf_file))] | ^^^^^^^^^ -error: aborting due to previous error(s) +error: aborting due to previous error diff --git a/tests/ui/conf_bad_toml.stderr b/tests/ui/conf_bad_toml.stderr index b8bfeb333bd8..8ee392f89248 100644 --- a/tests/ui/conf_bad_toml.stderr +++ b/tests/ui/conf_bad_toml.stderr @@ -1,4 +1,4 @@ error: error reading Clippy's configuration file: expected an equals, found an identifier at line 1 -error: aborting due to previous error(s) +error: aborting due to previous error diff --git a/tests/ui/conf_bad_type.stderr b/tests/ui/conf_bad_type.stderr index ee9bbeef81f9..5cb4d05afef2 100644 --- a/tests/ui/conf_bad_type.stderr +++ b/tests/ui/conf_bad_type.stderr @@ -1,4 +1,4 @@ error: error reading Clippy's configuration file: invalid type: integer `42`, expected a sequence -error: aborting due to previous error(s) +error: aborting due to previous error diff --git a/tests/ui/conf_french_blacklisted_name.stderr b/tests/ui/conf_french_blacklisted_name.stderr index 3d6926a9b882..b6782ae4212e 100644 --- a/tests/ui/conf_french_blacklisted_name.stderr +++ b/tests/ui/conf_french_blacklisted_name.stderr @@ -11,46 +11,34 @@ warning: use of a blacklisted/placeholder name `toto` | 12 | let toto = 42; | ^^^^ - | - = note: #[warn(blacklisted_name)] on by default warning: use of a blacklisted/placeholder name `tata` --> $DIR/conf_french_blacklisted_name.rs:13:9 | 13 | let tata = 42; | ^^^^ - | - = note: #[warn(blacklisted_name)] on by default warning: use of a blacklisted/placeholder name `titi` --> $DIR/conf_french_blacklisted_name.rs:14:9 | 14 | let titi = 42; | ^^^^ - | - = note: #[warn(blacklisted_name)] on by default warning: use of a blacklisted/placeholder name `toto` --> $DIR/conf_french_blacklisted_name.rs:20:10 | 20 | (toto, Some(tata), titi @ Some(_)) => (), | ^^^^ - | - = note: #[warn(blacklisted_name)] on by default warning: use of a blacklisted/placeholder name `tata` --> $DIR/conf_french_blacklisted_name.rs:20:21 | 20 | (toto, Some(tata), titi @ Some(_)) => (), | ^^^^ - | - = note: #[warn(blacklisted_name)] on by default warning: use of a blacklisted/placeholder name `titi` --> $DIR/conf_french_blacklisted_name.rs:20:28 | 20 | (toto, Some(tata), titi @ Some(_)) => (), | ^^^^ - | - = note: #[warn(blacklisted_name)] on by default diff --git a/tests/ui/conf_path_non_string.stderr b/tests/ui/conf_path_non_string.stderr index fd893ab370df..3bf53f10cce4 100644 --- a/tests/ui/conf_path_non_string.stderr +++ b/tests/ui/conf_path_non_string.stderr @@ -10,5 +10,5 @@ note: Clippy will use default configuration 3 | #![plugin(clippy(conf_file=42))] | ^^ -error: aborting due to previous error(s) +error: aborting due to previous error diff --git a/tests/ui/conf_unknown_key.stderr b/tests/ui/conf_unknown_key.stderr index b28224a78071..bd16dfd47da9 100644 --- a/tests/ui/conf_unknown_key.stderr +++ b/tests/ui/conf_unknown_key.stderr @@ -1,4 +1,4 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expected one of `blacklisted-names`, `cyclomatic-complexity-threshold`, `doc-valid-idents`, `too-many-arguments-threshold`, `type-complexity-threshold`, `single-char-binding-names-threshold`, `too-large-for-stack`, `enum-variant-name-threshold`, `enum-variant-size-threshold`, `third-party` -error: aborting due to previous error(s) +error: aborting due to previous error diff --git a/tests/ui/ices.stderr b/tests/ui/ices.stderr index cc681100730b..cadd7cd417d4 100644 --- a/tests/ui/ices.stderr +++ b/tests/ui/ices.stderr @@ -4,5 +4,5 @@ error: cannot find macro `fubar!` in this scope 3 | fubar!(); | ^^^^^ -error: aborting due to previous error(s) +error: aborting due to previous error diff --git a/tests/ui/transmute.stderr b/tests/ui/transmute.stderr index b70e5e088307..f878b6ad1730 100644 --- a/tests/ui/transmute.stderr +++ b/tests/ui/transmute.stderr @@ -11,24 +11,18 @@ warning: transmute from a reference to a pointer | 26 | let _: *const T = core::intrinsics::transmute(t); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `t as *const T` - | - = note: #[warn(useless_transmute)] on by default warning: transmute from a reference to a pointer --> $DIR/transmute.rs:28:21 | 28 | let _: *mut T = core::intrinsics::transmute(t); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `t as *const T as *mut T` - | - = note: #[warn(useless_transmute)] on by default warning: transmute from a reference to a pointer --> $DIR/transmute.rs:30:23 | 30 | let _: *const U = core::intrinsics::transmute(t); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `t as *const T as *const U` - | - = note: #[warn(useless_transmute)] on by default warning: transmute from a pointer type (`*const T`) to a reference type (`&T`) --> $DIR/transmute.rs:35:17 @@ -43,128 +37,96 @@ warning: transmute from a pointer type (`*mut T`) to a reference type (`&mut T`) | 38 | let _: &mut T = std::mem::transmute(m); | ^^^^^^^^^^^^^^^^^^^^^^ help: try `&mut *m` - | - = note: #[warn(transmute_ptr_to_ref)] on by default warning: transmute from a pointer type (`*mut T`) to a reference type (`&T`) --> $DIR/transmute.rs:41:17 | 41 | let _: &T = std::mem::transmute(m); | ^^^^^^^^^^^^^^^^^^^^^^ help: try `&*m` - | - = note: #[warn(transmute_ptr_to_ref)] on by default warning: transmute from a pointer type (`*mut T`) to a reference type (`&mut T`) --> $DIR/transmute.rs:44:21 | 44 | let _: &mut T = std::mem::transmute(p as *mut T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `&mut *(p as *mut T)` - | - = note: #[warn(transmute_ptr_to_ref)] on by default warning: transmute from a pointer type (`*const U`) to a reference type (`&T`) --> $DIR/transmute.rs:47:17 | 47 | let _: &T = std::mem::transmute(o); | ^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(o as *const T)` - | - = note: #[warn(transmute_ptr_to_ref)] on by default warning: transmute from a pointer type (`*mut U`) to a reference type (`&mut T`) --> $DIR/transmute.rs:50:21 | 50 | let _: &mut T = std::mem::transmute(om); | ^^^^^^^^^^^^^^^^^^^^^^^ help: try `&mut *(om as *mut T)` - | - = note: #[warn(transmute_ptr_to_ref)] on by default warning: transmute from a pointer type (`*mut U`) to a reference type (`&T`) --> $DIR/transmute.rs:53:17 | 53 | let _: &T = std::mem::transmute(om); | ^^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(om as *const T)` - | - = note: #[warn(transmute_ptr_to_ref)] on by default warning: transmute from a pointer type (`*const i32`) to a reference type (`&issue1231::Foo<'_, u8>`) --> $DIR/transmute.rs:64:32 | 64 | let _: &Foo = unsafe { std::mem::transmute::<_, &Foo<_>>(raw) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(raw as *const Foo<_>)` - | - = note: #[warn(transmute_ptr_to_ref)] on by default warning: transmute from a pointer type (`*const i32`) to a reference type (`&issue1231::Foo<'_, &u8>`) --> $DIR/transmute.rs:66:33 | 66 | let _: &Foo<&u8> = unsafe { std::mem::transmute::<_, &Foo<&_>>(raw) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(raw as *const Foo<&_>)` - | - = note: #[warn(transmute_ptr_to_ref)] on by default warning: transmute from a pointer type (`*const i32`) to a reference type (`&u8`) --> $DIR/transmute.rs:70:14 | 70 | unsafe { std::mem::transmute::<_, Bar>(raw) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `&*(raw as *const u8)` - | - = note: #[warn(transmute_ptr_to_ref)] on by default warning: transmute from a type (`std::vec::Vec`) to itself --> $DIR/transmute.rs:76:27 | 76 | let _: Vec = core::intrinsics::transmute(my_vec()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: #[warn(useless_transmute)] on by default warning: transmute from a type (`std::vec::Vec`) to itself --> $DIR/transmute.rs:78:27 | 78 | let _: Vec = core::mem::transmute(my_vec()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: #[warn(useless_transmute)] on by default warning: transmute from a type (`std::vec::Vec`) to itself --> $DIR/transmute.rs:80:27 | 80 | let _: Vec = std::intrinsics::transmute(my_vec()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: #[warn(useless_transmute)] on by default warning: transmute from a type (`std::vec::Vec`) to itself --> $DIR/transmute.rs:82:27 | 82 | let _: Vec = std::mem::transmute(my_vec()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: #[warn(useless_transmute)] on by default warning: transmute from a type (`std::vec::Vec`) to itself --> $DIR/transmute.rs:84:27 | 84 | let _: Vec = my_transmute(my_vec()); | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: #[warn(useless_transmute)] on by default warning: transmute from an integer to a pointer --> $DIR/transmute.rs:92:31 | 92 | let _: *const usize = std::mem::transmute(5_isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `5_isize as *const usize` - | - = note: #[warn(useless_transmute)] on by default warning: transmute from an integer to a pointer --> $DIR/transmute.rs:96:31 | 96 | let _: *const usize = std::mem::transmute(1+1usize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `(1+1usize) as *const usize` - | - = note: #[warn(useless_transmute)] on by default warning: transmute from a type (`*const Usize`) to the type that it points to (`Usize`) --> $DIR/transmute.rs:111:24 @@ -179,22 +141,16 @@ warning: transmute from a type (`*mut Usize`) to the type that it points to (`Us | 113 | let _: Usize = core::intrinsics::transmute(int_mut_ptr); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: #[warn(crosspointer_transmute)] on by default warning: transmute from a type (`Usize`) to a pointer to that type (`*const Usize`) --> $DIR/transmute.rs:115:31 | 115 | let _: *const Usize = core::intrinsics::transmute(my_int()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: #[warn(crosspointer_transmute)] on by default warning: transmute from a type (`Usize`) to a pointer to that type (`*mut Usize`) --> $DIR/transmute.rs:117:29 | 117 | let _: *mut Usize = core::intrinsics::transmute(my_int()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: #[warn(crosspointer_transmute)] on by default diff --git a/tests/ui/transmute_64bit.stderr b/tests/ui/transmute_64bit.stderr index 88160ed8c9e4..595696180457 100644 --- a/tests/ui/transmute_64bit.stderr +++ b/tests/ui/transmute_64bit.stderr @@ -11,6 +11,4 @@ warning: transmute from a `f64` to a pointer | 11 | let _: *mut usize = std::mem::transmute(6.0f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: #[warn(wrong_transmute)] on by default From ac70bb60d4b4b6e254d76ddc6d1feda0d39144d8 Mon Sep 17 00:00:00 2001 From: messense Date: Mon, 3 Jul 2017 12:37:30 +0800 Subject: [PATCH 3/4] Update ui tests for examples --- .../absurd-extreme-comparisons.stderr | 18 +-- clippy_tests/examples/approx_const.stderr | 38 +---- clippy_tests/examples/arithmetic.stderr | 20 +-- clippy_tests/examples/array_indexing.stderr | 36 +---- clippy_tests/examples/assign_ops.stderr | 42 +----- clippy_tests/examples/assign_ops2.stderr | 16 +-- clippy_tests/examples/attrs.stderr | 22 ++- clippy_tests/examples/bit_masks.stderr | 28 +--- clippy_tests/examples/blacklisted_name.stderr | 28 +--- .../examples/block_in_if_condition.stderr | 6 +- clippy_tests/examples/bool_comparison.stderr | 8 +- clippy_tests/examples/booleans.stderr | 17 +-- clippy_tests/examples/borrow_box.stderr | 2 +- clippy_tests/examples/box_vec.stderr | 2 +- clippy_tests/examples/cast.stderr | 82 +---------- clippy_tests/examples/char_lit_as_u8.stderr | 2 +- clippy_tests/examples/cmp_nan.stderr | 24 +--- clippy_tests/examples/cmp_null.stderr | 4 +- clippy_tests/examples/cmp_owned.stderr | 12 +- clippy_tests/examples/collapsible_if.stderr | 14 +- clippy_tests/examples/complex_types.stderr | 30 +--- clippy_tests/examples/copies.stderr | 3 +- .../examples/cyclomatic_complexity.stderr | 21 +-- .../cyclomatic_complexity_attr_used.stderr | 2 +- clippy_tests/examples/derive.stderr | 5 +- .../examples/diverging_sub_expression.stderr | 12 +- clippy_tests/examples/dlist.stderr | 7 +- clippy_tests/examples/doc.stderr | 52 +------ clippy_tests/examples/double_neg.stderr | 2 +- clippy_tests/examples/double_parens.stderr | 10 +- clippy_tests/examples/drop_forget_copy.stderr | 6 +- clippy_tests/examples/drop_forget_ref.stderr | 18 +-- .../duplicate_underscore_argument.stderr | 2 +- clippy_tests/examples/empty_enum.stderr | 2 +- clippy_tests/examples/entry.stderr | 14 +- clippy_tests/examples/enum_glob_use.stderr | 4 +- clippy_tests/examples/enum_variants.stderr | 13 +- clippy_tests/examples/enums_clike.stderr | 16 +-- clippy_tests/examples/eq_op.stderr | 62 +------- clippy_tests/examples/eta.stderr | 8 +- .../examples/eval_order_dependence.stderr | 5 +- clippy_tests/examples/filter_methods.stderr | 8 +- clippy_tests/examples/float_cmp.stderr | 9 +- clippy_tests/examples/for_loop.stderr | 57 +------- clippy_tests/examples/format.stderr | 6 +- clippy_tests/examples/formatting.stderr | 9 +- clippy_tests/examples/functions.stderr | 22 +-- clippy_tests/examples/identity_op.stderr | 14 +- .../if_let_redundant_pattern_matching.stderr | 8 +- clippy_tests/examples/if_not_else.stderr | 3 +- .../invalid_upcast_comparisons.stderr | 54 +------ .../examples/item_after_statement.stderr | 4 +- .../examples/large_enum_variant.stderr | 7 +- clippy_tests/examples/len_zero.stderr | 20 +-- clippy_tests/examples/let_if_seq.stderr | 6 +- clippy_tests/examples/let_return.stderr | 3 +- clippy_tests/examples/let_unit.stderr | 4 +- clippy_tests/examples/lifetimes.stderr | 28 +--- clippy_tests/examples/lint_pass.stderr | 2 +- clippy_tests/examples/literals.stderr | 17 +-- clippy_tests/examples/map_clone.stderr | 12 +- clippy_tests/examples/matches.stderr | 32 +---- clippy_tests/examples/mem_forget.stderr | 6 +- clippy_tests/examples/methods.stderr | 136 +----------------- clippy_tests/examples/min_max.stderr | 14 +- clippy_tests/examples/missing-doc.stderr | 80 +---------- clippy_tests/examples/module_inception.stderr | 4 +- clippy_tests/examples/modulo_one.stderr | 2 +- clippy_tests/examples/mut_from_ref.stderr | 6 +- clippy_tests/examples/mut_mut.stderr | 26 +--- clippy_tests/examples/mut_reference.stderr | 6 +- clippy_tests/examples/mutex_atomic.stderr | 12 +- clippy_tests/examples/needless_bool.stderr | 22 +-- clippy_tests/examples/needless_borrow.stderr | 8 +- .../examples/needless_continue.stderr | 3 +- .../examples/needless_pass_by_value.stderr | 12 +- clippy_tests/examples/needless_return.stderr | 16 +-- clippy_tests/examples/needless_update.stderr | 2 +- clippy_tests/examples/neg_multiply.stderr | 4 +- clippy_tests/examples/never_loop.stderr | 16 +-- .../examples/new_without_default.stderr | 3 +- clippy_tests/examples/no_effect.stderr | 86 +---------- .../examples/non_expressive_names.stderr | 14 +- clippy_tests/examples/ok_if_let.stderr | 2 +- clippy_tests/examples/op_ref.stderr | 2 +- clippy_tests/examples/open_options.stderr | 14 +- .../overflow_check_conditional.stderr | 16 +-- clippy_tests/examples/panic.stderr | 37 ----- .../examples/partialeq_ne_impl.stderr | 2 +- clippy_tests/examples/patterns.stderr | 2 +- clippy_tests/examples/precedence.stderr | 18 +-- clippy_tests/examples/print.stderr | 14 +- .../examples/print_with_newline.stderr | 8 +- clippy_tests/examples/ptr_arg.stderr | 6 +- clippy_tests/examples/range.stderr | 10 +- .../examples/redundant_closure_call.stderr | 10 +- clippy_tests/examples/reference.stderr | 22 +-- clippy_tests/examples/regex.stderr | 2 +- clippy_tests/examples/serde.stderr | 2 +- clippy_tests/examples/shadow.stderr | 8 +- .../examples/short_circuit_statement.stderr | 6 +- clippy_tests/examples/should_assert_eq.stderr | 8 +- clippy_tests/examples/strings.stderr | 14 +- clippy_tests/examples/stutter.stderr | 8 +- clippy_tests/examples/swap.stderr | 9 +- .../examples/temporary_assignment.stderr | 4 +- clippy_tests/examples/toplevel_ref_arg.stderr | 10 +- clippy_tests/examples/unicode.stderr | 2 +- clippy_tests/examples/unit_cmp.stderr | 4 +- .../examples/unneeded_field_pattern.stderr | 3 +- .../examples/unsafe_removed_from_name.stderr | 6 +- clippy_tests/examples/unused_io_amount.stderr | 11 +- clippy_tests/examples/unused_labels.stderr | 6 +- clippy_tests/examples/unused_lt.stderr | 6 +- .../examples/used_underscore_binding.stderr | 10 +- .../examples/useless_attribute.stderr | 2 +- clippy_tests/examples/vec.stderr | 12 +- clippy_tests/examples/while_loop.stderr | 16 +-- .../examples/wrong_self_convention.stderr | 24 +--- clippy_tests/examples/zero_div_zero.stderr | 11 +- clippy_tests/examples/zero_ptr.stderr | 4 +- 121 files changed, 138 insertions(+), 1731 deletions(-) diff --git a/clippy_tests/examples/absurd-extreme-comparisons.stderr b/clippy_tests/examples/absurd-extreme-comparisons.stderr index e8f09f94a4d7..15b5f8fecc3f 100644 --- a/clippy_tests/examples/absurd-extreme-comparisons.stderr +++ b/clippy_tests/examples/absurd-extreme-comparisons.stderr @@ -13,7 +13,6 @@ error: this comparison involving the minimum or maximum element for this type co 11 | u <= Z; | ^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because Z is the minimum value for this type, the case where the two sides are not equal never occurs, consider using u == Z instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -22,7 +21,6 @@ error: this comparison involving the minimum or maximum element for this type co 12 | u < Z; | ^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because Z is the minimum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -31,7 +29,6 @@ error: this comparison involving the minimum or maximum element for this type co 13 | Z >= u; | ^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because Z is the minimum value for this type, the case where the two sides are not equal never occurs, consider using Z == u instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -40,7 +37,6 @@ error: this comparison involving the minimum or maximum element for this type co 14 | Z > u; | ^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because Z is the minimum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -49,7 +45,6 @@ error: this comparison involving the minimum or maximum element for this type co 15 | u > std::u32::MAX; | ^^^^^^^^^^^^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because std::u32::MAX is the maximum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -58,7 +53,6 @@ error: this comparison involving the minimum or maximum element for this type co 16 | u >= std::u32::MAX; | ^^^^^^^^^^^^^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because std::u32::MAX is the maximum value for this type, the case where the two sides are not equal never occurs, consider using u == std::u32::MAX instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -67,7 +61,6 @@ error: this comparison involving the minimum or maximum element for this type co 17 | std::u32::MAX < u; | ^^^^^^^^^^^^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because std::u32::MAX is the maximum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -76,7 +69,6 @@ error: this comparison involving the minimum or maximum element for this type co 18 | std::u32::MAX <= u; | ^^^^^^^^^^^^^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because std::u32::MAX is the maximum value for this type, the case where the two sides are not equal never occurs, consider using std::u32::MAX == u instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -85,7 +77,6 @@ error: this comparison involving the minimum or maximum element for this type co 19 | 1-1 > u; | ^^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because 1-1 is the minimum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -94,7 +85,6 @@ error: this comparison involving the minimum or maximum element for this type co 20 | u >= !0; | ^^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because !0 is the maximum value for this type, the case where the two sides are not equal never occurs, consider using u == !0 instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -103,7 +93,6 @@ error: this comparison involving the minimum or maximum element for this type co 21 | u <= 12 - 2*6; | ^^^^^^^^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because 12 - 2*6 is the minimum value for this type, the case where the two sides are not equal never occurs, consider using u == 12 - 2*6 instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -112,7 +101,6 @@ error: this comparison involving the minimum or maximum element for this type co 23 | i < -127 - 1; | ^^^^^^^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because -127 - 1 is the minimum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -121,7 +109,6 @@ error: this comparison involving the minimum or maximum element for this type co 24 | std::i8::MAX >= i; | ^^^^^^^^^^^^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because std::i8::MAX is the maximum value for this type, this comparison is always true error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -130,7 +117,6 @@ error: this comparison involving the minimum or maximum element for this type co 25 | 3-7 < std::i32::MIN; | ^^^^^^^^^^^^^^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because std::i32::MIN is the minimum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -139,7 +125,6 @@ error: this comparison involving the minimum or maximum element for this type co 27 | b >= true; | ^^^^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because true is the maximum value for this type, the case where the two sides are not equal never occurs, consider using b == true instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false @@ -148,7 +133,6 @@ error: this comparison involving the minimum or maximum element for this type co 28 | false > b; | ^^^^^^^^^ | - = note: `-D absurd-extreme-comparisons` implied by `-D warnings` = help: because false is the minimum value for this type, this comparison is always false error: <-comparison of unit values detected. This will always be false @@ -159,7 +143,7 @@ error: <-comparison of unit values detected. This will always be false | = note: `-D unit-cmp` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 18 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/approx_const.stderr b/clippy_tests/examples/approx_const.stderr index 2bfcc379e300..a223d88cb8ce 100644 --- a/clippy_tests/examples/approx_const.stderr +++ b/clippy_tests/examples/approx_const.stderr @@ -11,146 +11,110 @@ error: approximate value of `f{32, 64}::consts::E` found. Consider using it dire | 8 | let almost_e = 2.718; | ^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::FRAC_1_PI` found. Consider using it directly --> approx_const.rs:11:24 | 11 | let my_1_frac_pi = 0.3183; | ^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::FRAC_1_SQRT_2` found. Consider using it directly --> approx_const.rs:14:28 | 14 | let my_frac_1_sqrt_2 = 0.70710678; | ^^^^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::FRAC_1_SQRT_2` found. Consider using it directly --> approx_const.rs:15:32 | 15 | let almost_frac_1_sqrt_2 = 0.70711; | ^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::FRAC_2_PI` found. Consider using it directly --> approx_const.rs:18:24 | 18 | let my_frac_2_pi = 0.63661977; | ^^^^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::FRAC_2_SQRT_PI` found. Consider using it directly --> approx_const.rs:21:27 | 21 | let my_frac_2_sq_pi = 1.128379; | ^^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::FRAC_PI_2` found. Consider using it directly --> approx_const.rs:24:24 | 24 | let my_frac_pi_2 = 1.57079632679; | ^^^^^^^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::FRAC_PI_3` found. Consider using it directly --> approx_const.rs:27:24 | 27 | let my_frac_pi_3 = 1.04719755119; | ^^^^^^^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::FRAC_PI_4` found. Consider using it directly --> approx_const.rs:30:24 | 30 | let my_frac_pi_4 = 0.785398163397; | ^^^^^^^^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::FRAC_PI_6` found. Consider using it directly --> approx_const.rs:33:24 | 33 | let my_frac_pi_6 = 0.523598775598; | ^^^^^^^^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::FRAC_PI_8` found. Consider using it directly --> approx_const.rs:36:24 | 36 | let my_frac_pi_8 = 0.3926990816987; | ^^^^^^^^^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::LN_10` found. Consider using it directly --> approx_const.rs:39:20 | 39 | let my_ln_10 = 2.302585092994046; | ^^^^^^^^^^^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::LN_2` found. Consider using it directly --> approx_const.rs:42:19 | 42 | let my_ln_2 = 0.6931471805599453; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::LOG10_E` found. Consider using it directly --> approx_const.rs:45:22 | 45 | let my_log10_e = 0.43429448190325182; | ^^^^^^^^^^^^^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::LOG2_E` found. Consider using it directly --> approx_const.rs:48:21 | 48 | let my_log2_e = 1.4426950408889634; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::PI` found. Consider using it directly --> approx_const.rs:51:17 | 51 | let my_pi = 3.1415; | ^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::PI` found. Consider using it directly --> approx_const.rs:52:21 | 52 | let almost_pi = 3.14; | ^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` error: approximate value of `f{32, 64}::consts::SQRT_2` found. Consider using it directly --> approx_const.rs:55:18 | 55 | let my_sq2 = 1.4142; | ^^^^^^ - | - = note: `-D approx-constant` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 19 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/arithmetic.stderr b/clippy_tests/examples/arithmetic.stderr index bf2fc102d1b4..727b1da6e13e 100644 --- a/clippy_tests/examples/arithmetic.stderr +++ b/clippy_tests/examples/arithmetic.stderr @@ -11,8 +11,6 @@ error: integer arithmetic detected | 9 | i * 2; | ^^^^^ - | - = note: `-D integer-arithmetic` implied by `-D warnings` error: integer arithmetic detected --> arithmetic.rs:10:5 @@ -20,24 +18,18 @@ error: integer arithmetic detected 10 | / 1 % 11 | | i / 2; // no error, this is part of the expression in the preceding line | |_________^ - | - = note: `-D integer-arithmetic` implied by `-D warnings` error: integer arithmetic detected --> arithmetic.rs:12:5 | 12 | i - 2 + 2 - i; | ^^^^^^^^^^^^^ - | - = note: `-D integer-arithmetic` implied by `-D warnings` error: integer arithmetic detected --> arithmetic.rs:13:5 | 13 | -i; | ^^ - | - = note: `-D integer-arithmetic` implied by `-D warnings` error: floating-point arithmetic detected --> arithmetic.rs:23:5 @@ -52,42 +44,32 @@ error: floating-point arithmetic detected | 25 | 1.0 + f; | ^^^^^^^ - | - = note: `-D float-arithmetic` implied by `-D warnings` error: floating-point arithmetic detected --> arithmetic.rs:26:5 | 26 | f * 2.0; | ^^^^^^^ - | - = note: `-D float-arithmetic` implied by `-D warnings` error: floating-point arithmetic detected --> arithmetic.rs:27:5 | 27 | f / 2.0; | ^^^^^^^ - | - = note: `-D float-arithmetic` implied by `-D warnings` error: floating-point arithmetic detected --> arithmetic.rs:28:5 | 28 | f - 2.0 * 4.2; | ^^^^^^^^^^^^^ - | - = note: `-D float-arithmetic` implied by `-D warnings` error: floating-point arithmetic detected --> arithmetic.rs:29:5 | 29 | -f; | ^^ - | - = note: `-D float-arithmetic` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 11 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/array_indexing.stderr b/clippy_tests/examples/array_indexing.stderr index 9af027b3731c..dc3bc634952d 100644 --- a/clippy_tests/examples/array_indexing.stderr +++ b/clippy_tests/examples/array_indexing.stderr @@ -11,48 +11,36 @@ error: const index is out of bounds | 13 | x[1 << 3]; | ^^^^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: range is out of bounds --> array_indexing.rs:14:6 | 14 | &x[1..5]; | ^^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: range is out of bounds --> array_indexing.rs:16:6 | 16 | &x[0...4]; | ^^^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: range is out of bounds --> array_indexing.rs:17:6 | 17 | &x[...4]; | ^^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: range is out of bounds --> array_indexing.rs:21:6 | 21 | &x[5..]; | ^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: range is out of bounds --> array_indexing.rs:23:6 | 23 | &x[..5]; | ^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: indexing may panic --> array_indexing.rs:26:5 @@ -67,90 +55,68 @@ error: slicing may panic | 27 | &y[1..2]; | ^^^^^^^ - | - = note: `-D indexing-slicing` implied by `-D warnings` error: slicing may panic --> array_indexing.rs:29:6 | 29 | &y[0...4]; | ^^^^^^^^ - | - = note: `-D indexing-slicing` implied by `-D warnings` error: slicing may panic --> array_indexing.rs:30:6 | 30 | &y[...4]; | ^^^^^^^ - | - = note: `-D indexing-slicing` implied by `-D warnings` error: const index is out of bounds --> array_indexing.rs:33:5 | 33 | empty[0]; | ^^^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: range is out of bounds --> array_indexing.rs:34:6 | 34 | &empty[1..5]; | ^^^^^^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: range is out of bounds --> array_indexing.rs:35:6 | 35 | &empty[0...4]; | ^^^^^^^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: range is out of bounds --> array_indexing.rs:36:6 | 36 | &empty[...4]; | ^^^^^^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: range is out of bounds --> array_indexing.rs:40:6 | 40 | &empty[0...0]; | ^^^^^^^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: range is out of bounds --> array_indexing.rs:41:6 | 41 | &empty[...0]; | ^^^^^^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: range is out of bounds --> array_indexing.rs:43:6 | 43 | &empty[1..]; | ^^^^^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` error: range is out of bounds --> array_indexing.rs:44:6 | 44 | &empty[..4]; | ^^^^^^^^^^ - | - = note: `-D out-of-bounds-indexing` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 19 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/assign_ops.stderr b/clippy_tests/examples/assign_ops.stderr index b0ff237cc8cd..dd36c5cad29d 100644 --- a/clippy_tests/examples/assign_ops.stderr +++ b/clippy_tests/examples/assign_ops.stderr @@ -11,96 +11,72 @@ error: assign operation detected | 9 | i += 2 + 17; | ^^^^^^^^^^^ help: replace it with `i = i + 2 + 17` - | - = note: `-D assign-ops` implied by `-D warnings` error: assign operation detected --> assign_ops.rs:10:5 | 10 | i -= 6; | ^^^^^^ help: replace it with `i = i - 6` - | - = note: `-D assign-ops` implied by `-D warnings` error: assign operation detected --> assign_ops.rs:11:5 | 11 | i -= 2 - 1; | ^^^^^^^^^^ help: replace it with `i = i - (2 - 1)` - | - = note: `-D assign-ops` implied by `-D warnings` error: assign operation detected --> assign_ops.rs:12:5 | 12 | i *= 5; | ^^^^^^ help: replace it with `i = i * 5` - | - = note: `-D assign-ops` implied by `-D warnings` error: assign operation detected --> assign_ops.rs:13:5 | 13 | i *= 1+5; | ^^^^^^^^ help: replace it with `i = i * (1+5)` - | - = note: `-D assign-ops` implied by `-D warnings` error: assign operation detected --> assign_ops.rs:14:5 | 14 | i /= 32; | ^^^^^^^ help: replace it with `i = i / 32` - | - = note: `-D assign-ops` implied by `-D warnings` error: assign operation detected --> assign_ops.rs:15:5 | 15 | i /= 32 | 5; | ^^^^^^^^^^^ help: replace it with `i = i / (32 | 5)` - | - = note: `-D assign-ops` implied by `-D warnings` error: assign operation detected --> assign_ops.rs:16:5 | 16 | i /= 32 / 5; | ^^^^^^^^^^^ help: replace it with `i = i / (32 / 5)` - | - = note: `-D assign-ops` implied by `-D warnings` error: assign operation detected --> assign_ops.rs:17:5 | 17 | i %= 42; | ^^^^^^^ help: replace it with `i = i % 42` - | - = note: `-D assign-ops` implied by `-D warnings` error: assign operation detected --> assign_ops.rs:18:5 | 18 | i >>= i; | ^^^^^^^ help: replace it with `i = i >> i` - | - = note: `-D assign-ops` implied by `-D warnings` error: assign operation detected --> assign_ops.rs:19:5 | 19 | i <<= 9 + 6 - 7; | ^^^^^^^^^^^^^^^ help: replace it with `i = i << (9 + 6 - 7)` - | - = note: `-D assign-ops` implied by `-D warnings` error: assign operation detected --> assign_ops.rs:20:5 | 20 | i += 1 << 5; | ^^^^^^^^^^^ help: replace it with `i = i + (1 << 5)` - | - = note: `-D assign-ops` implied by `-D warnings` error: manual implementation of an assign operation --> assign_ops.rs:27:5 @@ -115,66 +91,50 @@ error: manual implementation of an assign operation | 28 | a = 1 + a; | ^^^^^^^^^ help: replace it with `a += 1` - | - = note: `-D assign-op-pattern` implied by `-D warnings` error: manual implementation of an assign operation --> assign_ops.rs:29:5 | 29 | a = a - 1; | ^^^^^^^^^ help: replace it with `a -= 1` - | - = note: `-D assign-op-pattern` implied by `-D warnings` error: manual implementation of an assign operation --> assign_ops.rs:30:5 | 30 | a = a * 99; | ^^^^^^^^^^ help: replace it with `a *= 99` - | - = note: `-D assign-op-pattern` implied by `-D warnings` error: manual implementation of an assign operation --> assign_ops.rs:31:5 | 31 | a = 42 * a; | ^^^^^^^^^^ help: replace it with `a *= 42` - | - = note: `-D assign-op-pattern` implied by `-D warnings` error: manual implementation of an assign operation --> assign_ops.rs:32:5 | 32 | a = a / 2; | ^^^^^^^^^ help: replace it with `a /= 2` - | - = note: `-D assign-op-pattern` implied by `-D warnings` error: manual implementation of an assign operation --> assign_ops.rs:33:5 | 33 | a = a % 5; | ^^^^^^^^^ help: replace it with `a %= 5` - | - = note: `-D assign-op-pattern` implied by `-D warnings` error: manual implementation of an assign operation --> assign_ops.rs:34:5 | 34 | a = a & 1; | ^^^^^^^^^ help: replace it with `a &= 1` - | - = note: `-D assign-op-pattern` implied by `-D warnings` error: manual implementation of an assign operation --> assign_ops.rs:40:5 | 40 | s = s + "bla"; | ^^^^^^^^^^^^^ help: replace it with `s += "bla"` - | - = note: `-D assign-op-pattern` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 22 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/assign_ops2.stderr b/clippy_tests/examples/assign_ops2.stderr index f5c6f69e4c5f..049e2ab7bf36 100644 --- a/clippy_tests/examples/assign_ops2.stderr +++ b/clippy_tests/examples/assign_ops2.stderr @@ -11,58 +11,44 @@ error: variable appears on both sides of an assignment operation | 9 | a += 1 + a; | ^^^^^^^^^^ help: replace it with `a += 1` - | - = note: `-D misrefactored-assign-op` implied by `-D warnings` error: variable appears on both sides of an assignment operation --> assign_ops2.rs:10:5 | 10 | a -= a - 1; | ^^^^^^^^^^ help: replace it with `a -= 1` - | - = note: `-D misrefactored-assign-op` implied by `-D warnings` error: variable appears on both sides of an assignment operation --> assign_ops2.rs:11:5 | 11 | a *= a * 99; | ^^^^^^^^^^^ help: replace it with `a *= 99` - | - = note: `-D misrefactored-assign-op` implied by `-D warnings` error: variable appears on both sides of an assignment operation --> assign_ops2.rs:12:5 | 12 | a *= 42 * a; | ^^^^^^^^^^^ help: replace it with `a *= 42` - | - = note: `-D misrefactored-assign-op` implied by `-D warnings` error: variable appears on both sides of an assignment operation --> assign_ops2.rs:13:5 | 13 | a /= a / 2; | ^^^^^^^^^^ help: replace it with `a /= 2` - | - = note: `-D misrefactored-assign-op` implied by `-D warnings` error: variable appears on both sides of an assignment operation --> assign_ops2.rs:14:5 | 14 | a %= a % 5; | ^^^^^^^^^^ help: replace it with `a %= 5` - | - = note: `-D misrefactored-assign-op` implied by `-D warnings` error: variable appears on both sides of an assignment operation --> assign_ops2.rs:15:5 | 15 | a &= a & 1; | ^^^^^^^^^^ help: replace it with `a &= 1` - | - = note: `-D misrefactored-assign-op` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 8 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/attrs.stderr b/clippy_tests/examples/attrs.stderr index 0c3912781075..15fe2429a35f 100644 --- a/clippy_tests/examples/attrs.stderr +++ b/clippy_tests/examples/attrs.stderr @@ -6,6 +6,24 @@ error: you have declared `#[inline(always)]` on `test_attr_lint`. This is usuall | = note: `-D inline-always` implied by `-D warnings` +error: you have declared `#[inline(always)]` on `false_positive_expr`. This is usually a bad idea + --> attrs.rs:11:1 + | +11 | #[inline(always)] + | ^^^^^^^^^^^^^^^^^ + +error: you have declared `#[inline(always)]` on `false_positive_stmt`. This is usually a bad idea + --> attrs.rs:16:1 + | +16 | #[inline(always)] + | ^^^^^^^^^^^^^^^^^ + +error: you have declared `#[inline(always)]` on `empty_and_false_positive_stmt`. This is usually a bad idea + --> attrs.rs:21:1 + | +21 | #[inline(always)] + | ^^^^^^^^^^^^^^^^^ + error: the since field must contain a semver-compliant version --> attrs.rs:27:14 | @@ -19,10 +37,8 @@ error: the since field must contain a semver-compliant version | 30 | #[deprecated(since = "1")] | ^^^^^^^^^^^ - | - = note: `-D deprecated-semver` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 6 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/bit_masks.stderr b/clippy_tests/examples/bit_masks.stderr index 62b07b6f2d89..38a68b2831b0 100644 --- a/clippy_tests/examples/bit_masks.stderr +++ b/clippy_tests/examples/bit_masks.stderr @@ -11,80 +11,60 @@ error: incompatible bit mask: `_ & 2` can never be equal to `1` | 15 | x & 2 == 1; | ^^^^^^^^^^ - | - = note: `-D bad-bit-mask` implied by `-D warnings` error: incompatible bit mask: `_ | 3` can never be equal to `2` --> bit_masks.rs:19:5 | 19 | x | 3 == 2; | ^^^^^^^^^^ - | - = note: `-D bad-bit-mask` implied by `-D warnings` error: incompatible bit mask: `_ & 1` will never be higher than `1` --> bit_masks.rs:21:5 | 21 | x & 1 > 1; | ^^^^^^^^^ - | - = note: `-D bad-bit-mask` implied by `-D warnings` error: incompatible bit mask: `_ | 2` will always be higher than `1` --> bit_masks.rs:25:5 | 25 | x | 2 > 1; | ^^^^^^^^^ - | - = note: `-D bad-bit-mask` implied by `-D warnings` error: incompatible bit mask: `_ & 7` can never be equal to `8` --> bit_masks.rs:32:5 | 32 | x & THREE_BITS == 8; | ^^^^^^^^^^^^^^^^^^^ - | - = note: `-D bad-bit-mask` implied by `-D warnings` error: incompatible bit mask: `_ | 7` will never be lower than `7` --> bit_masks.rs:33:5 | 33 | x | EVEN_MORE_REDIRECTION < 7; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D bad-bit-mask` implied by `-D warnings` error: &-masking with zero --> bit_masks.rs:35:5 | 35 | 0 & x == 0; | ^^^^^^^^^^ - | - = note: `-D bad-bit-mask` implied by `-D warnings` error: incompatible bit mask: `_ | 2` will always be higher than `1` --> bit_masks.rs:39:5 | 39 | 1 < 2 | x; | ^^^^^^^^^ - | - = note: `-D bad-bit-mask` implied by `-D warnings` error: incompatible bit mask: `_ | 3` can never be equal to `2` --> bit_masks.rs:40:5 | 40 | 2 == 3 | x; | ^^^^^^^^^^ - | - = note: `-D bad-bit-mask` implied by `-D warnings` error: incompatible bit mask: `_ & 2` can never be equal to `1` --> bit_masks.rs:41:5 | 41 | 1 == x & 2; | ^^^^^^^^^^ - | - = note: `-D bad-bit-mask` implied by `-D warnings` error: ineffective bit mask: `x | 1` compared to `3`, is the same as x compared directly --> bit_masks.rs:52:5 @@ -99,26 +79,20 @@ error: ineffective bit mask: `x | 1` compared to `4`, is the same as x compared | 53 | x | 1 < 4; | ^^^^^^^^^ - | - = note: `-D ineffective-bit-mask` implied by `-D warnings` error: ineffective bit mask: `x | 1` compared to `3`, is the same as x compared directly --> bit_masks.rs:54:5 | 54 | x | 1 <= 3; | ^^^^^^^^^^ - | - = note: `-D ineffective-bit-mask` implied by `-D warnings` error: ineffective bit mask: `x | 1` compared to `8`, is the same as x compared directly --> bit_masks.rs:55:5 | 55 | x | 1 >= 8; | ^^^^^^^^^^ - | - = note: `-D ineffective-bit-mask` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 15 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/blacklisted_name.stderr b/clippy_tests/examples/blacklisted_name.stderr index 35594129247a..b8ebf3d9f423 100644 --- a/clippy_tests/examples/blacklisted_name.stderr +++ b/clippy_tests/examples/blacklisted_name.stderr @@ -11,106 +11,80 @@ error: use of a blacklisted/placeholder name `foo` | 10 | let foo = 42; | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` error: use of a blacklisted/placeholder name `bar` --> blacklisted_name.rs:11:9 | 11 | let bar = 42; | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` error: use of a blacklisted/placeholder name `baz` --> blacklisted_name.rs:12:9 | 12 | let baz = 42; | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` error: use of a blacklisted/placeholder name `foo` --> blacklisted_name.rs:18:10 | 18 | (foo, Some(bar), baz @ Some(_)) => (), | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` error: use of a blacklisted/placeholder name `bar` --> blacklisted_name.rs:18:20 | 18 | (foo, Some(bar), baz @ Some(_)) => (), | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` error: use of a blacklisted/placeholder name `baz` --> blacklisted_name.rs:18:26 | 18 | (foo, Some(bar), baz @ Some(_)) => (), | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` error: use of a blacklisted/placeholder name `foo` --> blacklisted_name.rs:23:19 | 23 | fn issue_1647(mut foo: u8) { | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` error: use of a blacklisted/placeholder name `bar` --> blacklisted_name.rs:24:13 | 24 | let mut bar = 0; | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` error: use of a blacklisted/placeholder name `baz` --> blacklisted_name.rs:25:21 | 25 | if let Some(mut baz) = Some(42) {} | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` error: use of a blacklisted/placeholder name `bar` --> blacklisted_name.rs:29:13 | 29 | let ref bar = 0; | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` error: use of a blacklisted/placeholder name `baz` --> blacklisted_name.rs:30:21 | 30 | if let Some(ref baz) = Some(42) {} | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` error: use of a blacklisted/placeholder name `bar` --> blacklisted_name.rs:34:17 | 34 | let ref mut bar = 0; | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` error: use of a blacklisted/placeholder name `baz` --> blacklisted_name.rs:35:25 | 35 | if let Some(ref mut baz) = Some(42) {} | ^^^ - | - = note: `-D blacklisted-name` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 14 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/block_in_if_condition.stderr b/clippy_tests/examples/block_in_if_condition.stderr index 06526659105d..77f36ce228cf 100644 --- a/clippy_tests/examples/block_in_if_condition.stderr +++ b/clippy_tests/examples/block_in_if_condition.stderr @@ -35,16 +35,12 @@ error: in an 'if' condition, avoid complex blocks or closures with blocks; inste | 58 | if v == 3 && sky == "blue" && predicate(|x| { let target = 3; x == target }, v) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D block-in-if-condition-stmt` implied by `-D warnings` error: in an 'if' condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a 'let' --> block_in_if_condition.rs:61:22 | 61 | if predicate(|x| { let target = 3; x == target }, v) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D block-in-if-condition-stmt` implied by `-D warnings` error: this boolean expression can be simplified --> block_in_if_condition.rs:67:8 @@ -54,7 +50,7 @@ error: this boolean expression can be simplified | = note: `-D nonminimal-bool` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 5 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/bool_comparison.stderr b/clippy_tests/examples/bool_comparison.stderr index f28c7206ba45..02b80cb965cc 100644 --- a/clippy_tests/examples/bool_comparison.stderr +++ b/clippy_tests/examples/bool_comparison.stderr @@ -11,26 +11,20 @@ error: equality checks against false can be replaced by a negation | 8 | if x == false { "yes" } else { "no" }; | ^^^^^^^^^^ help: try simplifying it as shown: `!x` - | - = note: `-D bool-comparison` implied by `-D warnings` error: equality checks against true are unnecessary --> bool_comparison.rs:9:8 | 9 | if true == x { "yes" } else { "no" }; | ^^^^^^^^^ help: try simplifying it as shown: `x` - | - = note: `-D bool-comparison` implied by `-D warnings` error: equality checks against false can be replaced by a negation --> bool_comparison.rs:10:8 | 10 | if false == x { "yes" } else { "no" }; | ^^^^^^^^^^ help: try simplifying it as shown: `!x` - | - = note: `-D bool-comparison` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 4 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/booleans.stderr b/clippy_tests/examples/booleans.stderr index 038f2a4d1990..4b5636658354 100644 --- a/clippy_tests/examples/booleans.stderr +++ b/clippy_tests/examples/booleans.stderr @@ -24,16 +24,12 @@ error: this boolean expression can be simplified | 15 | let _ = !false; | ^^^^^^ help: try `true` - | - = note: `-D nonminimal-bool` implied by `-D warnings` error: this boolean expression can be simplified --> booleans.rs:16:13 | 16 | let _ = !!a; | ^^^ help: try `a` - | - = note: `-D nonminimal-bool` implied by `-D warnings` error: this boolean expression contains a logic bug --> booleans.rs:17:13 @@ -41,7 +37,6 @@ error: this boolean expression contains a logic bug 17 | let _ = false && a; | ^^^^^^^^^^ help: it would look like the following `false` | - = note: `-D logic-bug` implied by `-D warnings` help: this expression can be optimized out by applying boolean operations to the outer expression --> booleans.rs:17:22 | @@ -53,16 +48,12 @@ error: this boolean expression can be simplified | 18 | let _ = false || a; | ^^^^^^^^^^ help: try `a` - | - = note: `-D nonminimal-bool` implied by `-D warnings` error: this boolean expression can be simplified --> booleans.rs:23:13 | 23 | let _ = !(!a && b); | ^^^^^^^^^^ help: try `!b || a` - | - = note: `-D nonminimal-bool` implied by `-D warnings` error: this boolean expression contains a logic bug --> booleans.rs:33:13 @@ -70,7 +61,6 @@ error: this boolean expression contains a logic bug 33 | let _ = a == b && a != b; | ^^^^^^^^^^^^^^^^ help: it would look like the following `false` | - = note: `-D logic-bug` implied by `-D warnings` help: this expression can be optimized out by applying boolean operations to the outer expression --> booleans.rs:33:13 | @@ -83,7 +73,6 @@ error: this boolean expression can be simplified 34 | let _ = a == b && c == 5 && a == b; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D nonminimal-bool` implied by `-D warnings` help: try | let _ = a == b && c == 5; | let _ = !(c != 5 || a != b); @@ -94,7 +83,6 @@ error: this boolean expression can be simplified 35 | let _ = a == b && c == 5 && b == a; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D nonminimal-bool` implied by `-D warnings` help: try | let _ = a == b && c == 5; | let _ = !(c != 5 || a != b); @@ -105,7 +93,6 @@ error: this boolean expression contains a logic bug 36 | let _ = a < b && a >= b; | ^^^^^^^^^^^^^^^ help: it would look like the following `false` | - = note: `-D logic-bug` implied by `-D warnings` help: this expression can be optimized out by applying boolean operations to the outer expression --> booleans.rs:36:13 | @@ -118,7 +105,6 @@ error: this boolean expression contains a logic bug 37 | let _ = a > b && a <= b; | ^^^^^^^^^^^^^^^ help: it would look like the following `false` | - = note: `-D logic-bug` implied by `-D warnings` help: this expression can be optimized out by applying boolean operations to the outer expression --> booleans.rs:37:13 | @@ -131,12 +117,11 @@ error: this boolean expression can be simplified 39 | let _ = a != b || !(a != b || c == d); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D nonminimal-bool` implied by `-D warnings` help: try | let _ = c != d || a != b; | let _ = !(a == b && c == d); -error: aborting due to previous error(s) +error: aborting due to 13 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/borrow_box.stderr b/clippy_tests/examples/borrow_box.stderr index 1ac5c0735db2..90ab28afcd95 100644 --- a/clippy_tests/examples/borrow_box.stderr +++ b/clippy_tests/examples/borrow_box.stderr @@ -28,7 +28,7 @@ error: you seem to be trying to use `&Box`. Consider using just `&T` 22 | fn test4(a: &Box); | ^^^^^^^^^^ help: try `&bool` -error: aborting due to previous error(s) +error: aborting due to 4 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/box_vec.stderr b/clippy_tests/examples/box_vec.stderr index 013fdba7cbd6..0f5835345155 100644 --- a/clippy_tests/examples/box_vec.stderr +++ b/clippy_tests/examples/box_vec.stderr @@ -7,7 +7,7 @@ error: you seem to be trying to use `Box>`. Consider using just `Vec` = note: `-D box-vec` implied by `-D warnings` = help: `Vec` is already on the heap, `Box>` makes an extra allocation. -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/cast.stderr b/clippy_tests/examples/cast.stderr index 271bfef17bd9..35a4bc02d93a 100644 --- a/clippy_tests/examples/cast.stderr +++ b/clippy_tests/examples/cast.stderr @@ -11,40 +11,30 @@ error: casting i64 to f32 causes a loss of precision (i64 is 64 bits wide, but f | 9 | 1i64 as f32; | ^^^^^^^^^^^ - | - = note: `-D cast-precision-loss` implied by `-D warnings` error: casting i64 to f64 causes a loss of precision (i64 is 64 bits wide, but f64's mantissa is only 52 bits wide) --> cast.rs:10:5 | 10 | 1i64 as f64; | ^^^^^^^^^^^ - | - = note: `-D cast-precision-loss` implied by `-D warnings` error: casting u32 to f32 causes a loss of precision (u32 is 32 bits wide, but f32's mantissa is only 23 bits wide) --> cast.rs:11:5 | 11 | 1u32 as f32; | ^^^^^^^^^^^ - | - = note: `-D cast-precision-loss` implied by `-D warnings` error: casting u64 to f32 causes a loss of precision (u64 is 64 bits wide, but f32's mantissa is only 23 bits wide) --> cast.rs:12:5 | 12 | 1u64 as f32; | ^^^^^^^^^^^ - | - = note: `-D cast-precision-loss` implied by `-D warnings` error: casting u64 to f64 causes a loss of precision (u64 is 64 bits wide, but f64's mantissa is only 52 bits wide) --> cast.rs:13:5 | 13 | 1u64 as f64; | ^^^^^^^^^^^ - | - = note: `-D cast-precision-loss` implied by `-D warnings` error: casting f32 to i32 may truncate the value --> cast.rs:17:5 @@ -59,8 +49,6 @@ error: casting f32 to u32 may truncate the value | 18 | 1f32 as u32; | ^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting f32 to u32 may lose the sign of the value --> cast.rs:18:5 @@ -75,56 +63,42 @@ error: casting f64 to f32 may truncate the value | 19 | 1f64 as f32; | ^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting i32 to i8 may truncate the value --> cast.rs:20:5 | 20 | 1i32 as i8; | ^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting i32 to u8 may lose the sign of the value --> cast.rs:21:5 | 21 | 1i32 as u8; | ^^^^^^^^^^ - | - = note: `-D cast-sign-loss` implied by `-D warnings` error: casting i32 to u8 may truncate the value --> cast.rs:21:5 | 21 | 1i32 as u8; | ^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting f64 to isize may truncate the value --> cast.rs:22:5 | 22 | 1f64 as isize; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting f64 to usize may truncate the value --> cast.rs:23:5 | 23 | 1f64 as usize; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting f64 to usize may lose the sign of the value --> cast.rs:23:5 | 23 | 1f64 as usize; | ^^^^^^^^^^^^^ - | - = note: `-D cast-sign-loss` implied by `-D warnings` error: casting u8 to i8 may wrap around the value --> cast.rs:25:5 @@ -139,200 +113,150 @@ error: casting u16 to i16 may wrap around the value | 26 | 1u16 as i16; | ^^^^^^^^^^^ - | - = note: `-D cast-possible-wrap` implied by `-D warnings` error: casting u32 to i32 may wrap around the value --> cast.rs:27:5 | 27 | 1u32 as i32; | ^^^^^^^^^^^ - | - = note: `-D cast-possible-wrap` implied by `-D warnings` error: casting u64 to i64 may wrap around the value --> cast.rs:28:5 | 28 | 1u64 as i64; | ^^^^^^^^^^^ - | - = note: `-D cast-possible-wrap` implied by `-D warnings` error: casting usize to isize may wrap around the value --> cast.rs:29:5 | 29 | 1usize as isize; | ^^^^^^^^^^^^^^^ - | - = note: `-D cast-possible-wrap` implied by `-D warnings` error: casting i32 to u32 may lose the sign of the value --> cast.rs:31:5 | 31 | 1i32 as u32; | ^^^^^^^^^^^ - | - = note: `-D cast-sign-loss` implied by `-D warnings` error: casting isize to usize may lose the sign of the value --> cast.rs:32:5 | 32 | 1isize as usize; | ^^^^^^^^^^^^^^^ - | - = note: `-D cast-sign-loss` implied by `-D warnings` error: casting isize to i8 may truncate the value --> cast.rs:35:5 | 35 | 1isize as i8; | ^^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting isize to f64 causes a loss of precision on targets with 64-bit wide pointers (isize is 64 bits wide, but f64's mantissa is only 52 bits wide) --> cast.rs:36:5 | 36 | 1isize as f64; | ^^^^^^^^^^^^^ - | - = note: `-D cast-precision-loss` implied by `-D warnings` error: casting usize to f64 causes a loss of precision on targets with 64-bit wide pointers (usize is 64 bits wide, but f64's mantissa is only 52 bits wide) --> cast.rs:37:5 | 37 | 1usize as f64; | ^^^^^^^^^^^^^ - | - = note: `-D cast-precision-loss` implied by `-D warnings` error: casting isize to f32 causes a loss of precision (isize is 32 or 64 bits wide, but f32's mantissa is only 23 bits wide) --> cast.rs:38:5 | 38 | 1isize as f32; | ^^^^^^^^^^^^^ - | - = note: `-D cast-precision-loss` implied by `-D warnings` error: casting usize to f32 causes a loss of precision (usize is 32 or 64 bits wide, but f32's mantissa is only 23 bits wide) --> cast.rs:39:5 | 39 | 1usize as f32; | ^^^^^^^^^^^^^ - | - = note: `-D cast-precision-loss` implied by `-D warnings` error: casting isize to i32 may truncate the value on targets with 64-bit wide pointers --> cast.rs:40:5 | 40 | 1isize as i32; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting isize to u32 may lose the sign of the value --> cast.rs:41:5 | 41 | 1isize as u32; | ^^^^^^^^^^^^^ - | - = note: `-D cast-sign-loss` implied by `-D warnings` error: casting isize to u32 may truncate the value on targets with 64-bit wide pointers --> cast.rs:41:5 | 41 | 1isize as u32; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting usize to u32 may truncate the value on targets with 64-bit wide pointers --> cast.rs:42:5 | 42 | 1usize as u32; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting usize to i32 may truncate the value on targets with 64-bit wide pointers --> cast.rs:43:5 | 43 | 1usize as i32; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting usize to i32 may wrap around the value on targets with 32-bit wide pointers --> cast.rs:43:5 | 43 | 1usize as i32; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-wrap` implied by `-D warnings` error: casting i64 to isize may truncate the value on targets with 32-bit wide pointers --> cast.rs:45:5 | 45 | 1i64 as isize; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting i64 to usize may lose the sign of the value --> cast.rs:46:5 | 46 | 1i64 as usize; | ^^^^^^^^^^^^^ - | - = note: `-D cast-sign-loss` implied by `-D warnings` error: casting i64 to usize may truncate the value on targets with 32-bit wide pointers --> cast.rs:46:5 | 46 | 1i64 as usize; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting u64 to isize may truncate the value on targets with 32-bit wide pointers --> cast.rs:47:5 | 47 | 1u64 as isize; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting u64 to isize may wrap around the value on targets with 64-bit wide pointers --> cast.rs:47:5 | 47 | 1u64 as isize; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-wrap` implied by `-D warnings` error: casting u64 to usize may truncate the value on targets with 32-bit wide pointers --> cast.rs:48:5 | 48 | 1u64 as usize; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-truncation` implied by `-D warnings` error: casting u32 to isize may wrap around the value on targets with 32-bit wide pointers --> cast.rs:49:5 | 49 | 1u32 as isize; | ^^^^^^^^^^^^^ - | - = note: `-D cast-possible-wrap` implied by `-D warnings` error: casting i32 to usize may lose the sign of the value --> cast.rs:52:5 | 52 | 1i32 as usize; | ^^^^^^^^^^^^^ - | - = note: `-D cast-sign-loss` implied by `-D warnings` error: casting to the same type is unnecessary (`i32` -> `i32`) --> cast.rs:54:5 @@ -347,18 +271,14 @@ error: casting to the same type is unnecessary (`f32` -> `f32`) | 55 | 1f32 as f32; | ^^^^^^^^^^^ - | - = note: `-D unnecessary-cast` implied by `-D warnings` error: casting to the same type is unnecessary (`bool` -> `bool`) --> cast.rs:56:5 | 56 | false as bool; | ^^^^^^^^^^^^^ - | - = note: `-D unnecessary-cast` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 45 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/char_lit_as_u8.stderr b/clippy_tests/examples/char_lit_as_u8.stderr index efe4c3cceec4..32be93eb3b59 100644 --- a/clippy_tests/examples/char_lit_as_u8.stderr +++ b/clippy_tests/examples/char_lit_as_u8.stderr @@ -8,7 +8,7 @@ error: casting character literal to u8. `char`s are 4 bytes wide in rust, so cas = help: Consider using a byte literal instead: b'a' -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/cmp_nan.stderr b/clippy_tests/examples/cmp_nan.stderr index 90b9747bc6f7..8d4b3b457762 100644 --- a/clippy_tests/examples/cmp_nan.stderr +++ b/clippy_tests/examples/cmp_nan.stderr @@ -11,90 +11,68 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead | 9 | x != std::f32::NAN; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D cmp-nan` implied by `-D warnings` error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead --> cmp_nan.rs:10:5 | 10 | x < std::f32::NAN; | ^^^^^^^^^^^^^^^^^ - | - = note: `-D cmp-nan` implied by `-D warnings` error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead --> cmp_nan.rs:11:5 | 11 | x > std::f32::NAN; | ^^^^^^^^^^^^^^^^^ - | - = note: `-D cmp-nan` implied by `-D warnings` error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead --> cmp_nan.rs:12:5 | 12 | x <= std::f32::NAN; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D cmp-nan` implied by `-D warnings` error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead --> cmp_nan.rs:13:5 | 13 | x >= std::f32::NAN; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D cmp-nan` implied by `-D warnings` error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead --> cmp_nan.rs:16:5 | 16 | y == std::f64::NAN; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D cmp-nan` implied by `-D warnings` error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead --> cmp_nan.rs:17:5 | 17 | y != std::f64::NAN; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D cmp-nan` implied by `-D warnings` error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead --> cmp_nan.rs:18:5 | 18 | y < std::f64::NAN; | ^^^^^^^^^^^^^^^^^ - | - = note: `-D cmp-nan` implied by `-D warnings` error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead --> cmp_nan.rs:19:5 | 19 | y > std::f64::NAN; | ^^^^^^^^^^^^^^^^^ - | - = note: `-D cmp-nan` implied by `-D warnings` error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead --> cmp_nan.rs:20:5 | 20 | y <= std::f64::NAN; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D cmp-nan` implied by `-D warnings` error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead --> cmp_nan.rs:21:5 | 21 | y >= std::f64::NAN; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D cmp-nan` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 12 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/cmp_null.stderr b/clippy_tests/examples/cmp_null.stderr index d7b27eb5da40..a4b6007758bb 100644 --- a/clippy_tests/examples/cmp_null.stderr +++ b/clippy_tests/examples/cmp_null.stderr @@ -11,10 +11,8 @@ error: Comparing with null is better expressed by the .is_null() method | 16 | if m == ptr::null_mut() { | ^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D cmp-null` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/cmp_owned.stderr b/clippy_tests/examples/cmp_owned.stderr index fb35717ec552..bf7e642914f8 100644 --- a/clippy_tests/examples/cmp_owned.stderr +++ b/clippy_tests/examples/cmp_owned.stderr @@ -11,42 +11,32 @@ error: this creates an owned instance just for comparison | 10 | "foo".to_string() != x; | ^^^^^^^^^^^^^^^^^ help: try `"foo"` - | - = note: `-D cmp-owned` implied by `-D warnings` error: this creates an owned instance just for comparison --> cmp_owned.rs:17:10 | 17 | x != "foo".to_owned(); | ^^^^^^^^^^^^^^^^ help: try `"foo"` - | - = note: `-D cmp-owned` implied by `-D warnings` error: this creates an owned instance just for comparison --> cmp_owned.rs:19:10 | 19 | x != String::from("foo"); | ^^^^^^^^^^^^^^^^^^^ help: try `"foo"` - | - = note: `-D cmp-owned` implied by `-D warnings` error: this creates an owned instance just for comparison --> cmp_owned.rs:23:5 | 23 | Foo.to_owned() == Foo; | ^^^^^^^^^^^^^^ help: try `Foo` - | - = note: `-D cmp-owned` implied by `-D warnings` error: this creates an owned instance just for comparison --> cmp_owned.rs:30:9 | 30 | self.to_owned() == *other | ^^^^^^^^^^^^^^^ try calling implementing the comparison without allocating - | - = note: `-D cmp-owned` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 6 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/collapsible_if.stderr b/clippy_tests/examples/collapsible_if.stderr index 93635fbd84d1..b5aba95bd5d1 100644 --- a/clippy_tests/examples/collapsible_if.stderr +++ b/clippy_tests/examples/collapsible_if.stderr @@ -24,7 +24,6 @@ error: this if statement can be collapsed 18 | | } | |_____^ | - = note: `-D collapsible-if` implied by `-D warnings` help: try | if (x == "hello" || x == "world") && (y == "world" || y == "hello") { | println!("Hello world!"); @@ -40,7 +39,6 @@ error: this if statement can be collapsed 24 | | } | |_____^ | - = note: `-D collapsible-if` implied by `-D warnings` help: try | if x == "hello" && x == "world" && (y == "world" || y == "hello") { | println!("Hello world!"); @@ -56,7 +54,6 @@ error: this if statement can be collapsed 30 | | } | |_____^ | - = note: `-D collapsible-if` implied by `-D warnings` help: try | if (x == "hello" || x == "world") && y == "world" && y == "hello" { | println!("Hello world!"); @@ -72,7 +69,6 @@ error: this if statement can be collapsed 36 | | } | |_____^ | - = note: `-D collapsible-if` implied by `-D warnings` help: try | if x == "hello" && x == "world" && y == "world" && y == "hello" { | println!("Hello world!"); @@ -88,7 +84,6 @@ error: this if statement can be collapsed 42 | | } | |_____^ | - = note: `-D collapsible-if` implied by `-D warnings` help: try | if 42 == 1337 && 'a' != 'A' { | println!("world!") @@ -105,7 +100,6 @@ error: this `else { if .. }` block can be collapsed 51 | | } | |_____^ | - = note: `-D collapsible-if` implied by `-D warnings` help: try | } else if y == "world" { | println!("world!") @@ -122,7 +116,6 @@ error: this `else { if .. }` block can be collapsed 59 | | } | |_____^ | - = note: `-D collapsible-if` implied by `-D warnings` help: try | } else if let Some(42) = Some(42) { | println!("world!") @@ -141,7 +134,6 @@ error: this `else { if .. }` block can be collapsed 70 | | } | |_____^ | - = note: `-D collapsible-if` implied by `-D warnings` help: try | } else if y == "world" { | println!("world") @@ -163,7 +155,6 @@ error: this `else { if .. }` block can be collapsed 81 | | } | |_____^ | - = note: `-D collapsible-if` implied by `-D warnings` help: try | } else if let Some(42) = Some(42) { | println!("world") @@ -185,7 +176,6 @@ error: this `else { if .. }` block can be collapsed 92 | | } | |_____^ | - = note: `-D collapsible-if` implied by `-D warnings` help: try | } else if let Some(42) = Some(42) { | println!("world") @@ -207,7 +197,6 @@ error: this `else { if .. }` block can be collapsed 103 | | } | |_____^ | - = note: `-D collapsible-if` implied by `-D warnings` help: try | } else if x == "hello" { | println!("world") @@ -229,7 +218,6 @@ error: this `else { if .. }` block can be collapsed 114 | | } | |_____^ | - = note: `-D collapsible-if` implied by `-D warnings` help: try | } else if let Some(42) = Some(42) { | println!("world") @@ -238,7 +226,7 @@ help: try | println!("!") | } -error: aborting due to previous error(s) +error: aborting due to 13 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/complex_types.stderr b/clippy_tests/examples/complex_types.stderr index 408ee6744ef0..bf1088abba1a 100644 --- a/clippy_tests/examples/complex_types.stderr +++ b/clippy_tests/examples/complex_types.stderr @@ -11,114 +11,86 @@ error: very complex type used. Consider factoring parts into `type` definitions | 10 | static ST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0)))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:13:8 | 13 | f: Vec>>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:16:11 | 16 | struct TS(Vec>>); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:19:11 | 19 | Tuple(Vec>>), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:20:17 | 20 | Struct { f: Vec>> }, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:24:14 | 24 | const A: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0)))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:25:30 | 25 | fn impl_method(&self, p: Vec>>) { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:29:14 | 29 | const A: Vec>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:30:14 | 30 | type B = Vec>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:31:25 | 31 | fn method(&self, p: Vec>>); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:32:29 | 32 | fn def_method(&self, p: Vec>>) { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:35:15 | 35 | fn test1() -> Vec>> { vec![] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:37:14 | 37 | fn test2(_x: Vec>>) { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` error: very complex type used. Consider factoring parts into `type` definitions --> complex_types.rs:40:13 | 40 | let _y: Vec>> = vec![]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D type-complexity` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 15 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/copies.stderr b/clippy_tests/examples/copies.stderr index 7398cae5cd32..737a8b6d4129 100644 --- a/clippy_tests/examples/copies.stderr +++ b/clippy_tests/examples/copies.stderr @@ -26,7 +26,6 @@ error: This else block is redundant. 133 | | } | |_____________^ | - = note: `-D needless-continue` implied by `-D warnings` = help: Consider dropping the else clause and merging the code that follows (in the loop) with the if block, like so: if true { break; @@ -34,7 +33,7 @@ error: This else block is redundant. } -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/cyclomatic_complexity.stderr b/clippy_tests/examples/cyclomatic_complexity.stderr index a8bf7c0e9379..a217d5fd7b87 100644 --- a/clippy_tests/examples/cyclomatic_complexity.stderr +++ b/clippy_tests/examples/cyclomatic_complexity.stderr @@ -25,7 +25,6 @@ error: the function has a cyclomatic complexity of 7 111 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 1 @@ -36,7 +35,6 @@ error: the function has a cyclomatic complexity of 1 140 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 1 @@ -47,7 +45,6 @@ error: the function has a cyclomatic complexity of 1 145 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 2 @@ -62,7 +59,6 @@ error: the function has a cyclomatic complexity of 2 163 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 2 @@ -78,7 +74,6 @@ error: the function has a cyclomatic complexity of 2 157 | | }; | |_____^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 2 @@ -92,7 +87,6 @@ error: the function has a cyclomatic complexity of 2 171 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 2 @@ -107,7 +101,6 @@ error: the function has a cyclomatic complexity of 2 192 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 3 @@ -122,7 +115,6 @@ error: the function has a cyclomatic complexity of 3 208 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 2 @@ -137,7 +129,6 @@ error: the function has a cyclomatic complexity of 2 218 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 3 @@ -152,7 +143,6 @@ error: the function has a cyclomatic complexity of 3 234 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 2 @@ -167,7 +157,6 @@ error: the function has a cyclomatic complexity of 2 244 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 3 @@ -182,7 +171,6 @@ error: the function has a cyclomatic complexity of 3 260 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 2 @@ -197,7 +185,6 @@ error: the function has a cyclomatic complexity of 2 270 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 4 @@ -212,7 +199,6 @@ error: the function has a cyclomatic complexity of 4 300 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 1 @@ -226,7 +212,6 @@ error: the function has a cyclomatic complexity of 1 310 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 1 @@ -240,7 +225,6 @@ error: the function has a cyclomatic complexity of 1 324 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 1 @@ -255,7 +239,6 @@ error: the function has a cyclomatic complexity of 1 340 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 1 @@ -270,7 +253,6 @@ error: the function has a cyclomatic complexity of 1 353 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions error: the function has a cyclomatic complexity of 8 @@ -285,10 +267,9 @@ error: the function has a cyclomatic complexity of 8 373 | | } | |_^ | - = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions -error: aborting due to previous error(s) +error: aborting due to 20 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/cyclomatic_complexity_attr_used.stderr b/clippy_tests/examples/cyclomatic_complexity_attr_used.stderr index 882e67fb5c35..a5c5b813bf49 100644 --- a/clippy_tests/examples/cyclomatic_complexity_attr_used.stderr +++ b/clippy_tests/examples/cyclomatic_complexity_attr_used.stderr @@ -13,7 +13,7 @@ error: the function has a cyclomatic complexity of 3 = note: `-D cyclomatic-complexity` implied by `-D warnings` = help: you could split it up into multiple smaller functions -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/derive.stderr b/clippy_tests/examples/derive.stderr index bc5c17cb6d24..b3640d879770 100644 --- a/clippy_tests/examples/derive.stderr +++ b/clippy_tests/examples/derive.stderr @@ -19,7 +19,6 @@ error: you are deriving `Hash` but have implemented `PartialEq` explicitly 24 | #[derive(Hash)] | ^^^^ | - = note: `-D derive-hash-xor-eq` implied by `-D warnings` note: `PartialEq` implemented here --> derive.rs:27:1 | @@ -36,7 +35,6 @@ error: you are implementing `Hash` explicitly but have derived `PartialEq` 36 | | } | |_^ | - = note: `-D derive-hash-xor-eq` implied by `-D warnings` note: `PartialEq` implemented here --> derive.rs:31:10 | @@ -68,7 +66,6 @@ error: you are implementing `Clone` explicitly on a `Copy` type 67 | | } | |_^ | - = note: `-D expl-impl-clone-on-copy` implied by `-D warnings` note: consider deriving `Clone` or removing `Copy` --> derive.rs:65:1 | @@ -77,7 +74,7 @@ note: consider deriving `Clone` or removing `Copy` 67 | | } | |_^ -error: aborting due to previous error(s) +error: aborting due to 5 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/diverging_sub_expression.stderr b/clippy_tests/examples/diverging_sub_expression.stderr index e6d39dc5cafd..0f2c169fcac3 100644 --- a/clippy_tests/examples/diverging_sub_expression.stderr +++ b/clippy_tests/examples/diverging_sub_expression.stderr @@ -11,42 +11,32 @@ error: sub-expression diverges | 19 | b || A.foo(); | ^^^^^^^ - | - = note: `-D diverging-sub-expression` implied by `-D warnings` error: sub-expression diverges --> diverging_sub_expression.rs:28:26 | 28 | 6 => true || return, | ^^^^^^ - | - = note: `-D diverging-sub-expression` implied by `-D warnings` error: sub-expression diverges --> diverging_sub_expression.rs:29:26 | 29 | 7 => true || continue, | ^^^^^^^^ - | - = note: `-D diverging-sub-expression` implied by `-D warnings` error: sub-expression diverges --> diverging_sub_expression.rs:32:26 | 32 | 3 => true || diverge(), | ^^^^^^^^^ - | - = note: `-D diverging-sub-expression` implied by `-D warnings` error: sub-expression diverges --> diverging_sub_expression.rs:37:26 | 37 | _ => true || break, | ^^^^^ - | - = note: `-D diverging-sub-expression` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 6 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/dlist.stderr b/clippy_tests/examples/dlist.stderr index 0d3552a6da14..76d0da5cc387 100644 --- a/clippy_tests/examples/dlist.stderr +++ b/clippy_tests/examples/dlist.stderr @@ -13,7 +13,6 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct 14 | fn foo(LinkedList); | ^^^^^^^^^^^^^^ | - = note: `-D linkedlist` implied by `-D warnings` = help: a VecDeque might work error: I see you're using a LinkedList! Perhaps you meant some other data structure? @@ -22,7 +21,6 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct 15 | const BAR : Option>; | ^^^^^^^^^^^^^^ | - = note: `-D linkedlist` implied by `-D warnings` = help: a VecDeque might work error: I see you're using a LinkedList! Perhaps you meant some other data structure? @@ -31,7 +29,6 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct 26 | fn foo(_: LinkedList) {} | ^^^^^^^^^^^^^^ | - = note: `-D linkedlist` implied by `-D warnings` = help: a VecDeque might work error: I see you're using a LinkedList! Perhaps you meant some other data structure? @@ -40,7 +37,6 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct 29 | pub fn test(my_favourite_linked_list: LinkedList) { | ^^^^^^^^^^^^^^ | - = note: `-D linkedlist` implied by `-D warnings` = help: a VecDeque might work error: I see you're using a LinkedList! Perhaps you meant some other data structure? @@ -49,10 +45,9 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct 33 | pub fn test_ret() -> Option> { | ^^^^^^^^^^^^^^ | - = note: `-D linkedlist` implied by `-D warnings` = help: a VecDeque might work -error: aborting due to previous error(s) +error: aborting due to 6 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/doc.stderr b/clippy_tests/examples/doc.stderr index 7b4f7a763bac..26d457a9c91f 100644 --- a/clippy_tests/examples/doc.stderr +++ b/clippy_tests/examples/doc.stderr @@ -11,202 +11,152 @@ error: you should put `foo_bar` between ticks in the documentation | 8 | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there) | ^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `foo::bar` between ticks in the documentation --> doc.rs:8:51 | 8 | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there) | ^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `Foo::some_fun` between ticks in the documentation --> doc.rs:9:84 | 9 | /// Markdown is _weird_. I mean _really weird_. This \_ is ok. So is `_`. But not Foo::some_fun | ^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `a::global:path` between ticks in the documentation --> doc.rs:11:15 | 11 | /// Here be ::a::global:path. | ^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `NotInCodeBlock` between ticks in the documentation --> doc.rs:12:22 | 12 | /// That's not code ~NotInCodeBlock~. | ^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation --> doc.rs:13:5 | 13 | /// be_sure_we_got_to_the_end_of_it | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation --> doc.rs:27:5 | 27 | /// be_sure_we_got_to_the_end_of_it | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation --> doc.rs:34:5 | 34 | /// be_sure_we_got_to_the_end_of_it | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation --> doc.rs:48:5 | 48 | /// be_sure_we_got_to_the_end_of_it | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `link_with_underscores` between ticks in the documentation --> doc.rs:52:22 | 52 | /// This test has [a link_with_underscores][chunked-example] inside it. See #823. | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `inline_link2` between ticks in the documentation --> doc.rs:55:21 | 55 | /// It can also be [inline_link2]. | ^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation --> doc.rs:65:5 | 65 | /// be_sure_we_got_to_the_end_of_it | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `CamelCaseThing` between ticks in the documentation --> doc.rs:73:8 | 73 | /// ## CamelCaseThing | ^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `CamelCaseThing` between ticks in the documentation --> doc.rs:76:7 | 76 | /// # CamelCaseThing | ^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `CamelCaseThing` between ticks in the documentation --> doc.rs:78:22 | 78 | /// Not a title #897 CamelCaseThing | ^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation --> doc.rs:79:5 | 79 | /// be_sure_we_got_to_the_end_of_it | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation --> doc.rs:86:5 | 86 | /// be_sure_we_got_to_the_end_of_it | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation --> doc.rs:99:5 | 99 | /// be_sure_we_got_to_the_end_of_it | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `FooBar` between ticks in the documentation --> doc.rs:110:42 | 110 | /** E.g. serialization of an empty list: FooBar | ^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `BarQuz` between ticks in the documentation --> doc.rs:115:5 | 115 | And BarQuz too. | ^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation --> doc.rs:116:1 | 116 | be_sure_we_got_to_the_end_of_it | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `FooBar` between ticks in the documentation --> doc.rs:121:42 | 121 | /** E.g. serialization of an empty list: FooBar | ^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `BarQuz` between ticks in the documentation --> doc.rs:126:5 | 126 | And BarQuz too. | ^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation --> doc.rs:127:1 | 127 | be_sure_we_got_to_the_end_of_it | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation --> doc.rs:138:5 | 138 | /// be_sure_we_got_to_the_end_of_it | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D doc-markdown` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 26 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/double_neg.stderr b/clippy_tests/examples/double_neg.stderr index 0f432b0fa311..f403e339483e 100644 --- a/clippy_tests/examples/double_neg.stderr +++ b/clippy_tests/examples/double_neg.stderr @@ -6,7 +6,7 @@ error: `--x` could be misinterpreted as pre-decrement by C programmers, is usual | = note: `-D double-neg` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/double_parens.stderr b/clippy_tests/examples/double_parens.stderr index 12d07267d033..d3a5e97602ef 100644 --- a/clippy_tests/examples/double_parens.stderr +++ b/clippy_tests/examples/double_parens.stderr @@ -11,34 +11,26 @@ error: Consider removing unnecessary double parentheses | 20 | dummy_fn((0)); | ^^^ - | - = note: `-D double-parens` implied by `-D warnings` error: Consider removing unnecessary double parentheses --> double_parens.rs:24:20 | 24 | x.dummy_method((0)); | ^^^ - | - = note: `-D double-parens` implied by `-D warnings` error: Consider removing unnecessary double parentheses --> double_parens.rs:28:5 | 28 | ((1, 2)) | ^^^^^^^^ - | - = note: `-D double-parens` implied by `-D warnings` error: Consider removing unnecessary double parentheses --> double_parens.rs:32:5 | 32 | (()) | ^^^^ - | - = note: `-D double-parens` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 5 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/drop_forget_copy.stderr b/clippy_tests/examples/drop_forget_copy.stderr index 86eba81d7c4f..c2ae9aa5fc50 100644 --- a/clippy_tests/examples/drop_forget_copy.stderr +++ b/clippy_tests/examples/drop_forget_copy.stderr @@ -17,7 +17,6 @@ error: calls to `std::mem::drop` with a value that implements Copy. Dropping a c 34 | drop(s2); | ^^^^^^^^ | - = note: `-D drop-copy` implied by `-D warnings` note: argument has type SomeStruct --> drop_forget_copy.rs:34:10 | @@ -30,7 +29,6 @@ error: calls to `std::mem::drop` with a value that implements Copy. Dropping a c 36 | drop(s4); | ^^^^^^^^ | - = note: `-D drop-copy` implied by `-D warnings` note: argument has type SomeStruct --> drop_forget_copy.rs:36:10 | @@ -56,7 +54,6 @@ error: calls to `std::mem::forget` with a value that implements Copy. Forgetting 40 | forget(s2); | ^^^^^^^^^^ | - = note: `-D forget-copy` implied by `-D warnings` note: argument has type SomeStruct --> drop_forget_copy.rs:40:12 | @@ -69,14 +66,13 @@ error: calls to `std::mem::forget` with a value that implements Copy. Forgetting 42 | forget(s4); | ^^^^^^^^^^ | - = note: `-D forget-copy` implied by `-D warnings` note: argument has type SomeStruct --> drop_forget_copy.rs:42:12 | 42 | forget(s4); | ^^ -error: aborting due to previous error(s) +error: aborting due to 6 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/drop_forget_ref.stderr b/clippy_tests/examples/drop_forget_ref.stderr index b4d37a5994ae..4feda3cc73c5 100644 --- a/clippy_tests/examples/drop_forget_ref.stderr +++ b/clippy_tests/examples/drop_forget_ref.stderr @@ -30,7 +30,6 @@ error: calls to `std::mem::drop` with a reference instead of an owned value. Dro 16 | drop(&owned1); | ^^^^^^^^^^^^^ | - = note: `-D drop-ref` implied by `-D warnings` note: argument has type &SomeStruct --> drop_forget_ref.rs:16:10 | @@ -43,7 +42,6 @@ error: calls to `std::mem::drop` with a reference instead of an owned value. Dro 17 | drop(&&owned1); | ^^^^^^^^^^^^^^ | - = note: `-D drop-ref` implied by `-D warnings` note: argument has type &&SomeStruct --> drop_forget_ref.rs:17:10 | @@ -56,7 +54,6 @@ error: calls to `std::mem::drop` with a reference instead of an owned value. Dro 18 | drop(&mut owned1); | ^^^^^^^^^^^^^^^^^ | - = note: `-D drop-ref` implied by `-D warnings` note: argument has type &mut SomeStruct --> drop_forget_ref.rs:18:10 | @@ -69,7 +66,6 @@ error: calls to `std::mem::forget` with a reference instead of an owned value. F 21 | forget(&owned2); | ^^^^^^^^^^^^^^^ | - = note: `-D forget-ref` implied by `-D warnings` note: argument has type &SomeStruct --> drop_forget_ref.rs:21:12 | @@ -82,7 +78,6 @@ error: calls to `std::mem::forget` with a reference instead of an owned value. F 22 | forget(&&owned2); | ^^^^^^^^^^^^^^^^ | - = note: `-D forget-ref` implied by `-D warnings` note: argument has type &&SomeStruct --> drop_forget_ref.rs:22:12 | @@ -95,7 +90,6 @@ error: calls to `std::mem::forget` with a reference instead of an owned value. F 23 | forget(&mut owned2); | ^^^^^^^^^^^^^^^^^^^ | - = note: `-D forget-ref` implied by `-D warnings` note: argument has type &mut SomeStruct --> drop_forget_ref.rs:23:12 | @@ -108,7 +102,6 @@ error: calls to `std::mem::drop` with a reference instead of an owned value. Dro 27 | drop(reference1); | ^^^^^^^^^^^^^^^^ | - = note: `-D drop-ref` implied by `-D warnings` note: argument has type &SomeStruct --> drop_forget_ref.rs:27:10 | @@ -121,7 +114,6 @@ error: calls to `std::mem::forget` with a reference instead of an owned value. F 28 | forget(&*reference1); | ^^^^^^^^^^^^^^^^^^^^ | - = note: `-D forget-ref` implied by `-D warnings` note: argument has type &SomeStruct --> drop_forget_ref.rs:28:12 | @@ -134,7 +126,6 @@ error: calls to `std::mem::drop` with a reference instead of an owned value. Dro 31 | drop(reference2); | ^^^^^^^^^^^^^^^^ | - = note: `-D drop-ref` implied by `-D warnings` note: argument has type &mut SomeStruct --> drop_forget_ref.rs:31:10 | @@ -147,7 +138,6 @@ error: calls to `std::mem::forget` with a reference instead of an owned value. F 33 | forget(reference3); | ^^^^^^^^^^^^^^^^^^ | - = note: `-D forget-ref` implied by `-D warnings` note: argument has type &mut SomeStruct --> drop_forget_ref.rs:33:12 | @@ -160,7 +150,6 @@ error: calls to `std::mem::drop` with a reference instead of an owned value. Dro 36 | drop(reference4); | ^^^^^^^^^^^^^^^^ | - = note: `-D drop-ref` implied by `-D warnings` note: argument has type &SomeStruct --> drop_forget_ref.rs:36:10 | @@ -173,7 +162,6 @@ error: calls to `std::mem::forget` with a reference instead of an owned value. F 37 | forget(reference4); | ^^^^^^^^^^^^^^^^^^ | - = note: `-D forget-ref` implied by `-D warnings` note: argument has type &SomeStruct --> drop_forget_ref.rs:37:12 | @@ -186,7 +174,6 @@ error: calls to `std::mem::drop` with a reference instead of an owned value. Dro 42 | drop(&val); | ^^^^^^^^^^ | - = note: `-D drop-ref` implied by `-D warnings` note: argument has type &T --> drop_forget_ref.rs:42:10 | @@ -199,7 +186,6 @@ error: calls to `std::mem::forget` with a reference instead of an owned value. F 48 | forget(&val); | ^^^^^^^^^^^^ | - = note: `-D forget-ref` implied by `-D warnings` note: argument has type &T --> drop_forget_ref.rs:48:12 | @@ -212,7 +198,6 @@ error: calls to `std::mem::drop` with a reference instead of an owned value. Dro 56 | std::mem::drop(&SomeStruct); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D drop-ref` implied by `-D warnings` note: argument has type &SomeStruct --> drop_forget_ref.rs:56:20 | @@ -225,14 +210,13 @@ error: calls to `std::mem::forget` with a reference instead of an owned value. F 59 | std::mem::forget(&SomeStruct); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D forget-ref` implied by `-D warnings` note: argument has type &SomeStruct --> drop_forget_ref.rs:59:22 | 59 | std::mem::forget(&SomeStruct); | ^^^^^^^^^^^ -error: aborting due to previous error(s) +error: aborting due to 18 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/duplicate_underscore_argument.stderr b/clippy_tests/examples/duplicate_underscore_argument.stderr index df3564cd9419..3cd8d5306ac3 100644 --- a/clippy_tests/examples/duplicate_underscore_argument.stderr +++ b/clippy_tests/examples/duplicate_underscore_argument.stderr @@ -6,7 +6,7 @@ error: `darth` already exists, having another argument having almost the same na | = note: `-D duplicate-underscore-argument` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/empty_enum.stderr b/clippy_tests/examples/empty_enum.stderr index 4f8cd9418aa2..74b4ae3d1b1a 100644 --- a/clippy_tests/examples/empty_enum.stderr +++ b/clippy_tests/examples/empty_enum.stderr @@ -11,7 +11,7 @@ help: consider using the uninhabited type `!` or a wrapper around it 7 | enum Empty {} | ^^^^^^^^^^^^^ -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/entry.stderr b/clippy_tests/examples/entry.stderr index 706e274ff5b9..de5c22e41a7d 100644 --- a/clippy_tests/examples/entry.stderr +++ b/clippy_tests/examples/entry.stderr @@ -11,50 +11,38 @@ error: usage of `contains_key` followed by `insert` on a `HashMap` | 17 | if !m.contains_key(&k) { foo(); m.insert(k, v); } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)` - | - = note: `-D map-entry` implied by `-D warnings` error: usage of `contains_key` followed by `insert` on a `HashMap` --> entry.rs:21:5 | 21 | if !m.contains_key(&k) { m.insert(k, v) } else { None }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)` - | - = note: `-D map-entry` implied by `-D warnings` error: usage of `contains_key` followed by `insert` on a `HashMap` --> entry.rs:25:5 | 25 | if m.contains_key(&k) { None } else { m.insert(k, v) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)` - | - = note: `-D map-entry` implied by `-D warnings` error: usage of `contains_key` followed by `insert` on a `HashMap` --> entry.rs:29:5 | 29 | if !m.contains_key(&k) { foo(); m.insert(k, v) } else { None }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)` - | - = note: `-D map-entry` implied by `-D warnings` error: usage of `contains_key` followed by `insert` on a `HashMap` --> entry.rs:33:5 | 33 | if m.contains_key(&k) { None } else { foo(); m.insert(k, v) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)` - | - = note: `-D map-entry` implied by `-D warnings` error: usage of `contains_key` followed by `insert` on a `BTreeMap` --> entry.rs:37:5 | 37 | if !m.contains_key(&k) { foo(); m.insert(k, v) } else { None }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)` - | - = note: `-D map-entry` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 7 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/enum_glob_use.stderr b/clippy_tests/examples/enum_glob_use.stderr index dc1d8f209d22..8d0c5b346941 100644 --- a/clippy_tests/examples/enum_glob_use.stderr +++ b/clippy_tests/examples/enum_glob_use.stderr @@ -11,10 +11,8 @@ error: don't use glob imports for enum variants | 12 | use self::Enum::*; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D enum-glob-use` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/enum_variants.stderr b/clippy_tests/examples/enum_variants.stderr index 64cfb4a0f21e..853839270c0f 100644 --- a/clippy_tests/examples/enum_variants.stderr +++ b/clippy_tests/examples/enum_variants.stderr @@ -11,24 +11,18 @@ error: Variant name starts with the enum's name | 25 | FoodGood, | ^^^^^^^^ - | - = note: `-D enum-variant-names` implied by `-D warnings` error: Variant name starts with the enum's name --> enum_variants.rs:26:5 | 26 | FoodMiddle, | ^^^^^^^^^^ - | - = note: `-D enum-variant-names` implied by `-D warnings` error: Variant name starts with the enum's name --> enum_variants.rs:27:5 | 27 | FoodBad, | ^^^^^^^ - | - = note: `-D enum-variant-names` implied by `-D warnings` error: All variants have the same prefix: `Food` --> enum_variants.rs:24:1 @@ -40,7 +34,6 @@ error: All variants have the same prefix: `Food` 28 | | } | |_^ | - = note: `-D enum-variant-names` implied by `-D warnings` = help: remove the prefixes and use full paths to the variants instead of glob imports error: All variants have the same prefix: `CallType` @@ -53,7 +46,6 @@ error: All variants have the same prefix: `CallType` 38 | | } | |_^ | - = note: `-D enum-variant-names` implied by `-D warnings` = help: remove the prefixes and use full paths to the variants instead of glob imports error: All variants have the same prefix: `Constant` @@ -66,7 +58,6 @@ error: All variants have the same prefix: `Constant` 49 | | } | |_^ | - = note: `-D enum-variant-names` implied by `-D warnings` = help: remove the prefixes and use full paths to the variants instead of glob imports error: All variants have the same prefix: `With` @@ -79,7 +70,6 @@ error: All variants have the same prefix: `With` 82 | | } | |_^ | - = note: `-D enum-variant-names` implied by `-D warnings` = help: remove the prefixes and use full paths to the variants instead of glob imports error: All variants have the same prefix: `Prefix` @@ -92,7 +82,6 @@ error: All variants have the same prefix: `Prefix` 88 | | } | |_^ | - = note: `-D enum-variant-names` implied by `-D warnings` = help: remove the prefixes and use full paths to the variants instead of glob imports error: All variants have the same prefix: `With` @@ -108,7 +97,7 @@ error: All variants have the same prefix: `With` = note: `-D pub-enum-variant-names` implied by `-D warnings` = help: remove the prefixes and use full paths to the variants instead of glob imports -error: aborting due to previous error(s) +error: aborting due to 10 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/enums_clike.stderr b/clippy_tests/examples/enums_clike.stderr index fdd6b37e0918..ff61b2883c5a 100644 --- a/clippy_tests/examples/enums_clike.stderr +++ b/clippy_tests/examples/enums_clike.stderr @@ -11,58 +11,44 @@ error: Clike enum variant discriminant is not portable to 32-bit targets | 17 | X = 0x1_0000_0000, | ^^^^^^^^^^^^^^^^^ - | - = note: `-D enum-clike-unportable-variant` implied by `-D warnings` error: Clike enum variant discriminant is not portable to 32-bit targets --> enums_clike.rs:20:5 | 20 | A = 0xFFFF_FFFF, | ^^^^^^^^^^^^^^^ - | - = note: `-D enum-clike-unportable-variant` implied by `-D warnings` error: Clike enum variant discriminant is not portable to 32-bit targets --> enums_clike.rs:27:5 | 27 | Z = 0xFFFF_FFFF, | ^^^^^^^^^^^^^^^ - | - = note: `-D enum-clike-unportable-variant` implied by `-D warnings` error: Clike enum variant discriminant is not portable to 32-bit targets --> enums_clike.rs:28:5 | 28 | A = 0x1_0000_0000, | ^^^^^^^^^^^^^^^^^ - | - = note: `-D enum-clike-unportable-variant` implied by `-D warnings` error: Clike enum variant discriminant is not portable to 32-bit targets --> enums_clike.rs:30:5 | 30 | C = (std::i32::MIN as isize) - 1, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D enum-clike-unportable-variant` implied by `-D warnings` error: Clike enum variant discriminant is not portable to 32-bit targets --> enums_clike.rs:36:5 | 36 | Z = 0xFFFF_FFFF, | ^^^^^^^^^^^^^^^ - | - = note: `-D enum-clike-unportable-variant` implied by `-D warnings` error: Clike enum variant discriminant is not portable to 32-bit targets --> enums_clike.rs:37:5 | 37 | A = 0x1_0000_0000, | ^^^^^^^^^^^^^^^^^ - | - = note: `-D enum-clike-unportable-variant` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 8 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/eq_op.stderr b/clippy_tests/examples/eq_op.stderr index 00cd9aceb82f..530dfac79ed4 100644 --- a/clippy_tests/examples/eq_op.stderr +++ b/clippy_tests/examples/eq_op.stderr @@ -11,40 +11,30 @@ error: this boolean expression can be simplified | 39 | true || true; | ^^^^^^^^^^^^ help: try `true` - | - = note: `-D nonminimal-bool` implied by `-D warnings` error: this boolean expression can be simplified --> eq_op.rs:45:5 | 45 | a == b && b == a; | ^^^^^^^^^^^^^^^^ help: try `a == b` - | - = note: `-D nonminimal-bool` implied by `-D warnings` error: this boolean expression can be simplified --> eq_op.rs:46:5 | 46 | a != b && b != a; | ^^^^^^^^^^^^^^^^ help: try `a != b` - | - = note: `-D nonminimal-bool` implied by `-D warnings` error: this boolean expression can be simplified --> eq_op.rs:47:5 | 47 | a < b && b > a; | ^^^^^^^^^^^^^^ help: try `a < b` - | - = note: `-D nonminimal-bool` implied by `-D warnings` error: this boolean expression can be simplified --> eq_op.rs:48:5 | 48 | a <= b && b >= a; | ^^^^^^^^^^^^^^^^ help: try `a <= b` - | - = note: `-D nonminimal-bool` implied by `-D warnings` error: equal expressions as operands to `==` --> eq_op.rs:10:5 @@ -59,200 +49,150 @@ error: equal expressions as operands to `==` | 11 | "no" == "no"; | ^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `!=` --> eq_op.rs:13:5 | 13 | false != false; | ^^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `<` --> eq_op.rs:14:5 | 14 | 1.5 < 1.5; | ^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `>=` --> eq_op.rs:15:5 | 15 | 1u64 >= 1u64; | ^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `&` --> eq_op.rs:18:5 | 18 | (1 as u64) & (1 as u64); | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `^` --> eq_op.rs:19:5 | 19 | 1 ^ ((((((1)))))); | ^^^^^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `<` --> eq_op.rs:22:5 | 22 | (-(2) < -(2)); | ^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `==` --> eq_op.rs:23:5 | 23 | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `&` --> eq_op.rs:23:6 | 23 | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1)); | ^^^^^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `&` --> eq_op.rs:23:27 | 23 | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1)); | ^^^^^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `==` --> eq_op.rs:24:5 | 24 | (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `!=` --> eq_op.rs:27:5 | 27 | ([1] != [1]); | ^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `!=` --> eq_op.rs:28:5 | 28 | ((1, 2) != (1, 2)); | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `==` --> eq_op.rs:32:5 | 32 | 1 + 1 == 2; | ^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `==` --> eq_op.rs:33:5 | 33 | 1 - 1 == 0; | ^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `-` --> eq_op.rs:33:5 | 33 | 1 - 1 == 0; | ^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `-` --> eq_op.rs:35:5 | 35 | 1 - 1; | ^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `/` --> eq_op.rs:36:5 | 36 | 1 / 1; | ^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `&&` --> eq_op.rs:37:5 | 37 | true && true; | ^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `||` --> eq_op.rs:39:5 | 39 | true || true; | ^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `&&` --> eq_op.rs:45:5 | 45 | a == b && b == a; | ^^^^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `&&` --> eq_op.rs:46:5 | 46 | a != b && b != a; | ^^^^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `&&` --> eq_op.rs:47:5 | 47 | a < b && b > a; | ^^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `&&` --> eq_op.rs:48:5 | 48 | a <= b && b >= a; | ^^^^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: equal expressions as operands to `==` --> eq_op.rs:51:5 | 51 | a == a; | ^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: taken reference of right operand --> eq_op.rs:89:13 @@ -264,7 +204,7 @@ error: taken reference of right operand | = note: `-D op-ref` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 33 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/eta.stderr b/clippy_tests/examples/eta.stderr index 10d6c4921ca8..e6600be3358d 100644 --- a/clippy_tests/examples/eta.stderr +++ b/clippy_tests/examples/eta.stderr @@ -11,16 +11,12 @@ error: redundant closure found | 8 | meta(|a| foo(a)); | ^^^^^^^^^^ help: remove closure as shown: `foo` - | - = note: `-D redundant-closure` implied by `-D warnings` error: redundant closure found --> eta.rs:9:27 | 9 | let c = Some(1u8).map(|a| {1+2; foo}(a)); | ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `{1+2; foo}` - | - = note: `-D redundant-closure` implied by `-D warnings` error: this expression borrows a reference that is immediately dereferenced by the compiler --> eta.rs:11:21 @@ -35,10 +31,8 @@ error: redundant closure found | 18 | let e = Some(1u8).map(|a| generic(a)); | ^^^^^^^^^^^^^^ help: remove closure as shown: `generic` - | - = note: `-D redundant-closure` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 5 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/eval_order_dependence.stderr b/clippy_tests/examples/eval_order_dependence.stderr index a9a4ff0caeda..24e9f9740ca5 100644 --- a/clippy_tests/examples/eval_order_dependence.stderr +++ b/clippy_tests/examples/eval_order_dependence.stderr @@ -17,7 +17,6 @@ error: unsequenced read of a variable 11 | x += { x = 20; 2 }; | ^ | - = note: `-D eval-order-dependence` implied by `-D warnings` note: whether read occurs before this write depends on evaluation order --> eval_order_dependence.rs:11:12 | @@ -30,7 +29,6 @@ error: unsequenced read of a variable 17 | let foo = Foo { a: x, .. { x = 6; base } }; | ^ | - = note: `-D eval-order-dependence` implied by `-D warnings` note: whether read occurs before this write depends on evaluation order --> eval_order_dependence.rs:17:32 | @@ -43,14 +41,13 @@ error: unsequenced read of a variable 21 | x += { x = 20; 2 }; | ^ | - = note: `-D eval-order-dependence` implied by `-D warnings` note: whether read occurs before this write depends on evaluation order --> eval_order_dependence.rs:21:16 | 21 | x += { x = 20; 2 }; | ^^^^^^ -error: aborting due to previous error(s) +error: aborting due to 4 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/filter_methods.stderr b/clippy_tests/examples/filter_methods.stderr index b33456c8c365..e46270b1c4f7 100644 --- a/clippy_tests/examples/filter_methods.stderr +++ b/clippy_tests/examples/filter_methods.stderr @@ -17,8 +17,6 @@ error: called `filter(p).flat_map(q)` on an `Iterator`. This is more succinctly 14 | | .filter(|&x| x == 0) 15 | | .flat_map(|x| x.checked_mul(2)) | |_______________________________________________________________^ - | - = note: `-D filter-map` implied by `-D warnings` error: called `filter_map(p).flat_map(q)` on an `Iterator`. This is more succinctly expressed by calling `.flat_map(..)` and filtering by returning an empty Iterator. --> filter_methods.rs:18:21 @@ -28,8 +26,6 @@ error: called `filter_map(p).flat_map(q)` on an `Iterator`. This is more succinc 19 | | .filter_map(|x| x.checked_mul(2)) 20 | | .flat_map(|x| x.checked_mul(2)) | |_______________________________________________________________^ - | - = note: `-D filter-map` implied by `-D warnings` error: called `filter_map(p).map(q)` on an `Iterator`. This is more succinctly expressed by only calling `.filter_map(..)` instead. --> filter_methods.rs:23:21 @@ -39,10 +35,8 @@ error: called `filter_map(p).map(q)` on an `Iterator`. This is more succinctly e 24 | | .filter_map(|x| x.checked_mul(2)) 25 | | .map(|x| x.checked_mul(2)) | |__________________________________________________________^ - | - = note: `-D filter-map` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 4 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/float_cmp.stderr b/clippy_tests/examples/float_cmp.stderr index 257b4fd0bd7d..d0de1486eb73 100644 --- a/clippy_tests/examples/float_cmp.stderr +++ b/clippy_tests/examples/float_cmp.stderr @@ -17,7 +17,6 @@ error: strict comparison of f32 or f64 44 | ONE == 1.0 + 0.0; | ^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(ONE - (1.0 + 0.0)).abs() < error` | - = note: `-D float-cmp` implied by `-D warnings` note: std::f32::EPSILON and std::f64::EPSILON are available. --> float_cmp.rs:44:5 | @@ -30,7 +29,6 @@ error: strict comparison of f32 or f64 45 | ONE + ONE == ZERO + ONE + ONE; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(ONE + ONE - (ZERO + ONE + ONE)).abs() < error` | - = note: `-D float-cmp` implied by `-D warnings` note: std::f32::EPSILON and std::f64::EPSILON are available. --> float_cmp.rs:45:5 | @@ -43,7 +41,6 @@ error: strict comparison of f32 or f64 46 | ONE != 2.0; | ^^^^^^^^^^ help: consider comparing them within some error `(ONE - 2.0).abs() < error` | - = note: `-D float-cmp` implied by `-D warnings` note: std::f32::EPSILON and std::f64::EPSILON are available. --> float_cmp.rs:46:5 | @@ -56,7 +53,6 @@ error: strict comparison of f32 or f64 48 | twice(ONE) != ONE; | ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(twice(ONE) - ONE).abs() < error` | - = note: `-D float-cmp` implied by `-D warnings` note: std::f32::EPSILON and std::f64::EPSILON are available. --> float_cmp.rs:48:5 | @@ -69,7 +65,6 @@ error: strict comparison of f32 or f64 49 | ONE as f64 != 2.0; | ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(ONE as f64 - 2.0).abs() < error` | - = note: `-D float-cmp` implied by `-D warnings` note: std::f32::EPSILON and std::f64::EPSILON are available. --> float_cmp.rs:49:5 | @@ -82,7 +77,6 @@ error: strict comparison of f32 or f64 54 | x == 1.0; | ^^^^^^^^ help: consider comparing them within some error `(x - 1.0).abs() < error` | - = note: `-D float-cmp` implied by `-D warnings` note: std::f32::EPSILON and std::f64::EPSILON are available. --> float_cmp.rs:54:5 | @@ -95,14 +89,13 @@ error: strict comparison of f32 or f64 57 | twice(x) != twice(ONE as f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(twice(x) - twice(ONE as f64)).abs() < error` | - = note: `-D float-cmp` implied by `-D warnings` note: std::f32::EPSILON and std::f64::EPSILON are available. --> float_cmp.rs:57:5 | 57 | twice(x) != twice(ONE as f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error(s) +error: aborting due to 8 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/for_loop.stderr b/clippy_tests/examples/for_loop.stderr index 37ed3204f6ab..a7ce0ec5f7f0 100644 --- a/clippy_tests/examples/for_loop.stderr +++ b/clippy_tests/examples/for_loop.stderr @@ -22,7 +22,6 @@ error: for loop over `option.ok_or("x not found")`, which is a `Result`. This is 26 | for x in option.ok_or("x not found") { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D for-loop-over-result` implied by `-D warnings` = help: consider replacing `for x in option.ok_or("x not found")` with `if let Ok(x) = option.ok_or("x not found")` error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want @@ -41,7 +40,6 @@ error: for loop over `v.iter().next().and(Some(0))`, which is an `Option`. This 36 | for x in v.iter().next().and(Some(0)) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D for-loop-over-option` implied by `-D warnings` = help: consider replacing `for x in v.iter().next().and(Some(0))` with `if let Some(x) = v.iter().next().and(Some(0))` error: for loop over `v.iter().next().ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement. @@ -50,7 +48,6 @@ error: for loop over `v.iter().next().ok_or("x not found")`, which is a `Result` 40 | for x in v.iter().next().ok_or("x not found") { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D for-loop-over-result` implied by `-D warnings` = help: consider replacing `for x in v.iter().next().ok_or("x not found")` with `if let Ok(x) = v.iter().next().ok_or("x not found")` error: this loop never actually loops @@ -72,8 +69,6 @@ error: this loop never actually loops 60 | | break; 61 | | } | |_____^ - | - = note: `-D never-loop` implied by `-D warnings` error: the loop variable `i` is only used to index `vec`. --> for_loop.rs:84:5 @@ -101,7 +96,6 @@ error: the loop variable `i` is only used to index `vec`. 93 | for i in 0..vec.len() { let _ = vec[i]; } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D needless-range-loop` implied by `-D warnings` help: consider using an iterator | for in &vec { let _ = vec[i]; } @@ -113,7 +107,6 @@ error: the loop variable `j` is only used to index `STATIC`. 98 | | } | |_____^ | - = note: `-D needless-range-loop` implied by `-D warnings` help: consider using an iterator | for in STATIC.iter().take(4) { @@ -125,7 +118,6 @@ error: the loop variable `j` is only used to index `CONST`. 102 | | } | |_____^ | - = note: `-D needless-range-loop` implied by `-D warnings` help: consider using an iterator | for in CONST.iter().take(4) { @@ -137,7 +129,6 @@ error: the loop variable `i` is used to index `vec` 106 | | } | |_____^ | - = note: `-D needless-range-loop` implied by `-D warnings` help: consider using an iterator | for (i, ) in vec.iter().enumerate() { @@ -149,7 +140,6 @@ error: the loop variable `i` is only used to index `vec2`. 113 | | } | |_____^ | - = note: `-D needless-range-loop` implied by `-D warnings` help: consider using an iterator | for in vec2.iter().take(vec.len()) { @@ -161,7 +151,6 @@ error: the loop variable `i` is only used to index `vec`. 117 | | } | |_____^ | - = note: `-D needless-range-loop` implied by `-D warnings` help: consider using an iterator | for in vec.iter().skip(5) { @@ -173,7 +162,6 @@ error: the loop variable `i` is only used to index `vec`. 121 | | } | |_____^ | - = note: `-D needless-range-loop` implied by `-D warnings` help: consider using an iterator | for in vec.iter().take(MAX_LEN) { @@ -185,7 +173,6 @@ error: the loop variable `i` is only used to index `vec`. 125 | | } | |_____^ | - = note: `-D needless-range-loop` implied by `-D warnings` help: consider using an iterator | for in vec.iter().take(MAX_LEN + 1) { @@ -197,7 +184,6 @@ error: the loop variable `i` is only used to index `vec`. 129 | | } | |_____^ | - = note: `-D needless-range-loop` implied by `-D warnings` help: consider using an iterator | for in vec.iter().take(10).skip(5) { @@ -209,7 +195,6 @@ error: the loop variable `i` is only used to index `vec`. 133 | | } | |_____^ | - = note: `-D needless-range-loop` implied by `-D warnings` help: consider using an iterator | for in vec.iter().take(10 + 1).skip(5) { @@ -221,7 +206,6 @@ error: the loop variable `i` is used to index `vec` 137 | | } | |_____^ | - = note: `-D needless-range-loop` implied by `-D warnings` help: consider using an iterator | for (i, ) in vec.iter().enumerate().skip(5) { @@ -233,7 +217,6 @@ error: the loop variable `i` is used to index `vec` 141 | | } | |_____^ | - = note: `-D needless-range-loop` implied by `-D warnings` help: consider using an iterator | for (i, ) in vec.iter().enumerate().take(10).skip(5) { @@ -257,7 +240,6 @@ error: this range is empty so this for loop will never run 149 | | } | |_____^ | - = note: `-D reverse-range-loop` implied by `-D warnings` help: consider using the following if you are attempting to iterate over this range in reverse | for i in (0...10).rev() { @@ -269,7 +251,6 @@ error: this range is empty so this for loop will never run 153 | | } | |_____^ | - = note: `-D reverse-range-loop` implied by `-D warnings` help: consider using the following if you are attempting to iterate over this range in reverse | for i in (0..MAX_LEN).rev() { @@ -280,8 +261,6 @@ error: this range is empty so this for loop will never run 156 | | println!("{}", i); 157 | | } | |_____^ - | - = note: `-D reverse-range-loop` implied by `-D warnings` error: this range is empty so this for loop will never run --> for_loop.rs:176:5 @@ -291,7 +270,6 @@ error: this range is empty so this for loop will never run 178 | | } | |_____^ | - = note: `-D reverse-range-loop` implied by `-D warnings` help: consider using the following if you are attempting to iterate over this range in reverse | for i in (5+4..10).rev() { @@ -303,7 +281,6 @@ error: this range is empty so this for loop will never run 182 | | } | |_____^ | - = note: `-D reverse-range-loop` implied by `-D warnings` help: consider using the following if you are attempting to iterate over this range in reverse | for i in ((3-1)..(5+2)).rev() { @@ -314,8 +291,6 @@ error: this range is empty so this for loop will never run 185 | | println!("{}", i); 186 | | } | |_____^ - | - = note: `-D reverse-range-loop` implied by `-D warnings` error: use of deprecated item: replaced by `Iterator::step_by` --> for_loop.rs:192:22 @@ -338,8 +313,6 @@ error: it is more idiomatic to loop over references to containers instead of usi | 209 | for _v in vec.iter_mut() { } | ^^^^^^^^^^^^^^ help: to write this more concisely, try `&mut vec` - | - = note: `-D explicit-iter-loop` implied by `-D warnings` error: it is more idiomatic to loop over containers instead of using explicit iteration methods` --> for_loop.rs:212:15 @@ -354,88 +327,66 @@ error: it is more idiomatic to loop over references to containers instead of usi | 215 | for _v in array.into_iter() {} | ^^^^^^^^^^^^^^^^^ help: to write this more concisely, try `&array` - | - = note: `-D explicit-iter-loop` implied by `-D warnings` error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods --> for_loop.rs:220:15 | 220 | for _v in [1, 2, 3].iter() { } | ^^^^^^^^^^^^^^^^ help: to write this more concisely, try `&[1, 2, 3]` - | - = note: `-D explicit-iter-loop` implied by `-D warnings` error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods --> for_loop.rs:224:15 | 224 | for _v in [0; 32].iter() {} | ^^^^^^^^^^^^^^ help: to write this more concisely, try `&[0; 32]` - | - = note: `-D explicit-iter-loop` implied by `-D warnings` error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods --> for_loop.rs:229:15 | 229 | for _v in ll.iter() { } | ^^^^^^^^^ help: to write this more concisely, try `&ll` - | - = note: `-D explicit-iter-loop` implied by `-D warnings` error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods --> for_loop.rs:232:15 | 232 | for _v in vd.iter() { } | ^^^^^^^^^ help: to write this more concisely, try `&vd` - | - = note: `-D explicit-iter-loop` implied by `-D warnings` error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods --> for_loop.rs:235:15 | 235 | for _v in bh.iter() { } | ^^^^^^^^^ help: to write this more concisely, try `&bh` - | - = note: `-D explicit-iter-loop` implied by `-D warnings` error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods --> for_loop.rs:238:15 | 238 | for _v in hm.iter() { } | ^^^^^^^^^ help: to write this more concisely, try `&hm` - | - = note: `-D explicit-iter-loop` implied by `-D warnings` error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods --> for_loop.rs:241:15 | 241 | for _v in bt.iter() { } | ^^^^^^^^^ help: to write this more concisely, try `&bt` - | - = note: `-D explicit-iter-loop` implied by `-D warnings` error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods --> for_loop.rs:244:15 | 244 | for _v in hs.iter() { } | ^^^^^^^^^ help: to write this more concisely, try `&hs` - | - = note: `-D explicit-iter-loop` implied by `-D warnings` error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods --> for_loop.rs:247:15 | 247 | for _v in bs.iter() { } | ^^^^^^^^^ help: to write this more concisely, try `&bs` - | - = note: `-D explicit-iter-loop` implied by `-D warnings` error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want --> for_loop.rs:249:5 | 249 | for _v in vec.iter().next() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D iter-next-loop` implied by `-D warnings` error: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator --> for_loop.rs:256:5 @@ -458,8 +409,6 @@ error: the variable `_index` is used as a loop counter. Consider using `for (_in | 265 | for _v in &vec { _index += 1 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D explicit-counter-loop` implied by `-D warnings` error: you seem to want to iterate on a map's values --> for_loop.rs:325:5 @@ -483,7 +432,6 @@ error: you seem to want to iterate on a map's values 334 | | } | |_____^ | - = note: `-D for-kv-map` implied by `-D warnings` help: use the corresponding method | for v in (*m).values() { @@ -495,7 +443,6 @@ error: you seem to want to iterate on a map's values 339 | | } | |_____^ | - = note: `-D for-kv-map` implied by `-D warnings` help: use the corresponding method | for v in m.values_mut() { @@ -507,7 +454,6 @@ error: you seem to want to iterate on a map's values 344 | | } | |_____^ | - = note: `-D for-kv-map` implied by `-D warnings` help: use the corresponding method | for v in (*m).values_mut() { @@ -519,11 +465,10 @@ error: you seem to want to iterate on a map's keys 350 | | } | |_____^ | - = note: `-D for-kv-map` implied by `-D warnings` help: use the corresponding method | for k in rm.keys() { -error: aborting due to previous error(s) +error: aborting due to 52 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/format.stderr b/clippy_tests/examples/format.stderr index 068010c2608c..30c3cb7676ea 100644 --- a/clippy_tests/examples/format.stderr +++ b/clippy_tests/examples/format.stderr @@ -11,18 +11,14 @@ error: useless use of `format!` | 8 | format!("{}", "foo"); | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D useless-format` implied by `-D warnings` error: useless use of `format!` --> format.rs:15:5 | 15 | format!("{}", arg); | ^^^^^^^^^^^^^^^^^^^ - | - = note: `-D useless-format` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 3 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/formatting.stderr b/clippy_tests/examples/formatting.stderr index ca07faf8a9a5..68160bd8f0a5 100644 --- a/clippy_tests/examples/formatting.stderr +++ b/clippy_tests/examples/formatting.stderr @@ -13,7 +13,6 @@ error: this looks like an `else if` but the `else` is missing 22 | } if foo() { | ^ | - = note: `-D suspicious-else-formatting` implied by `-D warnings` = note: to remove this lint, add the missing `else` or add a new line before the second `if` error: this looks like an `else if` but the `else` is missing @@ -22,7 +21,6 @@ error: this looks like an `else if` but the `else` is missing 30 | } if foo() { | ^ | - = note: `-D suspicious-else-formatting` implied by `-D warnings` = note: to remove this lint, add the missing `else` or add a new line before the second `if` error: this is an `else if` but the formatting might hide it @@ -33,7 +31,6 @@ error: this is an `else if` but the formatting might hide it 40 | | if foo() { // the span of the above error should continue here | |____^ | - = note: `-D suspicious-else-formatting` implied by `-D warnings` = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` error: this is an `else if` but the formatting might hide it @@ -45,7 +42,6 @@ error: this is an `else if` but the formatting might hide it 46 | | if foo() { // the span of the above error should continue here | |____^ | - = note: `-D suspicious-else-formatting` implied by `-D warnings` = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` error: this looks like you are trying to use `.. -= ..`, but you really are doing `.. = (- ..)` @@ -63,7 +59,6 @@ error: this looks like you are trying to use `.. *= ..`, but you really are doin 72 | a =* &191; | ^^^^ | - = note: `-D suspicious-assignment-formatting` implied by `-D warnings` = note: to remove this lint, use either `*=` or `= *` error: this looks like you are trying to use `.. != ..`, but you really are doing `.. = (! ..)` @@ -72,7 +67,6 @@ error: this looks like you are trying to use `.. != ..`, but you really are doin 75 | b =! false; | ^^^^ | - = note: `-D suspicious-assignment-formatting` implied by `-D warnings` = note: to remove this lint, use either `!=` or `= !` error: possibly missing a comma here @@ -90,10 +84,9 @@ error: possibly missing a comma here 88 | -1, -2, -3 // <= no comma here | ^ | - = note: `-D possible-missing-comma` implied by `-D warnings` = note: to remove this lint, add a comma or write the expr in a single line -error: aborting due to previous error(s) +error: aborting due to 10 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/functions.stderr b/clippy_tests/examples/functions.stderr index db578e6ee8a6..aca983e3b389 100644 --- a/clippy_tests/examples/functions.stderr +++ b/clippy_tests/examples/functions.stderr @@ -12,16 +12,12 @@ error: this function has too many arguments (8/7) | 19 | fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D too-many-arguments` implied by `-D warnings` error: this function has too many arguments (8/7) --> functions.rs:28:5 | 28 | fn bad_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D too-many-arguments` implied by `-D warnings` error: this public function dereferences a raw pointer but is not marked `unsafe` --> functions.rs:37:34 @@ -36,66 +32,50 @@ error: this public function dereferences a raw pointer but is not marked `unsafe | 38 | println!("{:?}", unsafe { p.as_ref() }); | ^ - | - = note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings` error: this public function dereferences a raw pointer but is not marked `unsafe` --> functions.rs:39:33 | 39 | unsafe { std::ptr::read(p) }; | ^ - | - = note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings` error: this public function dereferences a raw pointer but is not marked `unsafe` --> functions.rs:50:30 | 50 | println!("{}", unsafe { *p }); | ^ - | - = note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings` error: this public function dereferences a raw pointer but is not marked `unsafe` --> functions.rs:51:31 | 51 | println!("{:?}", unsafe { p.as_ref() }); | ^ - | - = note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings` error: this public function dereferences a raw pointer but is not marked `unsafe` --> functions.rs:52:29 | 52 | unsafe { std::ptr::read(p) }; | ^ - | - = note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings` error: this public function dereferences a raw pointer but is not marked `unsafe` --> functions.rs:61:34 | 61 | println!("{}", unsafe { *p }); | ^ - | - = note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings` error: this public function dereferences a raw pointer but is not marked `unsafe` --> functions.rs:62:35 | 62 | println!("{:?}", unsafe { p.as_ref() }); | ^ - | - = note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings` error: this public function dereferences a raw pointer but is not marked `unsafe` --> functions.rs:63:33 | 63 | unsafe { std::ptr::read(p) }; | ^ - | - = note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 12 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/identity_op.stderr b/clippy_tests/examples/identity_op.stderr index 42c01f5ae05c..a3080f57b3b1 100644 --- a/clippy_tests/examples/identity_op.stderr +++ b/clippy_tests/examples/identity_op.stderr @@ -11,50 +11,38 @@ error: the operation is ineffective. Consider reducing it to `x` | 14 | x + (1 - 1); | ^^^^^^^^^^^ - | - = note: `-D identity-op` implied by `-D warnings` error: the operation is ineffective. Consider reducing it to `x` --> identity_op.rs:16:5 | 16 | 0 + x; | ^^^^^ - | - = note: `-D identity-op` implied by `-D warnings` error: the operation is ineffective. Consider reducing it to `x` --> identity_op.rs:19:5 | 19 | x | (0); | ^^^^^^^ - | - = note: `-D identity-op` implied by `-D warnings` error: the operation is ineffective. Consider reducing it to `x` --> identity_op.rs:22:5 | 22 | x * 1; | ^^^^^ - | - = note: `-D identity-op` implied by `-D warnings` error: the operation is ineffective. Consider reducing it to `x` --> identity_op.rs:23:5 | 23 | 1 * x; | ^^^^^ - | - = note: `-D identity-op` implied by `-D warnings` error: the operation is ineffective. Consider reducing it to `x` --> identity_op.rs:29:5 | 29 | -1 & x; | ^^^^^^ - | - = note: `-D identity-op` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 7 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/if_let_redundant_pattern_matching.stderr b/clippy_tests/examples/if_let_redundant_pattern_matching.stderr index 5a7ca503f4c9..afa7b20c8d62 100644 --- a/clippy_tests/examples/if_let_redundant_pattern_matching.stderr +++ b/clippy_tests/examples/if_let_redundant_pattern_matching.stderr @@ -11,26 +11,20 @@ error: redundant pattern matching, consider using `is_err()` | 11 | if let Err(_) = Err::(42) { | -------^^^^^^---------------------- help: try this `if Err::(42).is_err()` - | - = note: `-D if-let-redundant-pattern-matching` implied by `-D warnings` error: redundant pattern matching, consider using `is_none()` --> if_let_redundant_pattern_matching.rs:14:12 | 14 | if let None = None::<()> { | -------^^^^------------- help: try this `if None::<()>.is_none()` - | - = note: `-D if-let-redundant-pattern-matching` implied by `-D warnings` error: redundant pattern matching, consider using `is_some()` --> if_let_redundant_pattern_matching.rs:17:12 | 17 | if let Some(_) = Some(42) { | -------^^^^^^^----------- help: try this `if Some(42).is_some()` - | - = note: `-D if-let-redundant-pattern-matching` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 4 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/if_not_else.stderr b/clippy_tests/examples/if_not_else.stderr index fdc1908b9ef0..f7d30ab7e203 100644 --- a/clippy_tests/examples/if_not_else.stderr +++ b/clippy_tests/examples/if_not_else.stderr @@ -21,10 +21,9 @@ error: Unnecessary `!=` operation 18 | | } | |_____^ | - = note: `-D if-not-else` implied by `-D warnings` = help: change to `==` and swap the blocks of the if/else -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/invalid_upcast_comparisons.stderr b/clippy_tests/examples/invalid_upcast_comparisons.stderr index c0be0c8b89d6..8e51609f5722 100644 --- a/clippy_tests/examples/invalid_upcast_comparisons.stderr +++ b/clippy_tests/examples/invalid_upcast_comparisons.stderr @@ -11,210 +11,158 @@ error: because of the numeric bounds on `u8` prior to casting, this expression i | 17 | (u8 as i32) > 300; | ^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always false --> invalid_upcast_comparisons.rs:18:5 | 18 | (u8 as u32) == 300; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always false --> invalid_upcast_comparisons.rs:19:5 | 19 | (u8 as i32) == 300; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always false --> invalid_upcast_comparisons.rs:20:5 | 20 | 300 < (u8 as u32); | ^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always false --> invalid_upcast_comparisons.rs:21:5 | 21 | 300 < (u8 as i32); | ^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always false --> invalid_upcast_comparisons.rs:22:5 | 22 | 300 == (u8 as u32); | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always false --> invalid_upcast_comparisons.rs:23:5 | 23 | 300 == (u8 as i32); | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:25:5 | 25 | (u8 as u32) <= 300; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:26:5 | 26 | (u8 as i32) <= 300; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:27:5 | 27 | (u8 as u32) != 300; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:28:5 | 28 | (u8 as i32) != 300; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:29:5 | 29 | 300 >= (u8 as u32); | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:30:5 | 30 | 300 >= (u8 as i32); | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:31:5 | 31 | 300 != (u8 as u32); | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:32:5 | 32 | 300 != (u8 as i32); | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always false --> invalid_upcast_comparisons.rs:35:5 | 35 | (u8 as i32) < 0; | ^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:36:5 | 36 | -5 != (u8 as i32); | ^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:38:5 | 38 | (u8 as i32) >= 0; | ^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always false --> invalid_upcast_comparisons.rs:39:5 | 39 | -5 == (u8 as i32); | ^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always false --> invalid_upcast_comparisons.rs:42:5 | 42 | 1337 == (u8 as i32); | ^^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always false --> invalid_upcast_comparisons.rs:43:5 | 43 | 1337 == (u8 as u32); | ^^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:45:5 | 45 | 1337 != (u8 as i32); | ^^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:46:5 | 46 | 1337 != (u8 as u32); | ^^^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always true --> invalid_upcast_comparisons.rs:61:5 | 61 | (u8 as i32) > -1; | ^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always false --> invalid_upcast_comparisons.rs:62:5 | 62 | (u8 as i32) < -1; | ^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` error: because of the numeric bounds on `u8` prior to casting, this expression is always false --> invalid_upcast_comparisons.rs:78:5 | 78 | -5 >= (u8 as i32); | ^^^^^^^^^^^^^^^^^ - | - = note: `-D invalid-upcast-comparisons` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 27 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/item_after_statement.stderr b/clippy_tests/examples/item_after_statement.stderr index 6674115ff86e..c01a1099d1e7 100644 --- a/clippy_tests/examples/item_after_statement.stderr +++ b/clippy_tests/examples/item_after_statement.stderr @@ -11,10 +11,8 @@ error: adding items after statements is confusing, since items exist from the st | 17 | fn foo() { println!("foo"); } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D items-after-statements` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/large_enum_variant.stderr b/clippy_tests/examples/large_enum_variant.stderr index 1a117f8af24d..fd71dc9c1496 100644 --- a/clippy_tests/examples/large_enum_variant.stderr +++ b/clippy_tests/examples/large_enum_variant.stderr @@ -14,7 +14,6 @@ error: large size difference between variants 21 | C(T, [i32; 8000]), | ^^^^^^^^^^^^^^^^^ | - = note: `-D large-enum-variant` implied by `-D warnings` help: consider boxing the large fields to reduce the total size of the enum --> large_enum_variant.rs:21:5 | @@ -27,7 +26,6 @@ error: large size difference between variants 34 | ContainingLargeEnum(LargeEnum), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D large-enum-variant` implied by `-D warnings` help: consider boxing the large fields to reduce the total size of the enum | ContainingLargeEnum(Box), @@ -37,7 +35,6 @@ error: large size difference between variants 37 | ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D large-enum-variant` implied by `-D warnings` help: consider boxing the large fields to reduce the total size of the enum --> large_enum_variant.rs:37:5 | @@ -50,7 +47,6 @@ error: large size difference between variants 44 | StructLikeLarge { x: [i32; 8000], y: i32 }, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D large-enum-variant` implied by `-D warnings` help: consider boxing the large fields to reduce the total size of the enum --> large_enum_variant.rs:44:5 | @@ -63,11 +59,10 @@ error: large size difference between variants 49 | StructLikeLarge2 { x: [i32; 8000] }, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D large-enum-variant` implied by `-D warnings` help: consider boxing the large fields to reduce the total size of the enum | StructLikeLarge2 { x: Box<[i32; 8000]> }, -error: aborting due to previous error(s) +error: aborting due to 6 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/len_zero.stderr b/clippy_tests/examples/len_zero.stderr index 15790e11b082..0ab65d468f86 100644 --- a/clippy_tests/examples/len_zero.stderr +++ b/clippy_tests/examples/len_zero.stderr @@ -17,8 +17,6 @@ error: trait `PubTraitsToo` has a `len` method but no `is_empty` method 56 | | fn len(self: &Self) -> isize; 57 | | } | |_^ - | - = note: `-D len-without-is-empty` implied by `-D warnings` error: item `HasIsEmpty` has a public `len` method but a private `is_empty` method --> len_zero.rs:89:1 @@ -31,8 +29,6 @@ error: item `HasIsEmpty` has a public `len` method but a private `is_empty` meth 96 | | } 97 | | } | |_^ - | - = note: `-D len-without-is-empty` implied by `-D warnings` error: item `HasWrongIsEmpty` has a public `len` method but no corresponding `is_empty` method --> len_zero.rs:118:1 @@ -45,8 +41,6 @@ error: item `HasWrongIsEmpty` has a public `len` method but no corresponding `is 125 | | } 126 | | } | |_^ - | - = note: `-D len-without-is-empty` implied by `-D warnings` error: length comparison to zero --> len_zero.rs:130:8 @@ -61,50 +55,38 @@ error: length comparison to zero | 134 | if "".len() == 0 { | ^^^^^^^^^^^^^ help: using `is_empty` is more concise: `"".is_empty()` - | - = note: `-D len-zero` implied by `-D warnings` error: length comparison to zero --> len_zero.rs:148:8 | 148 | if has_is_empty.len() == 0 { | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `has_is_empty.is_empty()` - | - = note: `-D len-zero` implied by `-D warnings` error: length comparison to zero --> len_zero.rs:151:8 | 151 | if has_is_empty.len() != 0 { | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()` - | - = note: `-D len-zero` implied by `-D warnings` error: length comparison to zero --> len_zero.rs:154:8 | 154 | if has_is_empty.len() > 0 { | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()` - | - = note: `-D len-zero` implied by `-D warnings` error: length comparison to zero --> len_zero.rs:160:8 | 160 | if with_is_empty.len() == 0 { | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `with_is_empty.is_empty()` - | - = note: `-D len-zero` implied by `-D warnings` error: length comparison to zero --> len_zero.rs:172:8 | 172 | if b.len() != 0 { | ^^^^^^^^^^^^ help: using `is_empty` is more concise: `!b.is_empty()` - | - = note: `-D len-zero` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 11 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/let_if_seq.stderr b/clippy_tests/examples/let_if_seq.stderr index 137ae636d497..e33adf4fd7ce 100644 --- a/clippy_tests/examples/let_if_seq.stderr +++ b/clippy_tests/examples/let_if_seq.stderr @@ -22,7 +22,6 @@ error: `if _ { .. } else { .. }` is an expression 69 | | } | |_____^ help: it is more idiomatic to write `let bar = if f() { ..; 42 } else { ..; 0 };` | - = note: `-D useless-let-if-seq` implied by `-D warnings` = note: you might not need `mut` at all error: `if _ { .. } else { .. }` is an expression @@ -35,8 +34,6 @@ error: `if _ { .. } else { .. }` is an expression 75 | | quz = 0; 76 | | } | |_____^ help: it is more idiomatic to write `let quz = if f() { 42 } else { 0 };` - | - = note: `-D useless-let-if-seq` implied by `-D warnings` error: `if _ { .. } else { .. }` is an expression --> let_if_seq.rs:100:5 @@ -47,10 +44,9 @@ error: `if _ { .. } else { .. }` is an expression 103 | | } | |_____^ help: it is more idiomatic to write `let baz = if f() { 42 } else { 0 };` | - = note: `-D useless-let-if-seq` implied by `-D warnings` = note: you might not need `mut` at all -error: aborting due to previous error(s) +error: aborting due to 4 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/let_return.stderr b/clippy_tests/examples/let_return.stderr index f9d5a36e780b..7de107d48671 100644 --- a/clippy_tests/examples/let_return.stderr +++ b/clippy_tests/examples/let_return.stderr @@ -17,14 +17,13 @@ error: returning the result of a let binding from a block. Consider returning th 16 | x | ^ | - = note: `-D let-and-return` implied by `-D warnings` note: this expression can be directly returned --> let_return.rs:15:17 | 15 | let x = 5; | ^ -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/let_unit.stderr b/clippy_tests/examples/let_unit.stderr index af3b324d8136..e6a883b87ea0 100644 --- a/clippy_tests/examples/let_unit.stderr +++ b/clippy_tests/examples/let_unit.stderr @@ -11,10 +11,8 @@ error: this let-binding has unit value. Consider omitting `let _a =` | 18 | let _a = (); | ^^^^^^^^^^^^ - | - = note: `-D let-unit-value` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/lifetimes.stderr b/clippy_tests/examples/lifetimes.stderr index e02bf6053705..95b750f3bda0 100644 --- a/clippy_tests/examples/lifetimes.stderr +++ b/clippy_tests/examples/lifetimes.stderr @@ -11,40 +11,30 @@ error: explicit lifetimes given in parameter types where they could be elided | 9 | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` error: explicit lifetimes given in parameter types where they could be elided --> lifetimes.rs:17:1 | 17 | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 { x } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` error: explicit lifetimes given in parameter types where they could be elided --> lifetimes.rs:29:1 | 29 | fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> { Ok(x) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` error: explicit lifetimes given in parameter types where they could be elided --> lifetimes.rs:32:1 | 32 | fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> where T: Copy { Ok(x) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` error: explicit lifetimes given in parameter types where they could be elided --> lifetimes.rs:38:1 | 38 | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` error: explicit lifetimes given in parameter types where they could be elided --> lifetimes.rs:52:1 @@ -53,66 +43,50 @@ error: explicit lifetimes given in parameter types where they could be elided 53 | | where for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I> 54 | | { unreachable!() } | |__________________^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` error: explicit lifetimes given in parameter types where they could be elided --> lifetimes.rs:61:5 | 61 | fn self_and_out<'s>(&'s self) -> &'s u8 { &self.x } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` error: explicit lifetimes given in parameter types where they could be elided --> lifetimes.rs:65:5 | 65 | fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` error: explicit lifetimes given in parameter types where they could be elided --> lifetimes.rs:81:1 | 81 | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { unimplemented!() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` error: explicit lifetimes given in parameter types where they could be elided --> lifetimes.rs:101:1 | 101 | fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str { unimplemented!() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` error: explicit lifetimes given in parameter types where they could be elided --> lifetimes.rs:105:1 | 105 | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { unimplemented!() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` error: explicit lifetimes given in parameter types where they could be elided --> lifetimes.rs:116:1 | 116 | fn named_input_elided_output<'a>(_arg: &'a str) -> &str { unimplemented!() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` error: explicit lifetimes given in parameter types where they could be elided --> lifetimes.rs:120:1 | 120 | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { unimplemented!() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-lifetimes` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 14 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/lint_pass.stderr b/clippy_tests/examples/lint_pass.stderr index 682a50bccc51..bb4be74faecc 100644 --- a/clippy_tests/examples/lint_pass.stderr +++ b/clippy_tests/examples/lint_pass.stderr @@ -6,7 +6,7 @@ error: the lint `MISSING_LINT` is not added to any `LintPass` | = note: `-D lint-without-lint-pass` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/literals.stderr b/clippy_tests/examples/literals.stderr index ab72ba5ee436..45ecf561e99a 100644 --- a/clippy_tests/examples/literals.stderr +++ b/clippy_tests/examples/literals.stderr @@ -11,16 +11,12 @@ error: inconsistent casing in hexadecimal literal | 15 | let fail2 = 0xabCD_u32; | ^^^^^^^^^^ - | - = note: `-D mixed-case-hex-literals` implied by `-D warnings` error: inconsistent casing in hexadecimal literal --> literals.rs:16:17 | 16 | let fail2 = 0xabCD_isize; | ^^^^^^^^^^^^ - | - = note: `-D mixed-case-hex-literals` implied by `-D warnings` error: integer type suffix should be separated by an underscore --> literals.rs:17:27 @@ -47,40 +43,30 @@ error: integer type suffix should be separated by an underscore | 22 | let fail3 = 1234i32; | ^^^^^^^ - | - = note: `-D unseparated-literal-suffix` implied by `-D warnings` error: integer type suffix should be separated by an underscore --> literals.rs:23:17 | 23 | let fail4 = 1234u32; | ^^^^^^^ - | - = note: `-D unseparated-literal-suffix` implied by `-D warnings` error: integer type suffix should be separated by an underscore --> literals.rs:24:17 | 24 | let fail5 = 1234isize; | ^^^^^^^^^ - | - = note: `-D unseparated-literal-suffix` implied by `-D warnings` error: integer type suffix should be separated by an underscore --> literals.rs:25:17 | 25 | let fail6 = 1234usize; | ^^^^^^^^^ - | - = note: `-D unseparated-literal-suffix` implied by `-D warnings` error: float type suffix should be separated by an underscore --> literals.rs:26:17 | 26 | let fail7 = 1.5f32; | ^^^^^^ - | - = note: `-D unseparated-literal-suffix` implied by `-D warnings` error: this is a decimal constant --> literals.rs:30:17 @@ -88,13 +74,12 @@ error: this is a decimal constant 30 | let fail8 = 0123; | ^^^^ | - = note: `-D zero-prefixed-literal` implied by `-D warnings` help: if you mean to use a decimal constant, remove the `0` to remove confusion: | let fail8 = 123; help: if you mean to use an octal constant, use `0o`: | let fail8 = 0o123; -error: aborting due to previous error(s) +error: aborting due to 11 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/map_clone.stderr b/clippy_tests/examples/map_clone.stderr index 1e6dfb82e818..2e32f7ade60e 100644 --- a/clippy_tests/examples/map_clone.stderr +++ b/clippy_tests/examples/map_clone.stderr @@ -14,7 +14,6 @@ error: you seem to be using .map() to clone the contents of an iterator, conside 14 | x.iter().map(|&y| y); | ^^^^^^^^^^^^^^^^^^^^ | - = note: `-D map-clone` implied by `-D warnings` = help: try x.iter().cloned() @@ -24,7 +23,6 @@ error: you seem to be using .map() to clone the contents of an iterator, conside 16 | x.iter().map(|y| *y); | ^^^^^^^^^^^^^^^^^^^^ | - = note: `-D map-clone` implied by `-D warnings` = help: try x.iter().cloned() @@ -34,7 +32,6 @@ error: you seem to be using .map() to clone the contents of an iterator, conside 18 | x.iter().map(|y| { y.clone() }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D map-clone` implied by `-D warnings` = help: try x.iter().cloned() @@ -44,7 +41,6 @@ error: you seem to be using .map() to clone the contents of an iterator, conside 20 | x.iter().map(|&y| { y }); | ^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D map-clone` implied by `-D warnings` = help: try x.iter().cloned() @@ -54,7 +50,6 @@ error: you seem to be using .map() to clone the contents of an iterator, conside 22 | x.iter().map(|y| { *y }); | ^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D map-clone` implied by `-D warnings` = help: try x.iter().cloned() @@ -64,7 +59,6 @@ error: you seem to be using .map() to clone the contents of an iterator, conside 24 | x.iter().map(Clone::clone); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D map-clone` implied by `-D warnings` = help: try x.iter().cloned() @@ -74,7 +68,6 @@ error: you seem to be using .map() to clone the contents of an Option, consider 30 | x.as_ref().map(|y| y.clone()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D map-clone` implied by `-D warnings` = help: try x.as_ref().cloned() @@ -84,7 +77,6 @@ error: you seem to be using .map() to clone the contents of an Option, consider 32 | x.as_ref().map(|&y| y); | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D map-clone` implied by `-D warnings` = help: try x.as_ref().cloned() @@ -94,7 +86,6 @@ error: you seem to be using .map() to clone the contents of an Option, consider 34 | x.as_ref().map(|y| *y); | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D map-clone` implied by `-D warnings` = help: try x.as_ref().cloned() @@ -104,11 +95,10 @@ error: you seem to be using .map() to clone the contents of an Option, consider 90 | let _: Option = x.as_ref().map(|y| *y); | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D map-clone` implied by `-D warnings` = help: try x.as_ref().cloned() -error: aborting due to previous error(s) +error: aborting due to 11 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/matches.stderr b/clippy_tests/examples/matches.stderr index 62f4a2be16a2..eafb4da0f74c 100644 --- a/clippy_tests/examples/matches.stderr +++ b/clippy_tests/examples/matches.stderr @@ -28,8 +28,6 @@ error: you seem to be trying to use match for destructuring a single pattern. Co 43 | | _ => {} 44 | | }; | |_____^ help: try this `if let (2...3, 7...9) = z { dummy() }` - | - = note: `-D single-match` implied by `-D warnings` error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let` --> matches.rs:63:5 @@ -39,8 +37,6 @@ error: you seem to be trying to use match for destructuring a single pattern. Co 65 | | None => () 66 | | }; | |_____^ help: try this `if let Some(y) = x { dummy() }` - | - = note: `-D single-match` implied by `-D warnings` error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let` --> matches.rs:68:5 @@ -50,8 +46,6 @@ error: you seem to be trying to use match for destructuring a single pattern. Co 70 | | Err(..) => () 71 | | }; | |_____^ help: try this `if let Ok(y) = y { dummy() }` - | - = note: `-D single-match` implied by `-D warnings` error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let` --> matches.rs:75:5 @@ -61,8 +55,6 @@ error: you seem to be trying to use match for destructuring a single pattern. Co 77 | | Cow::Owned(..) => (), 78 | | }; | |_____^ help: try this `if let Cow::Borrowed(..) = c { dummy() }` - | - = note: `-D single-match` implied by `-D warnings` error: you seem to be trying to match on a boolean expression --> matches.rs:96:5 @@ -83,8 +75,6 @@ error: you seem to be trying to match on a boolean expression 104 | | false => 0, 105 | | }; | |_____^ help: consider using an if/else expression `if option == 1 { 1 } else { 0 }` - | - = note: `-D match-bool` implied by `-D warnings` error: you seem to be trying to match on a boolean expression --> matches.rs:107:5 @@ -94,8 +84,6 @@ error: you seem to be trying to match on a boolean expression 109 | | false => { println!("Noooo!"); } 110 | | }; | |_____^ help: consider using an if/else expression `if !test { println!("Noooo!"); }` - | - = note: `-D match-bool` implied by `-D warnings` error: you seem to be trying to match on a boolean expression --> matches.rs:112:5 @@ -105,8 +93,6 @@ error: you seem to be trying to match on a boolean expression 114 | | _ => (), 115 | | }; | |_____^ help: consider using an if/else expression `if !test { println!("Noooo!"); }` - | - = note: `-D match-bool` implied by `-D warnings` error: you seem to be trying to match on a boolean expression --> matches.rs:117:5 @@ -116,8 +102,6 @@ error: you seem to be trying to match on a boolean expression 119 | | _ => (), 120 | | }; | |_____^ help: consider using an if/else expression `if !(test && test) { println!("Noooo!"); }` - | - = note: `-D match-bool` implied by `-D warnings` error: equal expressions as operands to `&&` --> matches.rs:117:11 @@ -135,8 +119,6 @@ error: you seem to be trying to match on a boolean expression 124 | | true => { println!("Yes!"); } 125 | | }; | |_____^ help: consider using an if/else expression `if test { println!("Yes!"); } else { println!("Noooo!"); }` - | - = note: `-D match-bool` implied by `-D warnings` error: you don't need to add `&` to all patterns --> matches.rs:138:9 @@ -160,7 +142,6 @@ error: you don't need to add `&` to all patterns 151 | | } | |_____^ | - = note: `-D match-ref-pats` implied by `-D warnings` help: instead of prefixing all patterns with `&`, you can dereference the expression | match *tup { .. } @@ -172,8 +153,6 @@ error: you don't need to add `&` to both the expression and the patterns 156 | | &None => println!("none"), 157 | | } | |_____^ help: try `match w { .. }` - | - = note: `-D match-ref-pats` implied by `-D warnings` error: you don't need to add `&` to all patterns --> matches.rs:165:5 @@ -183,7 +162,6 @@ error: you don't need to add `&` to all patterns 167 | | } | |_____^ | - = note: `-D match-ref-pats` implied by `-D warnings` help: instead of prefixing all patterns with `&`, you can dereference the expression | if let .. = *a { .. } @@ -194,8 +172,6 @@ error: you don't need to add `&` to both the expression and the patterns 171 | | println!("none"); 172 | | } | |_____^ help: try `if let .. = b { .. }` - | - = note: `-D match-ref-pats` implied by `-D warnings` error: some ranges overlap --> matches.rs:179:9 @@ -216,7 +192,6 @@ error: some ranges overlap 185 | 0 ... 5 => println!("0 ... 5"), | ^^^^^^^ | - = note: `-D match-overlapping-arm` implied by `-D warnings` note: overlaps with this --> matches.rs:187:9 | @@ -229,7 +204,6 @@ error: some ranges overlap 193 | 0 ... 5 => println!("0 ... 5"), | ^^^^^^^ | - = note: `-D match-overlapping-arm` implied by `-D warnings` note: overlaps with this --> matches.rs:192:9 | @@ -242,7 +216,6 @@ error: some ranges overlap 199 | 0 ... 2 => println!("0 ... 2"), | ^^^^^^^ | - = note: `-D match-overlapping-arm` implied by `-D warnings` note: overlaps with this --> matches.rs:198:9 | @@ -255,7 +228,6 @@ error: some ranges overlap 222 | 0 .. 11 => println!("0 .. 11"), | ^^^^^^^ | - = note: `-D match-overlapping-arm` implied by `-D warnings` note: overlaps with this --> matches.rs:223:9 | @@ -277,7 +249,6 @@ error: Err(_) will match all errors, maybe not a good idea 246 | Err(_) => {panic!()} | ^^^^^^ | - = note: `-D match-wild-err-arm` implied by `-D warnings` = note: to remove this warning, match each error seperately or use unreachable macro error: Err(_) will match all errors, maybe not a good idea @@ -286,10 +257,9 @@ error: Err(_) will match all errors, maybe not a good idea 252 | Err(_) => {panic!();} | ^^^^^^ | - = note: `-D match-wild-err-arm` implied by `-D warnings` = note: to remove this warning, match each error seperately or use unreachable macro -error: aborting due to previous error(s) +error: aborting due to 26 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/mem_forget.stderr b/clippy_tests/examples/mem_forget.stderr index a17652d1bc84..a1ae2c0859c5 100644 --- a/clippy_tests/examples/mem_forget.stderr +++ b/clippy_tests/examples/mem_forget.stderr @@ -11,18 +11,14 @@ error: usage of mem::forget on Drop type | 21 | std::mem::forget(seven); | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D mem-forget` implied by `-D warnings` error: usage of mem::forget on Drop type --> mem_forget.rs:24:5 | 24 | forgetSomething(eight); | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D mem-forget` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 3 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/methods.stderr b/clippy_tests/examples/methods.stderr index 9633f596263a..51cbf35a471e 100644 --- a/clippy_tests/examples/methods.stderr +++ b/clippy_tests/examples/methods.stderr @@ -11,8 +11,6 @@ error: defining a method called `drop` on this type; consider implementing the ` | 19 | fn drop(&mut self) { } | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D should-implement-trait` implied by `-D warnings` error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name --> methods.rs:26:17 @@ -27,16 +25,12 @@ error: methods called `to_*` usually take self by reference; consider choosing a | 28 | fn to_something(self) -> u32 { 0 } | ^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` error: methods called `new` usually take no self; consider choosing a less ambiguous name --> methods.rs:30:12 | 30 | fn new(self) {} | ^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` error: methods called `new` usually return `Self` --> methods.rs:30:5 @@ -67,8 +61,6 @@ error: called `map(f).unwrap_or(a)` on an Option value. This can be done more di 103 | | } 104 | | ).unwrap_or(0); | |____________________________^ - | - = note: `-D option-map-unwrap-or` implied by `-D warnings` error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead --> methods.rs:105:13 @@ -79,8 +71,6 @@ error: called `map(f).unwrap_or(a)` on an Option value. This can be done more di 107 | | 0 108 | | }); | |__________________^ - | - = note: `-D option-map-unwrap-or` implied by `-D warnings` error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead --> methods.rs:114:13 @@ -103,8 +93,6 @@ error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done mo 120 | | } 121 | | ).unwrap_or_else(|| 0); | |____________________________________^ - | - = note: `-D option-map-unwrap-or-else` implied by `-D warnings` error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead --> methods.rs:122:13 @@ -115,8 +103,6 @@ error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done mo 124 | | 0 125 | | ); | |_________________^ - | - = note: `-D option-map-unwrap-or-else` implied by `-D warnings` error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead. --> methods.rs:194:13 @@ -136,8 +122,6 @@ error: called `filter(p).next()` on an `Iterator`. This is more succinctly expre 199 | | } 200 | | ).next(); | |___________________________^ - | - = note: `-D filter-next` implied by `-D warnings` error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`. --> methods.rs:212:13 @@ -157,8 +141,6 @@ error: called `is_some()` after searching an `Iterator` with find. This is more 217 | | } 218 | | ).is_some(); | |______________________________^ - | - = note: `-D search-is-some` implied by `-D warnings` error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`. --> methods.rs:221:13 @@ -166,7 +148,6 @@ error: called `is_some()` after searching an `Iterator` with position. This is m 221 | let _ = v.iter().position(|&x| x < 0).is_some(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D search-is-some` implied by `-D warnings` = note: replace `position(|&x| x < 0).is_some()` with `any(|&x| x < 0)` error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`. @@ -178,8 +159,6 @@ error: called `is_some()` after searching an `Iterator` with position. This is m 226 | | } 227 | | ).is_some(); | |______________________________^ - | - = note: `-D search-is-some` implied by `-D warnings` error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`. --> methods.rs:230:13 @@ -187,7 +166,6 @@ error: called `is_some()` after searching an `Iterator` with rposition. This is 230 | let _ = v.iter().rposition(|&x| x < 0).is_some(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D search-is-some` implied by `-D warnings` = note: replace `rposition(|&x| x < 0).is_some()` with `any(|&x| x < 0)` error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`. @@ -199,8 +177,6 @@ error: called `is_some()` after searching an `Iterator` with rposition. This is 235 | | } 236 | | ).is_some(); | |______________________________^ - | - = note: `-D search-is-some` implied by `-D warnings` error: use of `unwrap_or` followed by a function call --> methods.rs:268:5 @@ -215,88 +191,66 @@ error: use of `unwrap_or` followed by a call to `new` | 271 | with_new.unwrap_or(Vec::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_new.unwrap_or_default()` - | - = note: `-D or-fun-call` implied by `-D warnings` error: use of `unwrap_or` followed by a function call --> methods.rs:274:5 | 274 | with_const_args.unwrap_or(Vec::with_capacity(12)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_const_args.unwrap_or_else(|| Vec::with_capacity(12))` - | - = note: `-D or-fun-call` implied by `-D warnings` error: use of `unwrap_or` followed by a function call --> methods.rs:277:5 | 277 | with_err.unwrap_or(make()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_err.unwrap_or_else(|_| make())` - | - = note: `-D or-fun-call` implied by `-D warnings` error: use of `unwrap_or` followed by a function call --> methods.rs:280:5 | 280 | with_err_args.unwrap_or(Vec::with_capacity(12)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_err_args.unwrap_or_else(|_| Vec::with_capacity(12))` - | - = note: `-D or-fun-call` implied by `-D warnings` error: use of `unwrap_or` followed by a call to `default` --> methods.rs:283:5 | 283 | with_default_trait.unwrap_or(Default::default()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_default_trait.unwrap_or_default()` - | - = note: `-D or-fun-call` implied by `-D warnings` error: use of `unwrap_or` followed by a call to `default` --> methods.rs:286:5 | 286 | with_default_type.unwrap_or(u64::default()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_default_type.unwrap_or_default()` - | - = note: `-D or-fun-call` implied by `-D warnings` error: use of `unwrap_or` followed by a function call --> methods.rs:289:5 | 289 | with_vec.unwrap_or(vec![]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_vec.unwrap_or_else(|| < [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ))` - | - = note: `-D or-fun-call` implied by `-D warnings` error: use of `unwrap_or` followed by a function call --> methods.rs:294:5 | 294 | without_default.unwrap_or(Foo::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `without_default.unwrap_or_else(Foo::new)` - | - = note: `-D or-fun-call` implied by `-D warnings` error: use of `or_insert` followed by a function call --> methods.rs:297:5 | 297 | map.entry(42).or_insert(String::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `map.entry(42).or_insert_with(String::new)` - | - = note: `-D or-fun-call` implied by `-D warnings` error: use of `or_insert` followed by a function call --> methods.rs:300:5 | 300 | btree.entry(42).or_insert(String::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `btree.entry(42).or_insert_with(String::new)` - | - = note: `-D or-fun-call` implied by `-D warnings` error: use of `unwrap_or` followed by a function call --> methods.rs:303:13 | 303 | let _ = stringy.unwrap_or("".to_owned()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `stringy.unwrap_or_else(|| "".to_owned())` - | - = note: `-D or-fun-call` implied by `-D warnings` error: called `.iter().nth()` on a Vec. Calling `.get()` is both faster and more readable --> methods.rs:314:23 @@ -311,48 +265,36 @@ error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and mo | 315 | let bad_slice = &some_vec[..].iter().nth(3); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D iter-nth` implied by `-D warnings` error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable --> methods.rs:316:31 | 316 | let bad_boxed_slice = boxed_slice.iter().nth(3); | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D iter-nth` implied by `-D warnings` error: called `.iter().nth()` on a VecDeque. Calling `.get()` is both faster and more readable --> methods.rs:317:29 | 317 | let bad_vec_deque = some_vec_deque.iter().nth(3); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D iter-nth` implied by `-D warnings` error: called `.iter_mut().nth()` on a Vec. Calling `.get_mut()` is both faster and more readable --> methods.rs:322:23 | 322 | let bad_vec = some_vec.iter_mut().nth(3); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D iter-nth` implied by `-D warnings` error: called `.iter_mut().nth()` on a slice. Calling `.get_mut()` is both faster and more readable --> methods.rs:325:26 | 325 | let bad_slice = &some_vec[..].iter_mut().nth(3); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D iter-nth` implied by `-D warnings` error: called `.iter_mut().nth()` on a VecDeque. Calling `.get_mut()` is both faster and more readable --> methods.rs:328:29 | 328 | let bad_vec_deque = some_vec_deque.iter_mut().nth(3); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D iter-nth` implied by `-D warnings` error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)` --> methods.rs:340:13 @@ -367,24 +309,18 @@ error: called `skip(x).next()` on an iterator. This is more succinctly expressed | 341 | let _ = some_vec.iter().cycle().skip(42).next(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D iter-skip-next` implied by `-D warnings` error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)` --> methods.rs:342:13 | 342 | let _ = (1..10).skip(10).next(); | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D iter-skip-next` implied by `-D warnings` error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)` --> methods.rs:343:14 | 343 | let _ = &some_vec[..].iter().skip(3).next(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D iter-skip-next` implied by `-D warnings` error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise --> methods.rs:369:17 @@ -399,72 +335,54 @@ error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more co | 370 | let _ = some_slice.get(0).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&some_slice[0]` - | - = note: `-D get-unwrap` implied by `-D warnings` error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise --> methods.rs:371:17 | 371 | let _ = some_vec.get(0).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&some_vec[0]` - | - = note: `-D get-unwrap` implied by `-D warnings` error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise --> methods.rs:372:17 | 372 | let _ = some_vecdeque.get(0).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&some_vecdeque[0]` - | - = note: `-D get-unwrap` implied by `-D warnings` error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise --> methods.rs:373:17 | 373 | let _ = some_hashmap.get(&1).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&some_hashmap[&1]` - | - = note: `-D get-unwrap` implied by `-D warnings` error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise --> methods.rs:374:17 | 374 | let _ = some_btreemap.get(&1).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&some_btreemap[&1]` - | - = note: `-D get-unwrap` implied by `-D warnings` error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise --> methods.rs:379:10 | 379 | *boxed_slice.get_mut(0).unwrap() = 1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&mut boxed_slice[0]` - | - = note: `-D get-unwrap` implied by `-D warnings` error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise --> methods.rs:380:10 | 380 | *some_slice.get_mut(0).unwrap() = 1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&mut some_slice[0]` - | - = note: `-D get-unwrap` implied by `-D warnings` error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise --> methods.rs:381:10 | 381 | *some_vec.get_mut(0).unwrap() = 1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&mut some_vec[0]` - | - = note: `-D get-unwrap` implied by `-D warnings` error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise --> methods.rs:382:10 | 382 | *some_vecdeque.get_mut(0).unwrap() = 1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&mut some_vecdeque[0]` - | - = note: `-D get-unwrap` implied by `-D warnings` error: used unwrap() on an Option value. If you don't want to handle the None case gracefully, consider using expect() to provide a better panic message --> methods.rs:396:13 @@ -495,32 +413,24 @@ error: called `ok().expect()` on a Result value. You can call `expect` directly | 407 | res3.ok().expect("whoof"); | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D ok-expect` implied by `-D warnings` error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` --> methods.rs:409:5 | 409 | res4.ok().expect("argh"); | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D ok-expect` implied by `-D warnings` error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` --> methods.rs:411:5 | 411 | res5.ok().expect("oops"); | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D ok-expect` implied by `-D warnings` error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` --> methods.rs:413:5 | 413 | res6.ok().expect("meh"); | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D ok-expect` implied by `-D warnings` error: you should use the `starts_with` method --> methods.rs:425:5 @@ -535,8 +445,6 @@ error: you should use the `starts_with` method | 426 | Some(' ') != "".chars().next(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this `!"".starts_with(' ')` - | - = note: `-D chars-next-cmp` implied by `-D warnings` error: calling `.extend(_.chars())` --> methods.rs:435:5 @@ -551,16 +459,12 @@ error: calling `.extend(_.chars())` | 438 | s.extend("abc".chars()); | ^^^^^^^^^^^^^^^^^^^^^^^ help: try this `s.push_str("abc")` - | - = note: `-D string-extend-chars` implied by `-D warnings` error: calling `.extend(_.chars())` --> methods.rs:441:5 | 441 | s.extend(def.chars()); | ^^^^^^^^^^^^^^^^^^^^^ help: try this `s.push_str(&def)` - | - = note: `-D string-extend-chars` implied by `-D warnings` error: using `clone` on a `Copy` type --> methods.rs:452:5 @@ -575,24 +479,18 @@ error: using `clone` on a `Copy` type | 456 | (&42).clone(); | ^^^^^^^^^^^^^ help: try dereferencing it `*(&42)` - | - = note: `-D clone-on-copy` implied by `-D warnings` error: using `clone` on a `Copy` type --> methods.rs:460:5 | 460 | t.clone(); | ^^^^^^^^^ help: try removing the `clone` call `t` - | - = note: `-D clone-on-copy` implied by `-D warnings` error: using `clone` on a `Copy` type --> methods.rs:462:5 | 462 | Some(t).clone(); | ^^^^^^^^^^^^^^^ help: try removing the `clone` call `Some(t)` - | - = note: `-D clone-on-copy` implied by `-D warnings` error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type --> methods.rs:468:22 @@ -615,128 +513,96 @@ error: single-character string constant used as pattern | 492 | x.contains("x"); | -----------^^^- help: try using a char instead: `x.contains('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:493:19 | 493 | x.starts_with("x"); | --------------^^^- help: try using a char instead: `x.starts_with('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:494:17 | 494 | x.ends_with("x"); | ------------^^^- help: try using a char instead: `x.ends_with('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:495:12 | 495 | x.find("x"); | -------^^^- help: try using a char instead: `x.find('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:496:13 | 496 | x.rfind("x"); | --------^^^- help: try using a char instead: `x.rfind('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:497:14 | 497 | x.rsplit("x"); | ---------^^^- help: try using a char instead: `x.rsplit('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:498:24 | 498 | x.split_terminator("x"); | -------------------^^^- help: try using a char instead: `x.split_terminator('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:499:25 | 499 | x.rsplit_terminator("x"); | --------------------^^^- help: try using a char instead: `x.rsplit_terminator('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:500:17 | 500 | x.splitn(0, "x"); | ------------^^^- help: try using a char instead: `x.splitn(0, 'x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:501:18 | 501 | x.rsplitn(0, "x"); | -------------^^^- help: try using a char instead: `x.rsplitn(0, 'x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:502:15 | 502 | x.matches("x"); | ----------^^^- help: try using a char instead: `x.matches('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:503:16 | 503 | x.rmatches("x"); | -----------^^^- help: try using a char instead: `x.rmatches('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:504:21 | 504 | x.match_indices("x"); | ----------------^^^- help: try using a char instead: `x.match_indices('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:505:22 | 505 | x.rmatch_indices("x"); | -----------------^^^- help: try using a char instead: `x.rmatch_indices('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:506:25 | 506 | x.trim_left_matches("x"); | --------------------^^^- help: try using a char instead: `x.trim_left_matches('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: single-character string constant used as pattern --> methods.rs:507:26 | 507 | x.trim_right_matches("x"); | ---------------------^^^- help: try using a char instead: `x.trim_right_matches('x')` - | - = note: `-D single-char-pattern` implied by `-D warnings` error: you are getting the inner pointer of a temporary `CString` --> methods.rs:517:5 @@ -760,7 +626,7 @@ error: called `cloned().collect()` on a slice to create a `Vec`. Calling `to_vec | = note: `-D iter-cloned-collect` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 89 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/min_max.stderr b/clippy_tests/examples/min_max.stderr index 77d509bf0c3d..caf13c4e8c3e 100644 --- a/clippy_tests/examples/min_max.stderr +++ b/clippy_tests/examples/min_max.stderr @@ -11,50 +11,38 @@ error: this min/max combination leads to constant result | 16 | min(max(3, x), 1); | ^^^^^^^^^^^^^^^^^ - | - = note: `-D min-max` implied by `-D warnings` error: this min/max combination leads to constant result --> min_max.rs:17:5 | 17 | max(min(x, 1), 3); | ^^^^^^^^^^^^^^^^^ - | - = note: `-D min-max` implied by `-D warnings` error: this min/max combination leads to constant result --> min_max.rs:18:5 | 18 | max(3, min(x, 1)); | ^^^^^^^^^^^^^^^^^ - | - = note: `-D min-max` implied by `-D warnings` error: this min/max combination leads to constant result --> min_max.rs:20:5 | 20 | my_max(3, my_min(x, 1)); | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D min-max` implied by `-D warnings` error: this min/max combination leads to constant result --> min_max.rs:29:5 | 29 | min("Apple", max("Zoo", s)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D min-max` implied by `-D warnings` error: this min/max combination leads to constant result --> min_max.rs:30:5 | 30 | max(min(s, "Apple"), "Zoo"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D min-max` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 7 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/missing-doc.stderr b/clippy_tests/examples/missing-doc.stderr index 92ef141cca88..d749fc0782d0 100644 --- a/clippy_tests/examples/missing-doc.stderr +++ b/clippy_tests/examples/missing-doc.stderr @@ -11,8 +11,6 @@ error: missing documentation for a type alias | 27 | pub type PubTypedef = String; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a struct --> missing-doc.rs:29:1 @@ -22,24 +20,18 @@ error: missing documentation for a struct 31 | | b: isize, 32 | | } | |_^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a struct field --> missing-doc.rs:30:5 | 30 | a: isize, | ^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a struct field --> missing-doc.rs:31:5 | 31 | b: isize, | ^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a struct --> missing-doc.rs:34:1 @@ -49,56 +41,42 @@ error: missing documentation for a struct 36 | | b: isize, 37 | | } | |_^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a struct field --> missing-doc.rs:35:5 | 35 | pub a: isize, | ^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a struct field --> missing-doc.rs:36:5 | 36 | b: isize, | ^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a module --> missing-doc.rs:45:1 | 45 | mod module_no_dox {} | ^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a module --> missing-doc.rs:46:1 | 46 | pub mod pub_module_no_dox {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a function --> missing-doc.rs:50:1 | 50 | pub fn foo2() {} | ^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a function --> missing-doc.rs:51:1 | 51 | fn foo3() {} | ^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a trait --> missing-doc.rs:68:1 @@ -108,72 +86,54 @@ error: missing documentation for a trait 70 | | fn foo_with_impl(&self) {} 71 | | } | |_^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a trait method --> missing-doc.rs:69:5 | 69 | fn foo(&self); | ^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a trait method --> missing-doc.rs:70:5 | 70 | fn foo_with_impl(&self) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for an associated type --> missing-doc.rs:80:5 | 80 | type AssociatedType; | ^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for an associated type --> missing-doc.rs:81:5 | 81 | type AssociatedTypeDef = Self; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a method --> missing-doc.rs:92:5 | 92 | pub fn foo() {} | ^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a method --> missing-doc.rs:93:5 | 93 | fn bar() {} | ^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a method --> missing-doc.rs:97:5 | 97 | pub fn foo() {} | ^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a method --> missing-doc.rs:100:5 | 100 | fn foo2() {} | ^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for an enum --> missing-doc.rs:126:1 @@ -186,8 +146,6 @@ error: missing documentation for an enum 131 | | BarB 132 | | } | |_^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a variant --> missing-doc.rs:127:5 @@ -197,32 +155,24 @@ error: missing documentation for a variant 129 | | b: isize 130 | | }, | |_____^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a struct field --> missing-doc.rs:128:9 | 128 | a: isize, | ^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a struct field --> missing-doc.rs:129:9 | 129 | b: isize | ^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a variant --> missing-doc.rs:131:5 | 131 | BarB | ^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for an enum --> missing-doc.rs:134:1 @@ -233,8 +183,6 @@ error: missing documentation for an enum 137 | | }, 138 | | } | |_^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a variant --> missing-doc.rs:135:5 @@ -243,48 +191,36 @@ error: missing documentation for a variant 136 | | a: isize, 137 | | }, | |_____^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a struct field --> missing-doc.rs:136:9 | 136 | a: isize, | ^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a constant --> missing-doc.rs:160:1 | 160 | const FOO: u32 = 0; | ^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a constant --> missing-doc.rs:167:1 | 167 | pub const FOO4: u32 = 0; | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a static --> missing-doc.rs:170:1 | 170 | static BAR: u32 = 0; | ^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a static --> missing-doc.rs:177:1 | 177 | pub static BAR4: u32 = 0; | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a module --> missing-doc.rs:180:1 @@ -297,58 +233,44 @@ error: missing documentation for a module 192 | | } 193 | | } | |_^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a function --> missing-doc.rs:183:5 | 183 | pub fn undocumented1() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a function --> missing-doc.rs:184:5 | 184 | pub fn undocumented2() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a function --> missing-doc.rs:185:5 | 185 | fn undocumented3() {} | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a function --> missing-doc.rs:190:9 | 190 | pub fn also_undocumented1() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a function --> missing-doc.rs:191:9 | 191 | fn also_undocumented2() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a function --> missing-doc.rs:202:1 | 202 | fn main() {} | ^^^^^^^^^^^^ - | - = note: `-D missing-docs-in-private-items` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 40 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/module_inception.stderr b/clippy_tests/examples/module_inception.stderr index 526fe551a0ad..987db94e97c4 100644 --- a/clippy_tests/examples/module_inception.stderr +++ b/clippy_tests/examples/module_inception.stderr @@ -15,10 +15,8 @@ error: module has the same name as its containing module 13 | | mod bar {} 14 | | } | |_____^ - | - = note: `-D module-inception` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/modulo_one.stderr b/clippy_tests/examples/modulo_one.stderr index 345f0a1acdac..c4f8b1d08e04 100644 --- a/clippy_tests/examples/modulo_one.stderr +++ b/clippy_tests/examples/modulo_one.stderr @@ -6,7 +6,7 @@ error: any number modulo 1 will be 0 | = note: `-D modulo-one` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/mut_from_ref.stderr b/clippy_tests/examples/mut_from_ref.stderr index a8f3d8e34d71..bb4364a4c321 100644 --- a/clippy_tests/examples/mut_from_ref.stderr +++ b/clippy_tests/examples/mut_from_ref.stderr @@ -17,7 +17,6 @@ error: mutable borrow from immutable input(s) 15 | fn ouch(x: &Foo) -> &mut Foo; | ^^^^^^^^ | - = note: `-D mut-from-ref` implied by `-D warnings` note: immutable borrow here --> mut_from_ref.rs:15:16 | @@ -30,7 +29,6 @@ error: mutable borrow from immutable input(s) 24 | fn fail(x: &u32) -> &mut u16 { | ^^^^^^^^ | - = note: `-D mut-from-ref` implied by `-D warnings` note: immutable borrow here --> mut_from_ref.rs:24:12 | @@ -43,7 +41,6 @@ error: mutable borrow from immutable input(s) 28 | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 { | ^^^^^^^^^^^ | - = note: `-D mut-from-ref` implied by `-D warnings` note: immutable borrow here --> mut_from_ref.rs:28:25 | @@ -56,14 +53,13 @@ error: mutable borrow from immutable input(s) 32 | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 { | ^^^^^^^^^^^ | - = note: `-D mut-from-ref` implied by `-D warnings` note: immutable borrow here --> mut_from_ref.rs:32:27 | 32 | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 { | ^^^^^^^ ^^^^^^^ -error: aborting due to previous error(s) +error: aborting due to 5 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/mut_mut.stderr b/clippy_tests/examples/mut_mut.stderr index 5572f19578e5..2eec18abeee7 100644 --- a/clippy_tests/examples/mut_mut.stderr +++ b/clippy_tests/examples/mut_mut.stderr @@ -11,8 +11,6 @@ error: generally you want to avoid `&mut &mut _` if possible | 24 | let mut x = &mut &mut 1u32; | ^^^^^^^^^^^^^^ - | - = note: `-D mut-mut` implied by `-D warnings` error: generally you want to avoid `&mut &mut _` if possible --> mut_mut.rs:19:20 @@ -22,90 +20,68 @@ error: generally you want to avoid `&mut &mut _` if possible ... 39 | let mut z = mut_ptr!(&mut 3u32); | ------------------- in this macro invocation - | - = note: `-D mut-mut` implied by `-D warnings` error: this expression mutably borrows a mutable reference. Consider reborrowing --> mut_mut.rs:26:21 | 26 | let mut y = &mut x; | ^^^^^^ - | - = note: `-D mut-mut` implied by `-D warnings` error: generally you want to avoid `&mut &mut _` if possible --> mut_mut.rs:30:17 | 30 | let y : &mut &mut u32 = &mut &mut 2; | ^^^^^^^^^^^^^ - | - = note: `-D mut-mut` implied by `-D warnings` error: generally you want to avoid `&mut &mut _` if possible --> mut_mut.rs:30:33 | 30 | let y : &mut &mut u32 = &mut &mut 2; | ^^^^^^^^^^^ - | - = note: `-D mut-mut` implied by `-D warnings` error: generally you want to avoid `&mut &mut _` if possible --> mut_mut.rs:30:17 | 30 | let y : &mut &mut u32 = &mut &mut 2; | ^^^^^^^^^^^^^ - | - = note: `-D mut-mut` implied by `-D warnings` error: generally you want to avoid `&mut &mut _` if possible --> mut_mut.rs:35:17 | 35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D mut-mut` implied by `-D warnings` error: generally you want to avoid `&mut &mut _` if possible --> mut_mut.rs:35:22 | 35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2; | ^^^^^^^^^^^^^ - | - = note: `-D mut-mut` implied by `-D warnings` error: generally you want to avoid `&mut &mut _` if possible --> mut_mut.rs:35:38 | 35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2; | ^^^^^^^^^^^^^^^^ - | - = note: `-D mut-mut` implied by `-D warnings` error: generally you want to avoid `&mut &mut _` if possible --> mut_mut.rs:35:17 | 35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2; | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D mut-mut` implied by `-D warnings` error: generally you want to avoid `&mut &mut _` if possible --> mut_mut.rs:35:22 | 35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2; | ^^^^^^^^^^^^^ - | - = note: `-D mut-mut` implied by `-D warnings` error: generally you want to avoid `&mut &mut _` if possible --> mut_mut.rs:35:22 | 35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2; | ^^^^^^^^^^^^^ - | - = note: `-D mut-mut` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 13 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/mut_reference.stderr b/clippy_tests/examples/mut_reference.stderr index bf6544117322..42e227bfc369 100644 --- a/clippy_tests/examples/mut_reference.stderr +++ b/clippy_tests/examples/mut_reference.stderr @@ -11,18 +11,14 @@ error: The function/method `as_ptr` doesn't need a mutable reference | 24 | as_ptr(&mut 42); | ^^^^^^^ - | - = note: `-D unnecessary-mut-passed` implied by `-D warnings` error: The function/method `takes_an_immutable_reference` doesn't need a mutable reference --> mut_reference.rs:28:44 | 28 | my_struct.takes_an_immutable_reference(&mut 42); | ^^^^^^^ - | - = note: `-D unnecessary-mut-passed` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 3 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/mutex_atomic.stderr b/clippy_tests/examples/mutex_atomic.stderr index a83384584110..403d0b8837b3 100644 --- a/clippy_tests/examples/mutex_atomic.stderr +++ b/clippy_tests/examples/mutex_atomic.stderr @@ -11,32 +11,24 @@ error: Consider using an AtomicUsize instead of a Mutex here. If you just want t | 10 | Mutex::new(5usize); | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D mutex-atomic` implied by `-D warnings` error: Consider using an AtomicIsize instead of a Mutex here. If you just want the locking behaviour and not the internal type, consider using Mutex<()>. --> mutex_atomic.rs:11:5 | 11 | Mutex::new(9isize); | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D mutex-atomic` implied by `-D warnings` error: Consider using an AtomicPtr instead of a Mutex here. If you just want the locking behaviour and not the internal type, consider using Mutex<()>. --> mutex_atomic.rs:13:5 | 13 | Mutex::new(&x as *const u32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D mutex-atomic` implied by `-D warnings` error: Consider using an AtomicPtr instead of a Mutex here. If you just want the locking behaviour and not the internal type, consider using Mutex<()>. --> mutex_atomic.rs:14:5 | 14 | Mutex::new(&mut x as *mut u32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D mutex-atomic` implied by `-D warnings` error: Consider using an AtomicUsize instead of a Mutex here. If you just want the locking behaviour and not the internal type, consider using Mutex<()>. --> mutex_atomic.rs:15:5 @@ -51,10 +43,8 @@ error: Consider using an AtomicIsize instead of a Mutex here. If you just want t | 16 | Mutex::new(0i32); | ^^^^^^^^^^^^^^^^ - | - = note: `-D mutex-integer` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 7 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/needless_bool.stderr b/clippy_tests/examples/needless_bool.stderr index b5580db24e5a..c521e1228c77 100644 --- a/clippy_tests/examples/needless_bool.stderr +++ b/clippy_tests/examples/needless_bool.stderr @@ -11,82 +11,62 @@ error: this if-then-else expression will always return false | 10 | if x { false } else { false }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-bool` implied by `-D warnings` error: this if-then-else expression returns a bool literal --> needless_bool.rs:11:5 | 11 | if x { true } else { false }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `x` - | - = note: `-D needless-bool` implied by `-D warnings` error: this if-then-else expression returns a bool literal --> needless_bool.rs:12:5 | 12 | if x { false } else { true }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `!x` - | - = note: `-D needless-bool` implied by `-D warnings` error: this if-then-else expression returns a bool literal --> needless_bool.rs:13:5 | 13 | if x && y { false } else { true }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `!(x && y)` - | - = note: `-D needless-bool` implied by `-D warnings` error: this if-then-else expression will always return true --> needless_bool.rs:25:5 | 25 | if x { return true } else { return true }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-bool` implied by `-D warnings` error: this if-then-else expression will always return false --> needless_bool.rs:30:5 | 30 | if x { return false } else { return false }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D needless-bool` implied by `-D warnings` error: this if-then-else expression returns a bool literal --> needless_bool.rs:35:5 | 35 | if x { return true } else { return false }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return x` - | - = note: `-D needless-bool` implied by `-D warnings` error: this if-then-else expression returns a bool literal --> needless_bool.rs:40:5 | 40 | if x && y { return true } else { return false }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return x && y` - | - = note: `-D needless-bool` implied by `-D warnings` error: this if-then-else expression returns a bool literal --> needless_bool.rs:45:5 | 45 | if x { return false } else { return true }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return !x` - | - = note: `-D needless-bool` implied by `-D warnings` error: this if-then-else expression returns a bool literal --> needless_bool.rs:50:5 | 50 | if x && y { return false } else { return true }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return !(x && y)` - | - = note: `-D needless-bool` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 11 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/needless_borrow.stderr b/clippy_tests/examples/needless_borrow.stderr index 6878a0d91242..9c3633d4cb69 100644 --- a/clippy_tests/examples/needless_borrow.stderr +++ b/clippy_tests/examples/needless_borrow.stderr @@ -11,26 +11,20 @@ error: this pattern creates a reference to a reference | 20 | if let Some(ref cake) = Some(&5) {} | ^^^^^^^^ - | - = note: `-D needless-borrow` implied by `-D warnings` error: this expression borrows a reference that is immediately dereferenced by the compiler --> needless_borrow.rs:27:15 | 27 | 46 => &&a, | ^^^ - | - = note: `-D needless-borrow` implied by `-D warnings` error: this pattern creates a reference to a reference --> needless_borrow.rs:50:31 | 50 | let _ = v.iter().filter(|&ref a| a.is_empty()); | ^^^^^ - | - = note: `-D needless-borrow` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 4 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/needless_continue.stderr b/clippy_tests/examples/needless_continue.stderr index 04cd5448e4a7..dd0a508b6d10 100644 --- a/clippy_tests/examples/needless_continue.stderr +++ b/clippy_tests/examples/needless_continue.stderr @@ -47,7 +47,6 @@ error: There is no need for an explicit `else` block for this `if` expression 46 | | } | |_________^ | - = note: `-D needless-continue` implied by `-D warnings` = help: Consider dropping the else clause, and moving out the code in the else block, like so: if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 { continue; @@ -56,7 +55,7 @@ error: There is no need for an explicit `else` block for this `if` expression println!("Jabber"); ... -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/needless_pass_by_value.stderr b/clippy_tests/examples/needless_pass_by_value.stderr index 2f54b82d00eb..20675d075d16 100644 --- a/clippy_tests/examples/needless_pass_by_value.stderr +++ b/clippy_tests/examples/needless_pass_by_value.stderr @@ -11,24 +11,18 @@ error: this argument is passed by value, but not consumed in the function body | 23 | fn bar(x: String, y: Wrapper) { | ^^^^^^ help: consider changing the type to `&str` - | - = note: `-D needless-pass-by-value` implied by `-D warnings` error: this argument is passed by value, but not consumed in the function body --> needless_pass_by_value.rs:23:22 | 23 | fn bar(x: String, y: Wrapper) { | ^^^^^^^ help: consider taking a reference instead `&Wrapper` - | - = note: `-D needless-pass-by-value` implied by `-D warnings` error: this argument is passed by value, but not consumed in the function body --> needless_pass_by_value.rs:29:63 | 29 | fn test_borrow_trait, U>(t: T, u: U) { | ^ help: consider taking a reference instead `&U` - | - = note: `-D needless-pass-by-value` implied by `-D warnings` error: this argument is passed by value, but not consumed in the function body --> needless_pass_by_value.rs:40:18 @@ -36,7 +30,6 @@ error: this argument is passed by value, but not consumed in the function body 40 | fn test_match(x: Option>, y: Option>) { | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D needless-pass-by-value` implied by `-D warnings` help: consider taking a reference instead | fn test_match(x: &Option>, y: Option>) { | match *x { @@ -46,8 +39,6 @@ error: this argument is passed by value, but not consumed in the function body | 53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) { | ^^^^^^^ help: consider taking a reference instead `&Wrapper` - | - = note: `-D needless-pass-by-value` implied by `-D warnings` error: this argument is passed by value, but not consumed in the function body --> needless_pass_by_value.rs:53:36 @@ -55,14 +46,13 @@ error: this argument is passed by value, but not consumed in the function body 53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) { | ^^^^^^^ | - = note: `-D needless-pass-by-value` implied by `-D warnings` help: consider taking a reference instead | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) { | let Wrapper(s) = z; // moved | let Wrapper(ref t) = *y; // not moved | let Wrapper(_) = *y; // still not moved -error: aborting due to previous error(s) +error: aborting due to 7 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/needless_return.stderr b/clippy_tests/examples/needless_return.stderr index 9d97b15b364a..8cd549c96da4 100644 --- a/clippy_tests/examples/needless_return.stderr +++ b/clippy_tests/examples/needless_return.stderr @@ -11,58 +11,44 @@ error: unneeded return statement | 15 | return true | ^^^^^^^^^^^ help: remove `return` as shown: `true` - | - = note: `-D needless-return` implied by `-D warnings` error: unneeded return statement --> needless_return.rs:20:9 | 20 | return true; | ^^^^^^^^^^^^ help: remove `return` as shown: `true` - | - = note: `-D needless-return` implied by `-D warnings` error: unneeded return statement --> needless_return.rs:22:9 | 22 | return false; | ^^^^^^^^^^^^^ help: remove `return` as shown: `false` - | - = note: `-D needless-return` implied by `-D warnings` error: unneeded return statement --> needless_return.rs:28:17 | 28 | true => return false, | ^^^^^^^^^^^^ help: remove `return` as shown: `false` - | - = note: `-D needless-return` implied by `-D warnings` error: unneeded return statement --> needless_return.rs:30:13 | 30 | return true; | ^^^^^^^^^^^^ help: remove `return` as shown: `true` - | - = note: `-D needless-return` implied by `-D warnings` error: unneeded return statement --> needless_return.rs:37:9 | 37 | return true; | ^^^^^^^^^^^^ help: remove `return` as shown: `true` - | - = note: `-D needless-return` implied by `-D warnings` error: unneeded return statement --> needless_return.rs:39:16 | 39 | let _ = || return true; | ^^^^^^^^^^^ help: remove `return` as shown: `true` - | - = note: `-D needless-return` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 8 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/needless_update.stderr b/clippy_tests/examples/needless_update.stderr index 7fc9c8c682da..19d0998cbe9c 100644 --- a/clippy_tests/examples/needless_update.stderr +++ b/clippy_tests/examples/needless_update.stderr @@ -6,7 +6,7 @@ error: struct update has no effect, all the fields in the struct have already be | = note: `-D needless-update` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/neg_multiply.stderr b/clippy_tests/examples/neg_multiply.stderr index d3f3711c5ee8..095c2915de3c 100644 --- a/clippy_tests/examples/neg_multiply.stderr +++ b/clippy_tests/examples/neg_multiply.stderr @@ -11,10 +11,8 @@ error: Negation by multiplying with -1 | 32 | -1 * x; | ^^^^^^ - | - = note: `-D neg-multiply` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/never_loop.stderr b/clippy_tests/examples/never_loop.stderr index d7959bc20c3a..224f87cd518e 100644 --- a/clippy_tests/examples/never_loop.stderr +++ b/clippy_tests/examples/never_loop.stderr @@ -20,8 +20,6 @@ error: this loop never actually loops 30 | | break 31 | | } | |_____^ - | - = note: `-D never-loop` implied by `-D warnings` error: this loop never actually loops --> never_loop.rs:47:2 @@ -33,8 +31,6 @@ error: this loop never actually loops 51 | | return 52 | | } | |__^ - | - = note: `-D never-loop` implied by `-D warnings` error: this loop never actually loops --> never_loop.rs:48:9 @@ -43,8 +39,6 @@ error: this loop never actually loops 49 | | break 50 | | } | |_________^ - | - = note: `-D never-loop` implied by `-D warnings` error: this loop never actually loops --> never_loop.rs:57:5 @@ -57,8 +51,6 @@ error: this loop never actually loops 63 | | return 64 | | } | |__^ - | - = note: `-D never-loop` implied by `-D warnings` error: this loop never actually loops --> never_loop.rs:59:3 @@ -68,8 +60,6 @@ error: this loop never actually loops 61 | | continue 'outer 62 | | } | |___^ - | - = note: `-D never-loop` implied by `-D warnings` error: this loop never actually loops --> never_loop.rs:92:5 @@ -78,8 +68,6 @@ error: this loop never actually loops 93 | | return 94 | | } | |_____^ - | - = note: `-D never-loop` implied by `-D warnings` error: this loop never actually loops --> never_loop.rs:98:5 @@ -91,10 +79,8 @@ error: this loop never actually loops 102 | | } 103 | | } | |_____^ - | - = note: `-D never-loop` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 8 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/new_without_default.stderr b/clippy_tests/examples/new_without_default.stderr index a82c7671c744..e3d34229ecf4 100644 --- a/clippy_tests/examples/new_without_default.stderr +++ b/clippy_tests/examples/new_without_default.stderr @@ -14,7 +14,6 @@ error: you should consider deriving a `Default` implementation for `Bar` 16 | pub fn new() -> Self { Bar } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D new-without-default-derive` implied by `-D warnings` help: try this | #[derive(Default)] @@ -34,7 +33,7 @@ help: try this | ... -error: aborting due to previous error(s) +error: aborting due to 3 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/no_effect.stderr b/clippy_tests/examples/no_effect.stderr index 1663dd049766..48ed821635f1 100644 --- a/clippy_tests/examples/no_effect.stderr +++ b/clippy_tests/examples/no_effect.stderr @@ -11,192 +11,144 @@ error: statement with no effect | 35 | s2; | ^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:36:5 | 36 | Unit; | ^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:37:5 | 37 | Tuple(0); | ^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:38:5 | 38 | Struct { field: 0 }; | ^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:39:5 | 39 | Struct { ..s }; | ^^^^^^^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:40:5 | 40 | Union { a: 0 }; | ^^^^^^^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:41:5 | 41 | Enum::Tuple(0); | ^^^^^^^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:42:5 | 42 | Enum::Struct { field: 0 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:43:5 | 43 | 5 + 6; | ^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:44:5 | 44 | *&42; | ^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:45:5 | 45 | &6; | ^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:46:5 | 46 | (5, 6, 7); | ^^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:47:5 | 47 | box 42; | ^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:48:5 | 48 | ..; | ^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:49:5 | 49 | 5..; | ^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:50:5 | 50 | ..5; | ^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:51:5 | 51 | 5..6; | ^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:52:5 | 52 | 5...6; | ^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:53:5 | 53 | [42, 55]; | ^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:54:5 | 54 | [42, 55][1]; | ^^^^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:55:5 | 55 | (42, 55).1; | ^^^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:56:5 | 56 | [42; 55]; | ^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:57:5 | 57 | [42; 55][13]; | ^^^^^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement with no effect --> no_effect.rs:59:5 | 59 | || x += 5; | ^^^^^^^^^^ - | - = note: `-D no-effect` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:65:5 @@ -211,146 +163,110 @@ error: statement can be reduced | 66 | Struct { field: get_number() }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:67:5 | 67 | Struct { ..get_struct() }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_struct();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:68:5 | 68 | Enum::Tuple(get_number()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:69:5 | 69 | Enum::Struct { field: get_number() }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:70:5 | 70 | 5 + get_number(); | ^^^^^^^^^^^^^^^^^ help: replace it with `5;get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:71:5 | 71 | *&get_number(); | ^^^^^^^^^^^^^^^ help: replace it with `get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:72:5 | 72 | &get_number(); | ^^^^^^^^^^^^^^ help: replace it with `get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:73:5 | 73 | (5, 6, get_number()); | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with `5;6;get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:74:5 | 74 | box get_number(); | ^^^^^^^^^^^^^^^^^ help: replace it with `get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:75:5 | 75 | get_number()..; | ^^^^^^^^^^^^^^^ help: replace it with `get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:76:5 | 76 | ..get_number(); | ^^^^^^^^^^^^^^^ help: replace it with `get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:77:5 | 77 | 5..get_number(); | ^^^^^^^^^^^^^^^^ help: replace it with `5;get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:78:5 | 78 | [42, get_number()]; | ^^^^^^^^^^^^^^^^^^^ help: replace it with `42;get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:79:5 | 79 | [42, 55][get_number() as usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `[42, 55];get_number() as usize;` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:80:5 | 80 | (42, get_number()).1; | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with `42;get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:81:5 | 81 | [get_number(); 55]; | ^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:82:5 | 82 | [42; 55][get_number() as usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `[42; 55];get_number() as usize;` - | - = note: `-D unnecessary-operation` implied by `-D warnings` error: statement can be reduced --> no_effect.rs:83:5 | 83 | {get_number()}; | ^^^^^^^^^^^^^^^ help: replace it with `get_number();` - | - = note: `-D unnecessary-operation` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 44 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/non_expressive_names.stderr b/clippy_tests/examples/non_expressive_names.stderr index 667e54288d4a..34d16cbd5393 100644 --- a/clippy_tests/examples/non_expressive_names.stderr +++ b/clippy_tests/examples/non_expressive_names.stderr @@ -22,7 +22,6 @@ error: binding's name is too similar to existing binding 20 | let cpple: i32; | ^^^^^ | - = note: `-D similar-names` implied by `-D warnings` note: existing binding defined here --> non_expressive_names.rs:16:9 | @@ -40,7 +39,6 @@ error: binding's name is too similar to existing binding 45 | let bluby: i32; | ^^^^^ | - = note: `-D similar-names` implied by `-D warnings` note: existing binding defined here --> non_expressive_names.rs:44:9 | @@ -58,7 +56,6 @@ error: binding's name is too similar to existing binding 50 | let coke: i32; | ^^^^ | - = note: `-D similar-names` implied by `-D warnings` note: existing binding defined here --> non_expressive_names.rs:48:9 | @@ -71,7 +68,6 @@ error: binding's name is too similar to existing binding 68 | let xyzeabc: i32; | ^^^^^^^ | - = note: `-D similar-names` implied by `-D warnings` note: existing binding defined here --> non_expressive_names.rs:66:9 | @@ -84,7 +80,6 @@ error: binding's name is too similar to existing binding 72 | let parsee: i32; | ^^^^^^ | - = note: `-D similar-names` implied by `-D warnings` note: existing binding defined here --> non_expressive_names.rs:70:9 | @@ -102,7 +97,6 @@ error: binding's name is too similar to existing binding 86 | bpple: sprang } = unimplemented!(); | ^^^^^^ | - = note: `-D similar-names` implied by `-D warnings` note: existing binding defined here --> non_expressive_names.rs:85:22 | @@ -122,26 +116,20 @@ error: 5th binding whose name is just one char | 123 | let e: i32; | ^ - | - = note: `-D many-single-char-names` implied by `-D warnings` error: 6th binding whose name is just one char --> non_expressive_names.rs:124:17 | 124 | let f: i32; | ^ - | - = note: `-D many-single-char-names` implied by `-D warnings` error: 5th binding whose name is just one char --> non_expressive_names.rs:129:13 | 129 | e => panic!(), | ^ - | - = note: `-D many-single-char-names` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 11 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/ok_if_let.stderr b/clippy_tests/examples/ok_if_let.stderr index fc93e96c0956..21352c639575 100644 --- a/clippy_tests/examples/ok_if_let.stderr +++ b/clippy_tests/examples/ok_if_let.stderr @@ -11,7 +11,7 @@ error: Matching on `Some` with `ok()` is redundant = note: `-D if-let-some-result` implied by `-D warnings` = help: Consider matching on `Ok(y)` and removing the call to `ok` instead -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/op_ref.stderr b/clippy_tests/examples/op_ref.stderr index 7315483bb4e0..57ac9725c4de 100644 --- a/clippy_tests/examples/op_ref.stderr +++ b/clippy_tests/examples/op_ref.stderr @@ -8,7 +8,7 @@ error: needlessly taken reference of both operands help: use the values directly | let foo = 5 - 6; -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/open_options.stderr b/clippy_tests/examples/open_options.stderr index d7affcdba2b2..94bcf301d35d 100644 --- a/clippy_tests/examples/open_options.stderr +++ b/clippy_tests/examples/open_options.stderr @@ -11,50 +11,38 @@ error: file opened with "append" and "truncate" | 9 | OpenOptions::new().append(true).truncate(true).open("foo.txt"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D nonsensical-open-options` implied by `-D warnings` error: the method "read" is called more than once --> open_options.rs:11:5 | 11 | OpenOptions::new().read(true).read(false).open("foo.txt"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D nonsensical-open-options` implied by `-D warnings` error: the method "create" is called more than once --> open_options.rs:12:5 | 12 | OpenOptions::new().create(true).create(false).open("foo.txt"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D nonsensical-open-options` implied by `-D warnings` error: the method "write" is called more than once --> open_options.rs:13:5 | 13 | OpenOptions::new().write(true).write(false).open("foo.txt"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D nonsensical-open-options` implied by `-D warnings` error: the method "append" is called more than once --> open_options.rs:14:5 | 14 | OpenOptions::new().append(true).append(false).open("foo.txt"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D nonsensical-open-options` implied by `-D warnings` error: the method "truncate" is called more than once --> open_options.rs:15:5 | 15 | OpenOptions::new().truncate(true).truncate(false).open("foo.txt"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D nonsensical-open-options` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 7 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/overflow_check_conditional.stderr b/clippy_tests/examples/overflow_check_conditional.stderr index 12cfc0a8c179..b2dbb57d50ed 100644 --- a/clippy_tests/examples/overflow_check_conditional.stderr +++ b/clippy_tests/examples/overflow_check_conditional.stderr @@ -11,58 +11,44 @@ error: You are trying to use classic C overflow conditions that will fail in Rus | 14 | if a > a + b { | ^^^^^^^^^ - | - = note: `-D overflow-check-conditional` implied by `-D warnings` error: You are trying to use classic C overflow conditions that will fail in Rust. --> overflow_check_conditional.rs:17:5 | 17 | if a + b < b { | ^^^^^^^^^ - | - = note: `-D overflow-check-conditional` implied by `-D warnings` error: You are trying to use classic C overflow conditions that will fail in Rust. --> overflow_check_conditional.rs:20:5 | 20 | if b > a + b { | ^^^^^^^^^ - | - = note: `-D overflow-check-conditional` implied by `-D warnings` error: You are trying to use classic C underflow conditions that will fail in Rust. --> overflow_check_conditional.rs:23:5 | 23 | if a - b > b { | ^^^^^^^^^ - | - = note: `-D overflow-check-conditional` implied by `-D warnings` error: You are trying to use classic C underflow conditions that will fail in Rust. --> overflow_check_conditional.rs:26:5 | 26 | if b < a - b { | ^^^^^^^^^ - | - = note: `-D overflow-check-conditional` implied by `-D warnings` error: You are trying to use classic C underflow conditions that will fail in Rust. --> overflow_check_conditional.rs:29:5 | 29 | if a - b > a { | ^^^^^^^^^ - | - = note: `-D overflow-check-conditional` implied by `-D warnings` error: You are trying to use classic C underflow conditions that will fail in Rust. --> overflow_check_conditional.rs:32:5 | 32 | if a < a - b { | ^^^^^^^^^ - | - = note: `-D overflow-check-conditional` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 8 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/panic.stderr b/clippy_tests/examples/panic.stderr index 1397396b0f28..e69de29bb2d1 100644 --- a/clippy_tests/examples/panic.stderr +++ b/clippy_tests/examples/panic.stderr @@ -1,37 +0,0 @@ -error: you probably are missing some parameter in your format string - --> panic.rs:8:16 - | -8 | panic!("{}"); - | ^^^^ - | - = note: `-D panic-params` implied by `-D warnings` - -error: you probably are missing some parameter in your format string - --> panic.rs:10:16 - | -10 | panic!("{:?}"); - | ^^^^^^ - | - = note: `-D panic-params` implied by `-D warnings` - -error: you probably are missing some parameter in your format string - --> panic.rs:12:23 - | -12 | assert!(true, "here be missing values: {}"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D panic-params` implied by `-D warnings` - -error: you probably are missing some parameter in your format string - --> panic.rs:22:5 - | -22 | assert!("foo bar".contains(&format!("foo {}", "bar"))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D panic-params` implied by `-D warnings` - = note: this error originates in a macro outside of the current crate - -error: aborting due to previous error(s) - - -To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/partialeq_ne_impl.stderr b/clippy_tests/examples/partialeq_ne_impl.stderr index 032dee74c99b..d9f852387a9b 100644 --- a/clippy_tests/examples/partialeq_ne_impl.stderr +++ b/clippy_tests/examples/partialeq_ne_impl.stderr @@ -6,7 +6,7 @@ error: re-implementing `PartialEq::ne` is unnecessary | = note: `-D partialeq-ne-impl` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/patterns.stderr b/clippy_tests/examples/patterns.stderr index 384361868561..224674f0a673 100644 --- a/clippy_tests/examples/patterns.stderr +++ b/clippy_tests/examples/patterns.stderr @@ -6,7 +6,7 @@ error: the `y @ _` pattern can be written as just `y` | = note: `-D redundant-pattern` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/precedence.stderr b/clippy_tests/examples/precedence.stderr index 4666a3075138..516ddf5622bb 100644 --- a/clippy_tests/examples/precedence.stderr +++ b/clippy_tests/examples/precedence.stderr @@ -11,66 +11,50 @@ error: operator precedence can trip the unwary | 9 | 1 + 2 << 3; | ^^^^^^^^^^ help: consider parenthesizing your expression `(1 + 2) << 3` - | - = note: `-D precedence` implied by `-D warnings` error: operator precedence can trip the unwary --> precedence.rs:10:5 | 10 | 4 >> 1 + 1; | ^^^^^^^^^^ help: consider parenthesizing your expression `4 >> (1 + 1)` - | - = note: `-D precedence` implied by `-D warnings` error: operator precedence can trip the unwary --> precedence.rs:11:5 | 11 | 1 + 3 >> 2; | ^^^^^^^^^^ help: consider parenthesizing your expression `(1 + 3) >> 2` - | - = note: `-D precedence` implied by `-D warnings` error: operator precedence can trip the unwary --> precedence.rs:12:5 | 12 | 1 ^ 1 - 1; | ^^^^^^^^^ help: consider parenthesizing your expression `1 ^ (1 - 1)` - | - = note: `-D precedence` implied by `-D warnings` error: operator precedence can trip the unwary --> precedence.rs:13:5 | 13 | 3 | 2 - 1; | ^^^^^^^^^ help: consider parenthesizing your expression `3 | (2 - 1)` - | - = note: `-D precedence` implied by `-D warnings` error: operator precedence can trip the unwary --> precedence.rs:14:5 | 14 | 3 & 5 - 2; | ^^^^^^^^^ help: consider parenthesizing your expression `3 & (5 - 2)` - | - = note: `-D precedence` implied by `-D warnings` error: unary minus has lower precedence than method call --> precedence.rs:15:5 | 15 | -1i32.abs(); | ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent `-(1i32.abs())` - | - = note: `-D precedence` implied by `-D warnings` error: unary minus has lower precedence than method call --> precedence.rs:16:5 | 16 | -1f32.abs(); | ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent `-(1f32.abs())` - | - = note: `-D precedence` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 9 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/print.stderr b/clippy_tests/examples/print.stderr index d7a69578770b..f8a62c4e7e63 100644 --- a/clippy_tests/examples/print.stderr +++ b/clippy_tests/examples/print.stderr @@ -19,50 +19,38 @@ error: use of `print!` | 25 | print!("Hello"); | ^^^^^^^^^^^^^^^^ - | - = note: `-D print-stdout` implied by `-D warnings` error: use of `print!` --> print.rs:27:5 | 27 | print!("Hello {}", "World"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D print-stdout` implied by `-D warnings` error: use of `print!` --> print.rs:29:5 | 29 | print!("Hello {:?}", "World"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D print-stdout` implied by `-D warnings` error: use of `Debug`-based formatting --> print.rs:29:26 | 29 | print!("Hello {:?}", "World"); | ^^^^^^^ - | - = note: `-D use-debug` implied by `-D warnings` error: use of `print!` --> print.rs:31:5 | 31 | print!("Hello {:#?}", "#orld"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D print-stdout` implied by `-D warnings` error: use of `Debug`-based formatting --> print.rs:31:27 | 31 | print!("Hello {:#?}", "#orld"); | ^^^^^^^ - | - = note: `-D use-debug` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 8 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/print_with_newline.stderr b/clippy_tests/examples/print_with_newline.stderr index cae41cb02c07..ff94150a5e6c 100644 --- a/clippy_tests/examples/print_with_newline.stderr +++ b/clippy_tests/examples/print_with_newline.stderr @@ -11,26 +11,20 @@ error: using `print!()` with a format string that ends in a newline, consider us | 7 | print!("Hello {}\n", "world"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D print-with-newline` implied by `-D warnings` error: using `print!()` with a format string that ends in a newline, consider using `println!()` instead --> print_with_newline.rs:8:5 | 8 | print!("Hello {} {}\n\n", "world", "#2"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D print-with-newline` implied by `-D warnings` error: using `print!()` with a format string that ends in a newline, consider using `println!()` instead --> print_with_newline.rs:9:5 | 9 | print!("{}\n", 1265); | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D print-with-newline` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 4 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/ptr_arg.stderr b/clippy_tests/examples/ptr_arg.stderr index 90cda604da68..a7a089ec12bb 100644 --- a/clippy_tests/examples/ptr_arg.stderr +++ b/clippy_tests/examples/ptr_arg.stderr @@ -11,18 +11,14 @@ error: writing `&String` instead of `&str` involves a new object where a slice w | 14 | fn do_str(x: &String) { | ^^^^^^^ - | - = note: `-D ptr-arg` implied by `-D warnings` error: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. Consider changing the type to `&[...]` --> ptr_arg.rs:27:18 | 27 | fn do_vec(x: &Vec); | ^^^^^^^^^ - | - = note: `-D ptr-arg` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 3 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/range.stderr b/clippy_tests/examples/range.stderr index bd1220618135..8b9643b37820 100644 --- a/clippy_tests/examples/range.stderr +++ b/clippy_tests/examples/range.stderr @@ -11,32 +11,24 @@ error: use of deprecated item: replaced by `Iterator::step_by` | 16 | (0..1).step_by(1); | ^^^^^^^ - | - = note: `-D deprecated` implied by `-D warnings` error: use of deprecated item: replaced by `Iterator::step_by` --> range.rs:18:11 | 18 | (1..).step_by(0); | ^^^^^^^ - | - = note: `-D deprecated` implied by `-D warnings` error: use of deprecated item: replaced by `Iterator::step_by` --> range.rs:19:13 | 19 | (1...2).step_by(0); | ^^^^^^^ - | - = note: `-D deprecated` implied by `-D warnings` error: use of deprecated item: replaced by `Iterator::step_by` --> range.rs:22:7 | 22 | x.step_by(0); | ^^^^^^^ - | - = note: `-D deprecated` implied by `-D warnings` error: It is more idiomatic to use v1.iter().enumerate() --> range.rs:30:14 @@ -54,7 +46,7 @@ error: Iterator::step_by(0) will panic at runtime | = note: `-D iterator-step-by-zero` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 7 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/redundant_closure_call.stderr b/clippy_tests/examples/redundant_closure_call.stderr index 83d928e383c8..4b346d01ed70 100644 --- a/clippy_tests/examples/redundant_closure_call.stderr +++ b/clippy_tests/examples/redundant_closure_call.stderr @@ -11,34 +11,26 @@ error: Closure called just once immediately after it was declared | 18 | i = closure(3); | ^^^^^^^^^^^^^^ - | - = note: `-D redundant-closure-call` implied by `-D warnings` error: Try not to call a closure in the expression where it is declared. --> redundant_closure_call.rs:7:10 | 7 | let a = (|| 42)(); | ^^^^^^^^^ help: Try doing something like: `42` - | - = note: `-D redundant-closure-call` implied by `-D warnings` error: Try not to call a closure in the expression where it is declared. --> redundant_closure_call.rs:10:14 | 10 | let mut k = (|m| m+1)(i); | ^^^^^^^^^^^^ - | - = note: `-D redundant-closure-call` implied by `-D warnings` error: Try not to call a closure in the expression where it is declared. --> redundant_closure_call.rs:12:6 | 12 | k = (|a,b| a*b)(1,5); | ^^^^^^^^^^^^^^^^ - | - = note: `-D redundant-closure-call` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 5 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/reference.stderr b/clippy_tests/examples/reference.stderr index 6e18513be34c..acc6b033a134 100644 --- a/clippy_tests/examples/reference.stderr +++ b/clippy_tests/examples/reference.stderr @@ -11,82 +11,62 @@ error: immediately dereferencing a reference | 21 | let b = *&get_number(); | ^^^^^^^^^^^^^^ help: try this `get_number()` - | - = note: `-D deref-addrof` implied by `-D warnings` error: immediately dereferencing a reference --> reference.rs:26:13 | 26 | let b = *&bytes[1..2][0]; | ^^^^^^^^^^^^^^^^ help: try this `bytes[1..2][0]` - | - = note: `-D deref-addrof` implied by `-D warnings` error: immediately dereferencing a reference --> reference.rs:30:13 | 30 | let b = *&(a); | ^^^^^ help: try this `(a)` - | - = note: `-D deref-addrof` implied by `-D warnings` error: immediately dereferencing a reference --> reference.rs:32:13 | 32 | let b = *(&a); | ^^^^^ help: try this `a` - | - = note: `-D deref-addrof` implied by `-D warnings` error: immediately dereferencing a reference --> reference.rs:34:13 | 34 | let b = *((&a)); | ^^^^^^^ help: try this `a` - | - = note: `-D deref-addrof` implied by `-D warnings` error: immediately dereferencing a reference --> reference.rs:36:13 | 36 | let b = *&&a; | ^^^^ help: try this `&a` - | - = note: `-D deref-addrof` implied by `-D warnings` error: immediately dereferencing a reference --> reference.rs:38:14 | 38 | let b = **&aref; | ^^^^^^ help: try this `aref` - | - = note: `-D deref-addrof` implied by `-D warnings` error: immediately dereferencing a reference --> reference.rs:42:14 | 42 | let b = **&&a; | ^^^^ help: try this `&a` - | - = note: `-D deref-addrof` implied by `-D warnings` error: immediately dereferencing a reference --> reference.rs:46:17 | 46 | let y = *&mut x; | ^^^^^^^ help: try this `x` - | - = note: `-D deref-addrof` implied by `-D warnings` error: immediately dereferencing a reference --> reference.rs:53:18 | 53 | let y = **&mut &mut x; | ^^^^^^^^^^^^ help: try this `&mut x` - | - = note: `-D deref-addrof` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 11 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/regex.stderr b/clippy_tests/examples/regex.stderr index fd095c00fa60..0e52b317fc38 100644 --- a/clippy_tests/examples/regex.stderr +++ b/clippy_tests/examples/regex.stderr @@ -4,7 +4,7 @@ error[E0463]: can't find crate for `regex` 7 | extern crate regex; | ^^^^^^^^^^^^^^^^^^^ can't find crate -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/serde.stderr b/clippy_tests/examples/serde.stderr index 5fb80eb7737d..306611e368bc 100644 --- a/clippy_tests/examples/serde.stderr +++ b/clippy_tests/examples/serde.stderr @@ -4,7 +4,7 @@ error[E0463]: can't find crate for `serde` 6 | extern crate serde; | ^^^^^^^^^^^^^^^^^^^ can't find crate -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/shadow.stderr b/clippy_tests/examples/shadow.stderr index e6d36297b8ad..ac5ec98ed144 100644 --- a/clippy_tests/examples/shadow.stderr +++ b/clippy_tests/examples/shadow.stderr @@ -17,7 +17,6 @@ error: `x` is shadowed by itself in `{ x }` 14 | let x = { x }; | ^^^^^^^^^ | - = note: `-D shadow-same` implied by `-D warnings` note: previous binding is here --> shadow.rs:13:9 | @@ -30,7 +29,6 @@ error: `x` is shadowed by itself in `(&*x)` 15 | let x = (&*x); | ^^^^^^^^^ | - = note: `-D shadow-same` implied by `-D warnings` note: previous binding is here --> shadow.rs:14:9 | @@ -61,7 +59,6 @@ error: `x` is shadowed by `id(x)` which reuses the original value 17 | let x = id(x); | ^ | - = note: `-D shadow-reuse` implied by `-D warnings` note: initialization happens here --> shadow.rs:17:13 | @@ -79,7 +76,6 @@ error: `x` is shadowed by `(1, x)` which reuses the original value 18 | let x = (1, x); | ^ | - = note: `-D shadow-reuse` implied by `-D warnings` note: initialization happens here --> shadow.rs:18:13 | @@ -97,7 +93,6 @@ error: `x` is shadowed by `first(x)` which reuses the original value 19 | let x = first(x); | ^ | - = note: `-D shadow-reuse` implied by `-D warnings` note: initialization happens here --> shadow.rs:19:13 | @@ -133,14 +128,13 @@ error: `x` shadows a previous declaration 23 | let x; | ^ | - = note: `-D shadow-unrelated` implied by `-D warnings` note: previous binding is here --> shadow.rs:21:9 | 21 | let x = y; | ^ -error: aborting due to previous error(s) +error: aborting due to 9 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/short_circuit_statement.stderr b/clippy_tests/examples/short_circuit_statement.stderr index ce2737f0c346..8dcc43711cc2 100644 --- a/clippy_tests/examples/short_circuit_statement.stderr +++ b/clippy_tests/examples/short_circuit_statement.stderr @@ -11,18 +11,14 @@ error: boolean short circuit operator in statement may be clearer using an expli | 8 | f() || g(); | ^^^^^^^^^^^ help: replace it with `if !f() { g(); }` - | - = note: `-D short-circuit-statement` implied by `-D warnings` error: boolean short circuit operator in statement may be clearer using an explicit test --> short_circuit_statement.rs:9:5 | 9 | 1 == 2 || g(); | ^^^^^^^^^^^^^^ help: replace it with `if !(1 == 2) { g(); }` - | - = note: `-D short-circuit-statement` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 3 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/should_assert_eq.stderr b/clippy_tests/examples/should_assert_eq.stderr index 4152611791ad..82d15fb757cc 100644 --- a/clippy_tests/examples/should_assert_eq.stderr +++ b/clippy_tests/examples/should_assert_eq.stderr @@ -13,7 +13,6 @@ error: use `assert_eq` for better reporting 15 | assert!(Debug(1) == Debug(2)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D should-assert-eq` implied by `-D warnings` = note: this error originates in a macro outside of the current crate error: use `assert_ne` for better reporting @@ -22,7 +21,6 @@ error: use `assert_ne` for better reporting 17 | assert!(Debug(1) != Debug(2)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D should-assert-eq` implied by `-D warnings` = note: this error originates in a macro outside of the current crate error: use `debug_assert_eq` for better reporting @@ -31,7 +29,6 @@ error: use `debug_assert_eq` for better reporting 22 | debug_assert!(4 == 5); | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D should-assert-eq` implied by `-D warnings` = note: this error originates in a macro outside of the current crate error: use `debug_assert_ne` for better reporting @@ -40,7 +37,6 @@ error: use `debug_assert_ne` for better reporting 23 | debug_assert!(4 != 6); | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D should-assert-eq` implied by `-D warnings` = note: this error originates in a macro outside of the current crate error: use `assert_eq` for better reporting @@ -49,7 +45,6 @@ error: use `assert_eq` for better reporting 27 | assert!(x == y); | ^^^^^^^^^^^^^^^^ | - = note: `-D should-assert-eq` implied by `-D warnings` = note: this error originates in a macro outside of the current crate error: use `assert_ne` for better reporting @@ -58,10 +53,9 @@ error: use `assert_ne` for better reporting 30 | assert!(x != y); | ^^^^^^^^^^^^^^^^ | - = note: `-D should-assert-eq` implied by `-D warnings` = note: this error originates in a macro outside of the current crate -error: aborting due to previous error(s) +error: aborting due to 7 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/strings.stderr b/clippy_tests/examples/strings.stderr index b43353c398dd..6f2ed0353bb1 100644 --- a/clippy_tests/examples/strings.stderr +++ b/clippy_tests/examples/strings.stderr @@ -19,8 +19,6 @@ error: you added something to a string. Consider using `String::push_str()` inst | 14 | let z = y + "..."; | ^^^^^^^^^ - | - = note: `-D string-add` implied by `-D warnings` error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead --> strings.rs:24:9 @@ -35,32 +33,24 @@ error: manual implementation of an assign operation | 24 | x = x + "."; | ^^^^^^^^^^^ help: replace it with `x += "."` - | - = note: `-D assign-op-pattern` implied by `-D warnings` error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead --> strings.rs:38:9 | 38 | x = x + "."; | ^^^^^^^^^^^ - | - = note: `-D string-add-assign` implied by `-D warnings` error: manual implementation of an assign operation --> strings.rs:38:9 | 38 | x = x + "."; | ^^^^^^^^^^^ help: replace it with `x += "."` - | - = note: `-D assign-op-pattern` implied by `-D warnings` error: you added something to a string. Consider using `String::push_str()` instead --> strings.rs:42:13 | 42 | let z = y + "..."; | ^^^^^^^^^ - | - = note: `-D string-add` implied by `-D warnings` error: calling `as_bytes()` on a string literal --> strings.rs:50:14 @@ -75,10 +65,8 @@ error: manual implementation of an assign operation | 65 | ; x = x + 1; | ^^^^^^^^^ help: replace it with `x += 1` - | - = note: `-D assign-op-pattern` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 10 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/stutter.stderr b/clippy_tests/examples/stutter.stderr index 42c38703f089..1c97972abf29 100644 --- a/clippy_tests/examples/stutter.stderr +++ b/clippy_tests/examples/stutter.stderr @@ -11,26 +11,20 @@ error: item name ends with its containing module's name | 9 | pub fn bar_foo() {} | ^^^^^^^^^^^^^^^^^^^ - | - = note: `-D stutter` implied by `-D warnings` error: item name starts with its containing module's name --> stutter.rs:10:5 | 10 | pub struct FooCake {} | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D stutter` implied by `-D warnings` error: item name ends with its containing module's name --> stutter.rs:11:5 | 11 | pub enum CakeFoo {} | ^^^^^^^^^^^^^^^^^^^ - | - = note: `-D stutter` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 4 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/swap.stderr b/clippy_tests/examples/swap.stderr index 33b4512fc128..99cf0aee310a 100644 --- a/clippy_tests/examples/swap.stderr +++ b/clippy_tests/examples/swap.stderr @@ -15,8 +15,6 @@ error: this looks like you are swapping elements of `foo` manually 21 | | foo[0] = foo[1]; 22 | | foo[1] = temp; | |_________________^ help: try `foo.swap(0, 1)` - | - = note: `-D manual-swap` implied by `-D warnings` error: this looks like you are swapping elements of `foo` manually --> swap.rs:29:5 @@ -25,8 +23,6 @@ error: this looks like you are swapping elements of `foo` manually 30 | | foo[0] = foo[1]; 31 | | foo[1] = temp; | |_________________^ help: try `foo.swap(0, 1)` - | - = note: `-D manual-swap` implied by `-D warnings` error: this looks like you are swapping `a` and `b` manually --> swap.rs:47:7 @@ -37,7 +33,6 @@ error: this looks like you are swapping `a` and `b` manually 49 | | b = t; | |_________^ help: try `std::mem::swap(&mut a, &mut b)` | - = note: `-D manual-swap` implied by `-D warnings` = note: or maybe you should use `std::mem::replace`? error: this looks like you are swapping `c.0` and `a` manually @@ -49,7 +44,6 @@ error: this looks like you are swapping `c.0` and `a` manually 58 | | a = t; | |_________^ help: try `std::mem::swap(&mut c.0, &mut a)` | - = note: `-D manual-swap` implied by `-D warnings` = note: or maybe you should use `std::mem::replace`? error: this looks like you are trying to swap `a` and `b` @@ -69,10 +63,9 @@ error: this looks like you are trying to swap `c.0` and `a` 54 | | a = c.0; | |___________^ help: try `std::mem::swap(&mut c.0, &mut a)` | - = note: `-D almost-swapped` implied by `-D warnings` = note: or maybe you should use `std::mem::replace`? -error: aborting due to previous error(s) +error: aborting due to 7 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/temporary_assignment.stderr b/clippy_tests/examples/temporary_assignment.stderr index f901434cb6d6..4c64afdddd12 100644 --- a/clippy_tests/examples/temporary_assignment.stderr +++ b/clippy_tests/examples/temporary_assignment.stderr @@ -11,10 +11,8 @@ error: assignment to temporary | 30 | (0, 0).0 = 1; | ^^^^^^^^^^^^ - | - = note: `-D temporary-assignment` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/toplevel_ref_arg.stderr b/clippy_tests/examples/toplevel_ref_arg.stderr index 1d7b57c65dce..fd55e3901898 100644 --- a/clippy_tests/examples/toplevel_ref_arg.stderr +++ b/clippy_tests/examples/toplevel_ref_arg.stderr @@ -11,34 +11,26 @@ error: `ref` on an entire `let` pattern is discouraged, take a reference with `& | 18 | let ref x = 1; | ----^^^^^----- help: try `let x = &1;` - | - = note: `-D toplevel-ref-arg` implied by `-D warnings` error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead --> toplevel_ref_arg.rs:20:7 | 20 | let ref y: (&_, u8) = (&1, 2); | ----^^^^^--------------------- help: try `let y: &(&_, u8) = &(&1, 2);` - | - = note: `-D toplevel-ref-arg` implied by `-D warnings` error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead --> toplevel_ref_arg.rs:22:7 | 22 | let ref z = 1 + 2; | ----^^^^^--------- help: try `let z = &(1 + 2);` - | - = note: `-D toplevel-ref-arg` implied by `-D warnings` error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead --> toplevel_ref_arg.rs:24:7 | 24 | let ref mut z = 1 + 2; | ----^^^^^^^^^--------- help: try `let z = &mut (1 + 2);` - | - = note: `-D toplevel-ref-arg` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 5 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/unicode.stderr b/clippy_tests/examples/unicode.stderr index 6ab5ef75d3f3..3d8841a3d38c 100644 --- a/clippy_tests/examples/unicode.stderr +++ b/clippy_tests/examples/unicode.stderr @@ -28,7 +28,7 @@ error: literal non-ASCII character detected = help: Consider replacing the string with: ""\u{dc}ben!"" -error: aborting due to previous error(s) +error: aborting due to 3 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/unit_cmp.stderr b/clippy_tests/examples/unit_cmp.stderr index 9636e8e636ea..9c9f5fc00967 100644 --- a/clippy_tests/examples/unit_cmp.stderr +++ b/clippy_tests/examples/unit_cmp.stderr @@ -11,10 +11,8 @@ error: >-comparison of unit values detected. This will always be false | 19 | if { true; } > { false; } { | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D unit-cmp` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/unneeded_field_pattern.stderr b/clippy_tests/examples/unneeded_field_pattern.stderr index 48c314aedaa2..b6155853ec62 100644 --- a/clippy_tests/examples/unneeded_field_pattern.stderr +++ b/clippy_tests/examples/unneeded_field_pattern.stderr @@ -13,10 +13,9 @@ error: All the struct fields are matched to a wildcard pattern, consider using ` 19 | Foo { a: _, b: _, c: _ } => {} | ^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D unneeded-field-pattern` implied by `-D warnings` = help: Try with `Foo { .. }` instead -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/unsafe_removed_from_name.stderr b/clippy_tests/examples/unsafe_removed_from_name.stderr index 8556e32d307d..021af9ccc50c 100644 --- a/clippy_tests/examples/unsafe_removed_from_name.stderr +++ b/clippy_tests/examples/unsafe_removed_from_name.stderr @@ -11,18 +11,14 @@ error: removed "unsafe" from the name of `UnsafeCell` in use as `TotallySafeCell | 9 | use std::cell::UnsafeCell as TotallySafeCellAgain; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D unsafe-removed-from-name` implied by `-D warnings` error: removed "unsafe" from the name of `Unsafe` in use as `LieAboutModSafety` --> unsafe_removed_from_name.rs:23:1 | 23 | use mod_with_some_unsafe_things::Unsafe as LieAboutModSafety; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D unsafe-removed-from-name` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 3 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/unused_io_amount.stderr b/clippy_tests/examples/unused_io_amount.stderr index 7eedcf029c58..bef5e7b008d6 100644 --- a/clippy_tests/examples/unused_io_amount.stderr +++ b/clippy_tests/examples/unused_io_amount.stderr @@ -13,7 +13,6 @@ error: handle read amount returned or use `Read::read_exact` instead 13 | try!(s.read(&mut buf)); | ^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `-D unused-io-amount` implied by `-D warnings` = note: this error originates in a macro outside of the current crate error: handle written amount returned or use `Write::write_all` instead @@ -21,34 +20,26 @@ error: handle written amount returned or use `Write::write_all` instead | 18 | s.write(b"test")?; | ^^^^^^^^^^^^^^^^^ - | - = note: `-D unused-io-amount` implied by `-D warnings` error: handle read amount returned or use `Read::read_exact` instead --> unused_io_amount.rs:20:5 | 20 | s.read(&mut buf)?; | ^^^^^^^^^^^^^^^^^ - | - = note: `-D unused-io-amount` implied by `-D warnings` error: handle written amount returned or use `Write::write_all` instead --> unused_io_amount.rs:25:5 | 25 | s.write(b"test").unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D unused-io-amount` implied by `-D warnings` error: handle read amount returned or use `Read::read_exact` instead --> unused_io_amount.rs:27:5 | 27 | s.read(&mut buf).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D unused-io-amount` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 6 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/unused_labels.stderr b/clippy_tests/examples/unused_labels.stderr index c4132e89f76e..0124ad570d99 100644 --- a/clippy_tests/examples/unused_labels.stderr +++ b/clippy_tests/examples/unused_labels.stderr @@ -13,8 +13,6 @@ error: unused label `'a` | 21 | 'a: loop { break } | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D unused-label` implied by `-D warnings` error: unused label `'same_label_in_two_fns` --> unused_labels.rs:32:5 @@ -23,10 +21,8 @@ error: unused label `'same_label_in_two_fns` 33 | | let _ = 1; 34 | | } | |_____^ - | - = note: `-D unused-label` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 3 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/unused_lt.stderr b/clippy_tests/examples/unused_lt.stderr index 97777c7528fb..a71904a8af4b 100644 --- a/clippy_tests/examples/unused_lt.stderr +++ b/clippy_tests/examples/unused_lt.stderr @@ -11,18 +11,14 @@ error: this lifetime isn't used in the function definition | 20 | fn unused_lt_transitive<'a, 'b: 'a>(x: &'b u8) { | ^^ - | - = note: `-D unused-lifetimes` implied by `-D warnings` error: this lifetime isn't used in the function definition --> unused_lt.rs:50:10 | 50 | fn x<'a>(&self) {} | ^^ - | - = note: `-D unused-lifetimes` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 3 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/used_underscore_binding.stderr b/clippy_tests/examples/used_underscore_binding.stderr index a6a126d8a8c4..4b2783496744 100644 --- a/clippy_tests/examples/used_underscore_binding.stderr +++ b/clippy_tests/examples/used_underscore_binding.stderr @@ -11,34 +11,26 @@ error: used binding `_foo` which is prefixed with an underscore. A leading under | 22 | println!("{}", _foo); | ^^^^ - | - = note: `-D used-underscore-binding` implied by `-D warnings` error: used binding `_foo` which is prefixed with an underscore. A leading underscore signals that a binding will not be used. --> used_underscore_binding.rs:23:16 | 23 | assert_eq!(_foo, _foo); | ^^^^ - | - = note: `-D used-underscore-binding` implied by `-D warnings` error: used binding `_foo` which is prefixed with an underscore. A leading underscore signals that a binding will not be used. --> used_underscore_binding.rs:23:22 | 23 | assert_eq!(_foo, _foo); | ^^^^ - | - = note: `-D used-underscore-binding` implied by `-D warnings` error: used binding `_underscore_field` which is prefixed with an underscore. A leading underscore signals that a binding will not be used. --> used_underscore_binding.rs:36:5 | 36 | s._underscore_field += 1; | ^^^^^^^^^^^^^^^^^^^ - | - = note: `-D used-underscore-binding` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 5 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/useless_attribute.stderr b/clippy_tests/examples/useless_attribute.stderr index fd207d9e4318..98d159620185 100644 --- a/clippy_tests/examples/useless_attribute.stderr +++ b/clippy_tests/examples/useless_attribute.stderr @@ -4,7 +4,7 @@ error[E0463]: can't find crate for `clippy_lints` 6 | extern crate clippy_lints; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate -error: aborting due to previous error(s) +error: aborting due to previous error To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/vec.stderr b/clippy_tests/examples/vec.stderr index d83bcf9a3c89..d4ad4b560d92 100644 --- a/clippy_tests/examples/vec.stderr +++ b/clippy_tests/examples/vec.stderr @@ -11,42 +11,32 @@ error: useless use of `vec!` | 27 | on_slice(&vec![1, 2]); | ^^^^^^^^^^^ help: you can use a slice directly `&[1, 2]` - | - = note: `-D useless-vec` implied by `-D warnings` error: useless use of `vec!` --> vec.rs:30:14 | 30 | on_slice(&vec ![1, 2]); | ^^^^^^^^^^^^ help: you can use a slice directly `&[1, 2]` - | - = note: `-D useless-vec` implied by `-D warnings` error: useless use of `vec!` --> vec.rs:33:14 | 33 | on_slice(&vec!(1, 2)); | ^^^^^^^^^^^ help: you can use a slice directly `&[1, 2]` - | - = note: `-D useless-vec` implied by `-D warnings` error: useless use of `vec!` --> vec.rs:36:14 | 36 | on_slice(&vec![1; 2]); | ^^^^^^^^^^^ help: you can use a slice directly `&[1; 2]` - | - = note: `-D useless-vec` implied by `-D warnings` error: useless use of `vec!` --> vec.rs:49:14 | 49 | for a in vec![1, 2, 3] { | ^^^^^^^^^^^^^ help: you can use a slice directly `&[1, 2, 3]` - | - = note: `-D useless-vec` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 6 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/while_loop.stderr b/clippy_tests/examples/while_loop.stderr index 9fbb84d6df2b..c41e42d9e64c 100644 --- a/clippy_tests/examples/while_loop.stderr +++ b/clippy_tests/examples/while_loop.stderr @@ -22,8 +22,6 @@ error: this loop could be written as a `while let` loop 26 | | }; 27 | | } | |_____^ help: try `while let Some(_x) = y { .. }` - | - = note: `-D while-let-loop` implied by `-D warnings` error: this loop could be written as a `while let` loop --> while_loop.rs:28:5 @@ -36,8 +34,6 @@ error: this loop could be written as a `while let` loop 34 | | let _str = "foo"; 35 | | } | |_____^ help: try `while let Some(x) = y { .. }` - | - = note: `-D while-let-loop` implied by `-D warnings` error: this loop could be written as a `while let` loop --> while_loop.rs:36:5 @@ -50,8 +46,6 @@ error: this loop could be written as a `while let` loop 42 | | { let _b = "foobar"; } 43 | | } | |_____^ help: try `while let Some(x) = y { .. }` - | - = note: `-D while-let-loop` implied by `-D warnings` error: this loop could be written as a `while let` loop --> while_loop.rs:58:5 @@ -64,8 +58,6 @@ error: this loop could be written as a `while let` loop 64 | | let _ = (e, l); 65 | | } | |_____^ help: try `while let Some(word) = "".split_whitespace().next() { .. }` - | - = note: `-D while-let-loop` implied by `-D warnings` error: this loop could be written as a `for` loop --> while_loop.rs:68:5 @@ -84,16 +76,12 @@ error: this loop could be written as a `for` loop 74 | | println!("{}", x); 75 | | } | |_____^ help: try `for x in iter { .. }` - | - = note: `-D while-let-on-iterator` implied by `-D warnings` error: this loop could be written as a `for` loop --> while_loop.rs:78:5 | 78 | while let Some(_) = iter.next() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `for _ in iter { .. }` - | - = note: `-D while-let-on-iterator` implied by `-D warnings` error: this loop could be written as a `while let` loop --> while_loop.rs:118:5 @@ -106,8 +94,6 @@ error: this loop could be written as a `while let` loop 123 | | loop {} 124 | | } | |_____^ help: try `while let Some(ele) = iter.next() { .. }` - | - = note: `-D while-let-loop` implied by `-D warnings` error: empty `loop {}` detected. You may want to either use `panic!()` or add `std::thread::sleep(..);` to the loop body. --> while_loop.rs:123:9 @@ -117,7 +103,7 @@ error: empty `loop {}` detected. You may want to either use `panic!()` or add `s | = note: `-D empty-loop` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 10 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/wrong_self_convention.stderr b/clippy_tests/examples/wrong_self_convention.stderr index 1d5973683970..d13c22f6477e 100644 --- a/clippy_tests/examples/wrong_self_convention.stderr +++ b/clippy_tests/examples/wrong_self_convention.stderr @@ -11,90 +11,68 @@ error: methods called `from_*` usually take no self; consider choosing a less am | 27 | pub fn from_i64(self) {} | ^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` error: methods called `as_*` usually take self by reference or self by mutable reference; consider choosing a less ambiguous name --> wrong_self_convention.rs:40:15 | 40 | fn as_i32(self) {} | ^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name --> wrong_self_convention.rs:42:17 | 42 | fn into_i32(&self) {} | ^^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` error: methods called `is_*` usually take self by reference or no self; consider choosing a less ambiguous name --> wrong_self_convention.rs:44:15 | 44 | fn is_i32(self) {} | ^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` error: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name --> wrong_self_convention.rs:46:15 | 46 | fn to_i32(self) {} | ^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` error: methods called `from_*` usually take no self; consider choosing a less ambiguous name --> wrong_self_convention.rs:48:17 | 48 | fn from_i32(self) {} | ^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` error: methods called `as_*` usually take self by reference or self by mutable reference; consider choosing a less ambiguous name --> wrong_self_convention.rs:50:19 | 50 | pub fn as_i64(self) {} | ^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name --> wrong_self_convention.rs:51:21 | 51 | pub fn into_i64(&self) {} | ^^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` error: methods called `is_*` usually take self by reference or no self; consider choosing a less ambiguous name --> wrong_self_convention.rs:52:19 | 52 | pub fn is_i64(self) {} | ^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` error: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name --> wrong_self_convention.rs:53:19 | 53 | pub fn to_i64(self) {} | ^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` error: methods called `from_*` usually take no self; consider choosing a less ambiguous name --> wrong_self_convention.rs:54:21 | 54 | pub fn from_i64(self) {} | ^^^^ - | - = note: `-D wrong-self-convention` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 12 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/zero_div_zero.stderr b/clippy_tests/examples/zero_div_zero.stderr index b2a7194ac0fe..3a291bb2f003 100644 --- a/clippy_tests/examples/zero_div_zero.stderr +++ b/clippy_tests/examples/zero_div_zero.stderr @@ -20,8 +20,6 @@ error: equal expressions as operands to `/` | 8 | let f64_nan = 0.0 / 0.0f64; | ^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: constant division of 0.0 with 0.0 will always result in NaN --> zero_div_zero.rs:8:19 @@ -29,7 +27,6 @@ error: constant division of 0.0 with 0.0 will always result in NaN 8 | let f64_nan = 0.0 / 0.0f64; | ^^^^^^^^^^^^ | - = note: `-D zero-divided-by-zero` implied by `-D warnings` = help: Consider using `std::f64::NAN` if you would like a constant representing NaN error: equal expressions as operands to `/` @@ -37,8 +34,6 @@ error: equal expressions as operands to `/` | 9 | let other_f64_nan = 0.0f64 / 0.0; | ^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: constant division of 0.0 with 0.0 will always result in NaN --> zero_div_zero.rs:9:25 @@ -46,7 +41,6 @@ error: constant division of 0.0 with 0.0 will always result in NaN 9 | let other_f64_nan = 0.0f64 / 0.0; | ^^^^^^^^^^^^ | - = note: `-D zero-divided-by-zero` implied by `-D warnings` = help: Consider using `std::f64::NAN` if you would like a constant representing NaN error: equal expressions as operands to `/` @@ -54,8 +48,6 @@ error: equal expressions as operands to `/` | 10 | let one_more_f64_nan = 0.0f64/0.0f64; | ^^^^^^^^^^^^^ - | - = note: `-D eq-op` implied by `-D warnings` error: constant division of 0.0 with 0.0 will always result in NaN --> zero_div_zero.rs:10:28 @@ -63,10 +55,9 @@ error: constant division of 0.0 with 0.0 will always result in NaN 10 | let one_more_f64_nan = 0.0f64/0.0f64; | ^^^^^^^^^^^^^ | - = note: `-D zero-divided-by-zero` implied by `-D warnings` = help: Consider using `std::f64::NAN` if you would like a constant representing NaN -error: aborting due to previous error(s) +error: aborting due to 8 previous errors To learn more, run the command again with --verbose. diff --git a/clippy_tests/examples/zero_ptr.stderr b/clippy_tests/examples/zero_ptr.stderr index bb8f78d00a97..d4d82b36ecae 100644 --- a/clippy_tests/examples/zero_ptr.stderr +++ b/clippy_tests/examples/zero_ptr.stderr @@ -11,10 +11,8 @@ error: `0 as *mut _` detected. Consider using `ptr::null_mut()` | 7 | let y = 0 as *mut f64; | ^^^^^^^^^^^^^ - | - = note: `-D zero-ptr` implied by `-D warnings` -error: aborting due to previous error(s) +error: aborting due to 2 previous errors To learn more, run the command again with --verbose. From b862b9b1158e9f492cd55d8db9037df4005c3a94 Mon Sep 17 00:00:00 2001 From: messense Date: Mon, 3 Jul 2017 14:53:52 +0800 Subject: [PATCH 4/4] Update windows ui tests --- tests/ui-windows/conf_non_existant.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ui-windows/conf_non_existant.stderr b/tests/ui-windows/conf_non_existant.stderr index bc1e2aaa7249..f21ae524f5ea 100644 --- a/tests/ui-windows/conf_non_existant.stderr +++ b/tests/ui-windows/conf_non_existant.stderr @@ -1,4 +1,4 @@ error: error reading Clippy's configuration file: The system cannot find the file specified. (os error 2) -error: aborting due to previous error(s) +error: aborting due to previous error