]> git.lizzy.rs Git - rust.git/commitdiff
remove all //~ from tests
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Wed, 8 Feb 2017 13:58:07 +0000 (14:58 +0100)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Wed, 8 Feb 2017 13:58:07 +0000 (14:58 +0100)
221 files changed:
tests/compile-fail/methods.rs
tests/compile-fail/non_expressive_names.rs
tests/compile-fail/strings.rs
tests/compile-fail/swap.rs
tests/run-pass/deprecated.rs
tests/ui/absurd-extreme-comparisons.rs
tests/ui/absurd-extreme-comparisons.stderr
tests/ui/approx_const.rs
tests/ui/approx_const.stderr
tests/ui/arithmetic.rs
tests/ui/arithmetic.stderr
tests/ui/array_indexing.rs
tests/ui/array_indexing.stderr
tests/ui/assign_ops.rs
tests/ui/assign_ops.stderr
tests/ui/assign_ops2.rs
tests/ui/assign_ops2.stderr
tests/ui/attrs.rs
tests/ui/attrs.stderr
tests/ui/bit_masks.rs
tests/ui/bit_masks.stderr
tests/ui/blacklisted_name.rs
tests/ui/blacklisted_name.stderr
tests/ui/block_in_if_condition.rs
tests/ui/block_in_if_condition.stderr
tests/ui/bool_comparison.rs
tests/ui/booleans.rs
tests/ui/booleans.stderr
tests/ui/box_vec.rs
tests/ui/box_vec.stderr
tests/ui/builtin-type-shadow.rs
tests/ui/builtin-type-shadow.stderr
tests/ui/cast.rs
tests/ui/cast.stderr
tests/ui/char_lit_as_u8.rs
tests/ui/char_lit_as_u8.stderr
tests/ui/cmp_nan.rs
tests/ui/cmp_nan.stderr
tests/ui/cmp_null.rs
tests/ui/cmp_null.stderr
tests/ui/cmp_owned.rs
tests/ui/cmp_owned.stderr
tests/ui/collapsible_if.rs
tests/ui/collapsible_if.stderr
tests/ui/complex_types.rs
tests/ui/complex_types.stderr
tests/ui/conf_french_blacklisted_name.rs
tests/ui/conf_french_blacklisted_name.stderr
tests/ui/conf_path_non_string.rs
tests/ui/copies.rs
tests/ui/copies.stderr
tests/ui/cyclomatic_complexity.rs
tests/ui/cyclomatic_complexity.stderr
tests/ui/cyclomatic_complexity_attr_used.rs
tests/ui/cyclomatic_complexity_attr_used.stderr
tests/ui/derive.rs
tests/ui/derive.stderr
tests/ui/diverging_sub_expression.rs
tests/ui/diverging_sub_expression.stderr
tests/ui/dlist.rs
tests/ui/dlist.stderr
tests/ui/doc.rs
tests/ui/double_neg.rs
tests/ui/double_neg.stderr
tests/ui/double_parens.rs
tests/ui/double_parens.stderr
tests/ui/drop_forget_ref.rs
tests/ui/drop_forget_ref.stderr
tests/ui/duplicate_underscore_argument.rs
tests/ui/duplicate_underscore_argument.stderr
tests/ui/empty_enum.rs
tests/ui/empty_enum.stderr
tests/ui/entry.rs
tests/ui/enum_glob_use.rs
tests/ui/enum_glob_use.stderr
tests/ui/enum_variants.rs
tests/ui/enum_variants.stderr
tests/ui/enums_clike.rs
tests/ui/enums_clike.stderr
tests/ui/eq_op.rs
tests/ui/eq_op.stderr
tests/ui/escape_analysis.rs
tests/ui/escape_analysis.stderr
tests/ui/eta.rs
tests/ui/eval_order_dependence.rs
tests/ui/eval_order_dependence.stderr
tests/ui/filter_methods.rs
tests/ui/filter_methods.stderr
tests/ui/float_cmp.rs
tests/ui/for_loop.rs
tests/ui/for_loop.stderr
tests/ui/format.rs
tests/ui/format.stderr
tests/ui/formatting.rs
tests/ui/formatting.stderr
tests/ui/functions.rs
tests/ui/functions.stderr
tests/ui/identity_op.rs
tests/ui/identity_op.stderr
tests/ui/if_let_redundant_pattern_matching.rs
tests/ui/if_not_else.rs
tests/ui/if_not_else.stderr
tests/ui/invalid_upcast_comparisons.rs
tests/ui/invalid_upcast_comparisons.stderr
tests/ui/item_after_statement.rs
tests/ui/item_after_statement.stderr
tests/ui/large_enum_variant.rs
tests/ui/large_enum_variant.stderr
tests/ui/len_zero.rs
tests/ui/len_zero.stderr
tests/ui/let_if_seq.rs
tests/ui/let_if_seq.stderr
tests/ui/let_return.rs
tests/ui/let_return.stderr
tests/ui/let_unit.rs
tests/ui/let_unit.stderr
tests/ui/lifetimes.rs
tests/ui/lifetimes.stderr
tests/ui/lint_pass.rs
tests/ui/literals.rs
tests/ui/literals.stderr
tests/ui/map_clone.rs
tests/ui/map_clone.stderr
tests/ui/matches.rs
tests/ui/matches.stderr
tests/ui/mem_forget.rs
tests/ui/methods.rs
tests/ui/methods.stderr
tests/ui/min_max.rs
tests/ui/min_max.stderr
tests/ui/missing-doc.rs
tests/ui/missing-doc.stderr
tests/ui/module_inception.rs
tests/ui/module_inception.stderr
tests/ui/modulo_one.rs
tests/ui/modulo_one.stderr
tests/ui/mut_mut.rs
tests/ui/mut_mut.stderr
tests/ui/mut_reference.rs
tests/ui/mut_reference.stderr
tests/ui/mutex_atomic.rs
tests/ui/mutex_atomic.stderr
tests/ui/needless_bool.rs
tests/ui/needless_bool.stderr
tests/ui/needless_borrow.rs
tests/ui/needless_borrow.stderr
tests/ui/needless_return.rs
tests/ui/needless_update.rs
tests/ui/needless_update.stderr
tests/ui/neg_multiply.rs
tests/ui/new_without_default.rs
tests/ui/no_effect.rs
tests/ui/no_effect.stderr
tests/ui/non_expressive_names.rs
tests/ui/non_expressive_names.stderr
tests/ui/ok_if_let.rs
tests/ui/ok_if_let.stderr
tests/ui/open_options.rs
tests/ui/open_options.stderr
tests/ui/overflow_check_conditional.rs
tests/ui/overflow_check_conditional.stderr
tests/ui/panic.rs
tests/ui/panic.stderr
tests/ui/partialeq_ne_impl.rs
tests/ui/patterns.rs
tests/ui/patterns.stderr
tests/ui/precedence.rs
tests/ui/print.rs
tests/ui/print.stderr
tests/ui/print_with_newline.rs
tests/ui/print_with_newline.stderr
tests/ui/ptr_arg.rs
tests/ui/ptr_arg.stderr
tests/ui/range.rs
tests/ui/range.stderr
tests/ui/redundant_closure_call.rs
tests/ui/redundant_closure_call.stderr
tests/ui/reference.rs
tests/ui/regex.rs
tests/ui/serde.rs
tests/ui/serde.stderr
tests/ui/shadow.rs
tests/ui/shadow.stderr
tests/ui/short_circuit_statement.rs
tests/ui/strings.rs
tests/ui/strings.stderr
tests/ui/stutter.rs
tests/ui/stutter.stderr
tests/ui/swap.rs
tests/ui/swap.stderr
tests/ui/temporary_assignment.rs
tests/ui/temporary_assignment.stderr
tests/ui/toplevel_ref_arg.rs
tests/ui/toplevel_ref_arg.stderr
tests/ui/transmute.rs
tests/ui/transmute_32bit.rs
tests/ui/transmute_64bit.rs
tests/ui/unicode.rs
tests/ui/unicode.stderr
tests/ui/unit_cmp.rs
tests/ui/unit_cmp.stderr
tests/ui/unneeded_field_pattern.rs
tests/ui/unneeded_field_pattern.stderr
tests/ui/unsafe_removed_from_name.rs
tests/ui/unused_io_amount.rs
tests/ui/unused_labels.rs
tests/ui/unused_labels.stderr
tests/ui/unused_lt.rs
tests/ui/unused_lt.stderr
tests/ui/used_underscore_binding.rs
tests/ui/used_underscore_binding.stderr
tests/ui/useless_attribute.rs
tests/ui/useless_attribute.stderr
tests/ui/vec.rs
tests/ui/while_loop.rs
tests/ui/while_loop.stderr
tests/ui/wrong_macro_span.rs_
tests/ui/wrong_self_convention.rs
tests/ui/wrong_self_convention.stderr
tests/ui/zero_div_zero.rs
tests/ui/zero_div_zero.stderr

index 43a4386886d9f8b0353694aee1d8216aa5f7a57c..34a0773df27f6e52fba7e4eacbfa54ff1d51cc08 100644 (file)
 struct T;
 
 impl T {
-    fn add(self, other: T) -> T { self } //~ERROR defining a method called `add`
-    fn drop(&mut self) { } //~ERROR defining a method called `drop`
+    fn add(self, other: T) -> T { self }
+    fn drop(&mut self) { }
 
     fn sub(&self, other: T) -> &T { self } // no error, self is a ref
     fn div(self) -> T { self } // no error, different #arguments
     fn rem(self, other: T) { } // no error, wrong return type
 
     fn into_u32(self) -> u32 { 0 } // fine
-    fn into_u16(&self) -> u16 { 0 } //~ERROR methods called `into_*` usually take self by value
+    fn into_u16(&self) -> u16 { 0 }
 
-    fn to_something(self) -> u32 { 0 } //~ERROR methods called `to_*` usually take self by reference
+    fn to_something(self) -> u32 { 0 }
 
     fn new(self) {}
-    //~^ ERROR methods called `new` usually take no self
-    //~| ERROR methods called `new` usually return `Self`
 }
 
 struct Lt<'a> {
@@ -96,15 +94,15 @@ fn option_methods() {
 
     // Check OPTION_MAP_UNWRAP_OR
     // single line case
-    let _ = opt.map(|x| x + 1) //~  ERROR called `map(f).unwrap_or(a)`
-                               //~| NOTE replace `map(|x| x + 1).unwrap_or(0)`
+    let _ = opt.map(|x| x + 1)
+
                .unwrap_or(0); // should lint even though this call is on a separate line
     // multi line cases
-    let _ = opt.map(|x| { //~ ERROR called `map(f).unwrap_or(a)`
+    let _ = opt.map(|x| {
                         x + 1
                     }
               ).unwrap_or(0);
-    let _ = opt.map(|x| x + 1) //~ ERROR called `map(f).unwrap_or(a)`
+    let _ = opt.map(|x| x + 1)
                .unwrap_or({
                     0
                 });
@@ -113,15 +111,15 @@ fn option_methods() {
 
     // Check OPTION_MAP_UNWRAP_OR_ELSE
     // single line case
-    let _ = opt.map(|x| x + 1) //~  ERROR called `map(f).unwrap_or_else(g)`
-                               //~| NOTE replace `map(|x| x + 1).unwrap_or_else(|| 0)`
+    let _ = opt.map(|x| x + 1)
+
                .unwrap_or_else(|| 0); // should lint even though this call is on a separate line
     // multi line cases
-    let _ = opt.map(|x| { //~ ERROR called `map(f).unwrap_or_else(g)`
+    let _ = opt.map(|x| {
                         x + 1
                     }
               ).unwrap_or_else(|| 0);
-    let _ = opt.map(|x| x + 1) //~ ERROR called `map(f).unwrap_or_else(g)`
+    let _ = opt.map(|x| x + 1)
                .unwrap_or_else(||
                     0
                 );
@@ -194,11 +192,11 @@ fn filter_next() {
 
     // check single-line case
     let _ = v.iter().filter(|&x| *x < 0).next();
-    //~^ ERROR called `filter(p).next()` on an `Iterator`.
-    //~| NOTE replace `filter(|&x| *x < 0).next()`
+
+
 
     // check multi-line case
-    let _ = v.iter().filter(|&x| { //~ERROR called `filter(p).next()` on an `Iterator`.
+    let _ = v.iter().filter(|&x| {
                                 *x < 0
                             }
                    ).next();
@@ -214,33 +212,33 @@ fn search_is_some() {
 
     // check `find().is_some()`, single-line
     let _ = v.iter().find(|&x| *x < 0).is_some();
-    //~^ ERROR called `is_some()` after searching
-    //~| NOTE replace `find(|&x| *x < 0).is_some()`
+
+
 
     // check `find().is_some()`, multi-line
-    let _ = v.iter().find(|&x| { //~ERROR called `is_some()` after searching
+    let _ = v.iter().find(|&x| {
                               *x < 0
                           }
                    ).is_some();
 
     // check `position().is_some()`, single-line
     let _ = v.iter().position(|&x| x < 0).is_some();
-    //~^ ERROR called `is_some()` after searching
-    //~| NOTE replace `position(|&x| x < 0).is_some()`
+
+
 
     // check `position().is_some()`, multi-line
-    let _ = v.iter().position(|&x| { //~ERROR called `is_some()` after searching
+    let _ = v.iter().position(|&x| {
                                   x < 0
                               }
                    ).is_some();
 
     // check `rposition().is_some()`, single-line
     let _ = v.iter().rposition(|&x| x < 0).is_some();
-    //~^ ERROR called `is_some()` after searching
-    //~| NOTE replace `rposition(|&x| x < 0).is_some()`
+
+
 
     // check `rposition().is_some()`, multi-line
-    let _ = v.iter().rposition(|&x| { //~ERROR called `is_some()` after searching
+    let _ = v.iter().rposition(|&x| {
                                    x < 0
                                }
                    ).is_some();
@@ -276,75 +274,75 @@ const fn make_const(i: i32) -> i32 { i }
 
     let with_constructor = Some(vec![1]);
     with_constructor.unwrap_or(make());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_constructor.unwrap_or_else(make)
+
+
+
 
     let with_new = Some(vec![1]);
     with_new.unwrap_or(Vec::new());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_new.unwrap_or_default();
+
+
+
 
     let with_const_args = Some(vec![1]);
     with_const_args.unwrap_or(Vec::with_capacity(12));
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_const_args.unwrap_or_else(|| Vec::with_capacity(12));
+
+
+
 
     let with_err : Result<_, ()> = Ok(vec![1]);
     with_err.unwrap_or(make());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_err.unwrap_or_else(|_| make());
+
+
+
 
     let with_err_args : Result<_, ()> = Ok(vec![1]);
     with_err_args.unwrap_or(Vec::with_capacity(12));
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_err_args.unwrap_or_else(|_| Vec::with_capacity(12));
+
+
+
 
     let with_default_trait = Some(1);
     with_default_trait.unwrap_or(Default::default());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_default_trait.unwrap_or_default();
+
+
+
 
     let with_default_type = Some(1);
     with_default_type.unwrap_or(u64::default());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_default_type.unwrap_or_default();
+
+
+
 
     let with_vec = Some(vec![1]);
     with_vec.unwrap_or(vec![]);
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
+
+
     // FIXME #944: ~|SUGGESTION with_vec.unwrap_or_else(|| vec![]);
 
     let without_default = Some(Foo);
     without_default.unwrap_or(Foo::new());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION without_default.unwrap_or_else(Foo::new);
+
+
+
 
     let mut map = HashMap::<u64, String>::new();
     map.entry(42).or_insert(String::new());
-    //~^ERROR use of `or_insert` followed by a function call
-    //~|HELP try this
-    //~|SUGGESTION map.entry(42).or_insert_with(String::new);
+
+
+
 
     let mut btree = BTreeMap::<u64, String>::new();
     btree.entry(42).or_insert(String::new());
-    //~^ERROR use of `or_insert` followed by a function call
-    //~|HELP try this
-    //~|SUGGESTION btree.entry(42).or_insert_with(String::new);
+
+
+
 
     let stringy = Some(String::from(""));
     let _ = stringy.unwrap_or("".to_owned());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION stringy.unwrap_or_else(|| "".to_owned());
+
+
+
 }
 
 /// Checks implementation of `ITER_NTH` lint
@@ -356,27 +354,27 @@ fn iter_nth() {
     {
         // Make sure we lint `.iter()` for relevant types
         let bad_vec = some_vec.iter().nth(3);
-        //~^ERROR called `.iter().nth()` on a Vec. Calling `.get()` is both faster and more readable
+
         let bad_slice = &some_vec[..].iter().nth(3);
-        //~^ERROR called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
+
         let bad_boxed_slice = boxed_slice.iter().nth(3);
-        //~^ERROR called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
+
         let bad_vec_deque = some_vec_deque.iter().nth(3);
-        //~^ERROR called `.iter().nth()` on a VecDeque. Calling `.get()` is both faster and more readable
+
     }
 
     {
         // Make sure we lint `.iter_mut()` for relevant types
         let bad_vec = some_vec.iter_mut().nth(3);
-        //~^ERROR called `.iter_mut().nth()` on a Vec. Calling `.get_mut()` is both faster and more readable
+
     }
     {
         let bad_slice = &some_vec[..].iter_mut().nth(3);
-        //~^ERROR called `.iter_mut().nth()` on a slice. Calling `.get_mut()` is both faster and more readable
+
     }
     {
         let bad_vec_deque = some_vec_deque.iter_mut().nth(3);
-        //~^ERROR called `.iter_mut().nth()` on a VecDeque. Calling `.get_mut()` is both faster and more readable
+
     }
 
     // Make sure we don't lint for non-relevant types
@@ -390,16 +388,16 @@ fn iter_skip_next() {
     let mut some_vec = vec![0, 1, 2, 3];
 
     let _ = some_vec.iter().skip(42).next();
-    //~^ERROR called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
+
 
     let _ = some_vec.iter().cycle().skip(42).next();
-    //~^ERROR called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
+
 
     let _ = (1..10).skip(10).next();
-    //~^ERROR called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
+
 
     let _ = &some_vec[..].iter().skip(3).next();
-    //~^ERROR called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
+
 
     let foo = IteratorFalsePositives { foo : 0 };
     let _ = foo.skip(42).next();
@@ -427,50 +425,50 @@ fn get_unwrap() {
 
     { // Test `get().unwrap()`
         let _ = boxed_slice.get(1).unwrap();
-        //~^ERROR called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION boxed_slice[1]
+
+
+
         let _ = some_slice.get(0).unwrap();
-        //~^ERROR called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION some_slice[0]
+
+
+
         let _ = some_vec.get(0).unwrap();
-        //~^ERROR called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION some_vec[0]
+
+
+
         let _ = some_vecdeque.get(0).unwrap();
-        //~^ERROR called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION some_vecdeque[0]
+
+
+
         let _ = some_hashmap.get(&1).unwrap();
-        //~^ERROR called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION some_hashmap[&1]
+
+
+
         let _ = some_btreemap.get(&1).unwrap();
-        //~^ERROR called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION some_btreemap[&1]
+
+
+
 
         let _ = false_positive.get(0).unwrap();
     }
 
     { // Test `get_mut().unwrap()`
         *boxed_slice.get_mut(0).unwrap() = 1;
-        //~^ERROR called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION &mut boxed_slice[0]
+
+
+
         *some_slice.get_mut(0).unwrap() = 1;
-        //~^ERROR called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION &mut some_slice[0]
+
+
+
         *some_vec.get_mut(0).unwrap() = 1;
-        //~^ERROR called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION &mut some_vec[0]
+
+
+
         *some_vecdeque.get_mut(0).unwrap() = 1;
-        //~^ERROR called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION &mut some_vecdeque[0]
+
+
+
 
         // Check false positives
         *some_hashmap.get_mut(&1).unwrap() = 'b';
@@ -485,24 +483,24 @@ fn main() {
     use std::io;
 
     let opt = Some(0);
-    let _ = opt.unwrap();  //~ERROR used unwrap() on an Option
+    let _ = opt.unwrap();
 
     let res: Result<i32, ()> = Ok(0);
-    let _ = res.unwrap();  //~ERROR used unwrap() on a Result
+    let _ = res.unwrap();
 
-    res.ok().expect("disaster!"); //~ERROR called `ok().expect()`
+    res.ok().expect("disaster!");
     // the following should not warn, since `expect` isn't implemented unless
     // the error type implements `Debug`
     let res2: Result<i32, MyError> = Ok(0);
     res2.ok().expect("oh noes!");
     let res3: Result<u32, MyErrorWithParam<u8>>= Ok(0);
-    res3.ok().expect("whoof"); //~ERROR called `ok().expect()`
+    res3.ok().expect("whoof");
     let res4: Result<u32, io::Error> = Ok(0);
-    res4.ok().expect("argh"); //~ERROR called `ok().expect()`
+    res4.ok().expect("argh");
     let res5: io::Result<u32> = Ok(0);
-    res5.ok().expect("oops"); //~ERROR called `ok().expect()`
+    res5.ok().expect("oops");
     let res6: Result<u32, &str> = Ok(0);
-    res6.ok().expect("meh"); //~ERROR called `ok().expect()`
+    res6.ok().expect("meh");
 }
 
 struct MyError(()); // doesn't implement Debug
@@ -515,14 +513,14 @@ struct MyErrorWithParam<T> {
 #[allow(unnecessary_operation)]
 fn starts_with() {
     "".chars().next() == Some(' ');
-    //~^ ERROR starts_with
-    //~| HELP like this
-    //~| SUGGESTION "".starts_with(' ')
+
+
+
 
     Some(' ') != "".chars().next();
-    //~^ ERROR starts_with
-    //~| HELP like this
-    //~| SUGGESTION !"".starts_with(' ')
+
+
+
 }
 
 fn str_extend_chars() {
@@ -532,21 +530,21 @@ fn str_extend_chars() {
 
     s.push_str(abc);
     s.extend(abc.chars());
-    //~^ERROR calling `.extend(_.chars())`
-    //~|HELP try this
-    //~|SUGGESTION s.push_str(abc)
+
+
+
 
     s.push_str("abc");
     s.extend("abc".chars());
-    //~^ERROR calling `.extend(_.chars())`
-    //~|HELP try this
-    //~|SUGGESTION s.push_str("abc")
+
+
+
 
     s.push_str(&def);
     s.extend(def.chars());
-    //~^ERROR calling `.extend(_.chars())`
-    //~|HELP try this
-    //~|SUGGESTION s.push_str(&def)
+
+
+
 
     s.extend(abc.chars().skip(1));
     s.extend("abc".chars().skip(1));
@@ -557,40 +555,40 @@ fn str_extend_chars() {
 }
 
 fn clone_on_copy() {
-    42.clone(); //~ERROR using `clone` on a `Copy` type
-                //~| HELP try removing the `clone` call
-                //~| SUGGESTION 42
+    42.clone();
+
+
     vec![1].clone(); // ok, not a Copy type
     Some(vec![1]).clone(); // ok, not a Copy type
-    (&42).clone(); //~ERROR using `clone` on a `Copy` type
-                   //~| HELP try dereferencing it
-                   //~| SUGGESTION *(&42)
+    (&42).clone();
+
+
 }
 
 fn clone_on_copy_generic<T: Copy>(t: T) {
-    t.clone(); //~ERROR using `clone` on a `Copy` type
-               //~| HELP try removing the `clone` call
-               //~| SUGGESTION t
-    Some(t).clone(); //~ERROR using `clone` on a `Copy` type
-                     //~| HELP try removing the `clone` call
-                     //~| SUGGESTION Some(t)
+    t.clone();
+
+
+    Some(t).clone();
+
+
 }
 
 fn clone_on_double_ref() {
     let x = vec![1];
     let y = &&x;
-    let z: &Vec<_> = y.clone(); //~ERROR using `clone` on a double
-                                //~| HELP try dereferencing it
-                                //~| SUGGESTION let z: &Vec<_> = (*y).clone();
+    let z: &Vec<_> = y.clone();
+
+
     println!("{:p} {:p}",*y, z);
 }
 
 fn single_char_pattern() {
     let x = "foo";
     x.split("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.split('x');
+
+
+
 
     x.split("xx");
 
@@ -612,69 +610,69 @@ fn single_char_pattern() {
     x.split("❤️");
 
     x.contains("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.contains('x');
+
+
+
     x.starts_with("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.starts_with('x');
+
+
+
     x.ends_with("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.ends_with('x');
+
+
+
     x.find("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.find('x');
+
+
+
     x.rfind("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.rfind('x');
+
+
+
     x.rsplit("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.rsplit('x');
+
+
+
     x.split_terminator("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.split_terminator('x');
+
+
+
     x.rsplit_terminator("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.rsplit_terminator('x');
+
+
+
     x.splitn(0, "x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.splitn(0, 'x');
+
+
+
     x.rsplitn(0, "x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.rsplitn(0, 'x');
+
+
+
     x.matches("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.matches('x');
+
+
+
     x.rmatches("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.rmatches('x');
+
+
+
     x.match_indices("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.match_indices('x');
+
+
+
     x.rmatch_indices("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.rmatch_indices('x');
+
+
+
     x.trim_left_matches("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.trim_left_matches('x');
+
+
+
     x.trim_right_matches("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.trim_right_matches('x');
+
+
+
 
     let h = HashSet::<String>::new();
     h.contains("X"); // should not warn
@@ -685,7 +683,7 @@ fn temporary_cstring() {
     use std::ffi::CString;
 
     CString::new("foo").unwrap().as_ptr();
-    //~^ ERROR you are getting the inner pointer of a temporary `CString`
-    //~| NOTE that pointer will be invalid outside this expression
-    //~| HELP assign the `CString` to a variable to extend its lifetime
+
+
+
 }
index 778041f49b8c63a1b4cd2be785e1bb7947989e1e..649a5ecb812d95ab830855d55389b31d756fa6dc 100644 (file)
@@ -1,17 +1,17 @@
 #![feature(plugin)]
 #![plugin(clippy)]
 #![deny(clippy,similar_names)]
-//~^ NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
+
+
+
+
+
+
+
+
+
+
+
 #![allow(unused)]
 
 
@@ -24,12 +24,12 @@ fn main() {
     let specter: i32;
     let spectre: i32;
 
-    let apple: i32; //~ NOTE: existing binding defined here
-    //~^ NOTE: existing binding defined here
-    let bpple: i32; //~ ERROR: name is too similar
-    //~| HELP: separate the discriminating character by an underscore like: `b_pple`
-    let cpple: i32; //~ ERROR: name is too similar
-    //~| HELP: separate the discriminating character by an underscore like: `c_pple`
+    let apple: i32;
+
+    let bpple: i32;
+
+    let cpple: i32;
+
 
     let a_bar: i32;
     let b_bar: i32;
@@ -52,13 +52,13 @@ fn main() {
     let blubrhs: i32;
     let blublhs: i32;
 
-    let blubx: i32; //~ NOTE: existing binding defined here
-    let bluby: i32; //~ ERROR: name is too similar
-    //~| HELP: separate the discriminating character by an underscore like: `blub_y`
+    let blubx: i32;
+    let bluby: i32;
+
 
-    let cake: i32; //~ NOTE: existing binding defined here
+    let cake: i32;
     let cakes: i32;
-    let coke: i32; //~ ERROR: name is too similar
+    let coke: i32;
 
     match 5 {
         cheese @ 1 => {},
@@ -74,14 +74,14 @@ fn main() {
     let ipv6: i32;
     let abcd1: i32;
     let abdc2: i32;
-    let xyz1abc: i32; //~ NOTE: existing binding defined here
+    let xyz1abc: i32;
     let xyz2abc: i32;
-    let xyzeabc: i32; //~ ERROR: name is too similar
+    let xyzeabc: i32;
 
-    let parser: i32; //~ NOTE: existing binding defined here
+    let parser: i32;
     let parsed: i32;
-    let parsee: i32; //~ ERROR: name is too similar
-    //~| HELP: separate the discriminating character by an underscore like: `parse_e`
+    let parsee: i32;
+
 
     let setter: i32;
     let getter: i32;
@@ -93,8 +93,8 @@ fn main() {
 
 fn foo() {
     let Foo { apple, bpple } = unimplemented!();
-    let Foo { apple: spring, //~NOTE existing binding defined here
-        bpple: sprang } = unimplemented!(); //~ ERROR: name is too similar
+    let Foo { apple: spring,
+        bpple: sprang } = unimplemented!();
 }
 
 #[derive(Clone, Debug)]
@@ -128,19 +128,19 @@ fn bla() {
             let blar: i32;
         }
         {
-            let e: i32; //~ ERROR: 5th binding whose name is just one char
-            //~^ NOTE implied by
+            let e: i32;
+
         }
         {
-            let e: i32; //~ ERROR: 5th binding whose name is just one char
-            //~^ NOTE implied by
-            let f: i32; //~ ERROR: 6th binding whose name is just one char
-            //~^ NOTE implied by
+            let e: i32;
+
+            let f: i32;
+
         }
         match 5 {
             1 => println!(""),
-            e => panic!(), //~ ERROR: 5th binding whose name is just one char
-            //~^ NOTE implied by
+            e => panic!(),
+
         }
         match 5 {
             1 => println!(""),
index 7cfc8a41ea1f1c920f41e184845a464ef98c7efa..f893d99491bee50b7c902c40003ac9e250ca9ead 100644 (file)
@@ -7,11 +7,11 @@ fn add_only() { // ignores assignment distinction
     let mut x = "".to_owned();
 
     for _ in 1..3 {
-        x = x + "."; //~ERROR you added something to a string.
+        x = x + ".";
     }
 
     let y = "".to_owned();
-    let z = y + "..."; //~ERROR you added something to a string.
+    let z = y + "...";
 
     assert_eq!(&x, &z);
 }
@@ -21,7 +21,7 @@ fn add_assign_only() {
     let mut x = "".to_owned();
 
     for _ in 1..3 {
-        x = x + "."; //~ERROR you assigned the result of adding something to this string.
+        x = x + ".";
     }
 
     let y = "".to_owned();
@@ -35,11 +35,11 @@ fn both() {
     let mut x = "".to_owned();
 
     for _ in 1..3 {
-        x = x + "."; //~ERROR you assigned the result of adding something to this string.
+        x = x + ".";
     }
 
     let y = "".to_owned();
-    let z = y + "..."; //~ERROR you added something to a string.
+    let z = y + "...";
 
     assert_eq!(&x, &z);
 }
@@ -48,9 +48,9 @@ fn both() {
 #[deny(string_lit_as_bytes)]
 fn str_lit_as_bytes() {
     let bs = "hello there".as_bytes();
-    //~^ERROR calling `as_bytes()`
-    //~|HELP byte string literal
-    //~|SUGGESTION b"hello there"
+
+
+
 
     // no warning, because this cannot be written as a byte string literal:
     let ubs = "☃".as_bytes();
@@ -66,8 +66,8 @@ fn main() {
     // the add is only caught for `String`
     let mut x = 1;
     ; x = x + 1;
-    //~^ WARN manual implementation of an assign operation
-    //~| HELP replace
-    //~| SUGGESTION ; x += 1;
+
+
+
     assert_eq!(2, x);
 }
index 0e56d5ca86e62e8311ec9c82fa3eb45081df4ed8..95478dda0d32ea964463b03ef7b1853b4edbbfe8 100644 (file)
@@ -8,36 +8,36 @@
 
 fn array() {
     let mut foo = [1, 2];
-    let temp = foo[0]; //~ NOTE implied by
+    let temp = foo[0];
     foo[0] = foo[1];
     foo[1] = temp;
-    //~^^^ ERROR this looks like you are swapping elements of `foo` manually
-    //~| HELP try
-    //~| SUGGESTION foo.swap(0, 1);
+
+
+
 
     foo.swap(0, 1);
 }
 
 fn slice() {
     let foo = &mut [1, 2];
-    let temp = foo[0]; //~ NOTE implied by
+    let temp = foo[0];
     foo[0] = foo[1];
     foo[1] = temp;
-    //~^^^ ERROR this looks like you are swapping elements of `foo` manually
-    //~| HELP try
-    //~| SUGGESTION foo.swap(0, 1);
+
+
+
 
     foo.swap(0, 1);
 }
 
 fn vec() {
     let mut foo = vec![1, 2];
-    let temp = foo[0]; //~ NOTE implied by
+    let temp = foo[0];
     foo[0] = foo[1];
     foo[1] = temp;
-    //~^^^ ERROR this looks like you are swapping elements of `foo` manually
-    //~| HELP try
-    //~| SUGGESTION foo.swap(0, 1);
+
+
+
 
     foo.swap(0, 1);
 }
@@ -50,35 +50,35 @@ fn main() {
     let mut a = 42;
     let mut b = 1337;
 
-    a = b; //~ NOTE implied by
+    a = b;
     b = a;
-    //~^^ ERROR this looks like you are trying to swap `a` and `b`
-    //~| HELP try
-    //~| SUGGESTION std::mem::swap(&mut a, &mut b);
-    //~| NOTE or maybe you should use `std::mem::replace`?
 
-    ; let t = a; //~ NOTE implied by
+
+
+
+
+    ; let t = a;
     a = b;
     b = t;
-    //~^^^ ERROR this looks like you are swapping `a` and `b` manually
-    //~| HELP try
-    //~| SUGGESTION ; std::mem::swap(&mut a, &mut b);
-    //~| NOTE or maybe you should use `std::mem::replace`?
+
+
+
+
 
     let mut c = Foo(42);
 
-    c.0 = a; //~ NOTE implied by
+    c.0 = a;
     a = c.0;
-    //~^^ ERROR this looks like you are trying to swap `c.0` and `a`
-    //~| HELP try
-    //~| SUGGESTION std::mem::swap(&mut c.0, &mut a);
-    //~| NOTE or maybe you should use `std::mem::replace`?
 
-    ; let t = c.0; //~ NOTE implied by
+
+
+
+
+    ; let t = c.0;
     c.0 = a;
     a = t;
-    //~^^^ ERROR this looks like you are swapping `c.0` and `a` manually
-    //~| HELP try
-    //~| SUGGESTION ; std::mem::swap(&mut c.0, &mut a);
-    //~| NOTE or maybe you should use `std::mem::replace`?
+
+
+
+
 }
index 670b096ea63997396cfff127d707b87f035b025c..e0c856e3d7ccff678a6c1125fa9588d4614e3193 100644 (file)
@@ -2,11 +2,11 @@
 #![plugin(clippy)]
 
 #[warn(str_to_string)]
-//~^WARNING: lint str_to_string has been removed: using `str::to_string`
+
 #[warn(string_to_string)]
-//~^WARNING: lint string_to_string has been removed: using `string::to_string`
+
 #[warn(unstable_as_slice)]
-//~^WARNING: lint unstable_as_slice has been removed: `Vec::as_slice` has been stabilized
+
 #[warn(unstable_as_mut_slice)]
-//~^WARNING: lint unstable_as_mut_slice has been removed: `Vec::as_mut_slice` has been stabilized
+
 fn main() {}
index cf69473bbe5f6ffd2acea28d222a0458dc9b2e31..495dd27bb2bcfd60ab4273e8942fc25523308e53 100644 (file)
@@ -10,66 +10,66 @@ fn main() {
     let u: u32 = 42;
 
     u <= 0;
-    //~^ ERROR this comparison involving the minimum or maximum element for this type contains a
-    //~| HELP using u == 0 instead
+
+
     u <= Z;
-    //~^ ERROR this comparison involving
-    //~| HELP using u == Z instead
+
+
     u < Z;
-    //~^ ERROR this comparison involving
-    //~| HELP comparison is always false
+
+
     Z >= u;
-    //~^ ERROR this comparison involving
-    //~| HELP using Z == u instead
+
+
     Z > u;
-    //~^ ERROR this comparison involving
-    //~| HELP comparison is always false
+
+
     u > std::u32::MAX;
-    //~^ ERROR this comparison involving
-    //~| HELP comparison is always false
+
+
     u >= std::u32::MAX;
-    //~^ ERROR this comparison involving
-    //~| HELP using u == std::u32::MAX instead
+
+
     std::u32::MAX < u;
-    //~^ ERROR this comparison involving
-    //~| HELP comparison is always false
+
+
     std::u32::MAX <= u;
-    //~^ ERROR this comparison involving
-    //~| HELP using std::u32::MAX == u instead
+
+
 
     1-1 > u;
-        //~^ ERROR this comparison involving
-        //~| HELP because 1-1 is the minimum value for this type, this comparison is always false
+
+
     u >= !0;
-        //~^ ERROR this comparison involving
-        //~| HELP consider using u == !0 instead
+
+
     u <= 12 - 2*6;
-        //~^ ERROR this comparison involving
-        //~| HELP consider using u == 12 - 2*6 instead
+
+
 
     let i: i8 = 0;
     i < -127 - 1;
-    //~^ ERROR this comparison involving
-    //~| HELP comparison is always false
+
+
     std::i8::MAX >= i;
-    //~^ ERROR this comparison involving
-    //~| HELP comparison is always true
+
+
     3-7 < std::i32::MIN;
-    //~^ ERROR this comparison involving
-    //~| HELP comparison is always false
+
+
 
     let b = false;
     b >= true;
-    //~^ ERROR this comparison involving
-    //~| HELP using b == true instead
+
+
     false > b;
-    //~^ ERROR this comparison involving
-    //~| HELP comparison is always false
+
+
 
     u > 0; // ok
 
     // this is handled by unit_cmp
-    () < {}; //~WARNING <-comparison of unit values detected.
+    () < {};
 }
 
 use std::cmp::{Ordering, PartialEq, PartialOrd};
index ba3b6a248205cf19b18216afb8fc0fdff09e761d..834bcf03fe1e3a246386e9d8a33884814b5f1513 100644 (file)
@@ -142,7 +142,7 @@ error: this comparison involving the minimum or maximum element for this type co
 warning: <-comparison of unit values detected. This will always be false
   --> $DIR/absurd-extreme-comparisons.rs:72:5
    |
-72 |     () < {}; //~WARNING <-comparison of unit values detected.
+72 |     () < {};
    |     ^^^^^^^
    |
    = note: #[warn(unit_cmp)] on by default
index 2240c3799a3c91e1ff141d61a92b35be9f73a15f..2da762725b158e5e78d7ff8a1fb60153829c727e 100644 (file)
@@ -4,54 +4,54 @@
 #[deny(approx_constant)]
 #[allow(unused, shadow_unrelated, similar_names)]
 fn main() {
-    let my_e = 2.7182; //~ERROR approximate value of `f{32, 64}::consts::E` found
-    let almost_e = 2.718; //~ERROR approximate value of `f{32, 64}::consts::E` found
+    let my_e = 2.7182;
+    let almost_e = 2.718;
     let no_e = 2.71;
 
-    let my_1_frac_pi = 0.3183; //~ERROR approximate value of `f{32, 64}::consts::FRAC_1_PI` found
+    let my_1_frac_pi = 0.3183;
     let no_1_frac_pi = 0.31;
 
-    let my_frac_1_sqrt_2 = 0.70710678; //~ERROR approximate value of `f{32, 64}::consts::FRAC_1_SQRT_2` found
-    let almost_frac_1_sqrt_2 = 0.70711; //~ERROR approximate value of `f{32, 64}::consts::FRAC_1_SQRT_2` found
+    let my_frac_1_sqrt_2 = 0.70710678;
+    let almost_frac_1_sqrt_2 = 0.70711;
     let my_frac_1_sqrt_2 = 0.707;
 
-    let my_frac_2_pi = 0.63661977; //~ERROR approximate value of `f{32, 64}::consts::FRAC_2_PI` found
+    let my_frac_2_pi = 0.63661977;
     let no_frac_2_pi = 0.636;
 
-    let my_frac_2_sq_pi = 1.128379; //~ERROR approximate value of `f{32, 64}::consts::FRAC_2_SQRT_PI` found
+    let my_frac_2_sq_pi = 1.128379;
     let no_frac_2_sq_pi = 1.128;
 
-    let my_frac_pi_2 = 1.57079632679; //~ERROR approximate value of `f{32, 64}::consts::FRAC_PI_2` found
+    let my_frac_pi_2 = 1.57079632679;
     let no_frac_pi_2 = 1.5705;
 
-    let my_frac_pi_3 = 1.04719755119; //~ERROR approximate value of `f{32, 64}::consts::FRAC_PI_3` found
+    let my_frac_pi_3 = 1.04719755119;
     let no_frac_pi_3 = 1.047;
 
-    let my_frac_pi_4 = 0.785398163397; //~ERROR approximate value of `f{32, 64}::consts::FRAC_PI_4` found
+    let my_frac_pi_4 = 0.785398163397;
     let no_frac_pi_4 = 0.785;
 
-    let my_frac_pi_6 = 0.523598775598; //~ERROR approximate value of `f{32, 64}::consts::FRAC_PI_6` found
+    let my_frac_pi_6 = 0.523598775598;
     let no_frac_pi_6 = 0.523;
 
-    let my_frac_pi_8 = 0.3926990816987; //~ERROR approximate value of `f{32, 64}::consts::FRAC_PI_8` found
+    let my_frac_pi_8 = 0.3926990816987;
     let no_frac_pi_8 = 0.392;
 
-    let my_ln_10 = 2.302585092994046; //~ERROR approximate value of `f{32, 64}::consts::LN_10` found
+    let my_ln_10 = 2.302585092994046;
     let no_ln_10 = 2.303;
 
-    let my_ln_2 = 0.6931471805599453; //~ERROR approximate value of `f{32, 64}::consts::LN_2` found
+    let my_ln_2 = 0.6931471805599453;
     let no_ln_2 = 0.693;
 
-    let my_log10_e = 0.43429448190325182; //~ERROR approximate value of `f{32, 64}::consts::LOG10_E` found
+    let my_log10_e = 0.43429448190325182;
     let no_log10_e = 0.434;
 
-    let my_log2_e = 1.4426950408889634; //~ERROR approximate value of `f{32, 64}::consts::LOG2_E` found
+    let my_log2_e = 1.4426950408889634;
     let no_log2_e = 1.442;
 
-    let my_pi = 3.1415; //~ERROR approximate value of `f{32, 64}::consts::PI` found
-    let almost_pi = 3.14; //~ERROR approximate value of `f{32, 64}::consts::PI` found
+    let my_pi = 3.1415;
+    let almost_pi = 3.14;
     let no_pi = 3.15;
 
-    let my_sq2 = 1.4142; //~ERROR approximate value of `f{32, 64}::consts::SQRT_2` found
+    let my_sq2 = 1.4142;
     let no_sq2 = 1.414;
 }
index 9f5a91074e562d1d32844840d07f530c04330277..cc0408fb2d9eb409991ae248664692db51e0acc9 100644 (file)
@@ -1,7 +1,7 @@
 error: approximate value of `f{32, 64}::consts::E` found. Consider using it directly
  --> $DIR/approx_const.rs:7:16
   |
-7 |     let my_e = 2.7182; //~ERROR approximate value of `f{32, 64}::consts::E` found
+7 |     let my_e = 2.7182;
   |                ^^^^^^
   |
 note: lint level defined here
@@ -13,109 +13,109 @@ note: lint level defined here
 error: approximate value of `f{32, 64}::consts::E` found. Consider using it directly
  --> $DIR/approx_const.rs:8:20
   |
-8 |     let almost_e = 2.718; //~ERROR approximate value of `f{32, 64}::consts::E` found
+8 |     let almost_e = 2.718;
   |                    ^^^^^
 
 error: approximate value of `f{32, 64}::consts::FRAC_1_PI` found. Consider using it directly
   --> $DIR/approx_const.rs:11:24
    |
-11 |     let my_1_frac_pi = 0.3183; //~ERROR approximate value of `f{32, 64}::consts::FRAC_1_PI` found
+11 |     let my_1_frac_pi = 0.3183;
    |                        ^^^^^^
 
 error: approximate value of `f{32, 64}::consts::FRAC_1_SQRT_2` found. Consider using it directly
   --> $DIR/approx_const.rs:14:28
    |
-14 |     let my_frac_1_sqrt_2 = 0.70710678; //~ERROR approximate value of `f{32, 64}::consts::FRAC_1_SQRT_2` found
+14 |     let my_frac_1_sqrt_2 = 0.70710678;
    |                            ^^^^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::FRAC_1_SQRT_2` found. Consider using it directly
   --> $DIR/approx_const.rs:15:32
    |
-15 |     let almost_frac_1_sqrt_2 = 0.70711; //~ERROR approximate value of `f{32, 64}::consts::FRAC_1_SQRT_2` found
+15 |     let almost_frac_1_sqrt_2 = 0.70711;
    |                                ^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::FRAC_2_PI` found. Consider using it directly
   --> $DIR/approx_const.rs:18:24
    |
-18 |     let my_frac_2_pi = 0.63661977; //~ERROR approximate value of `f{32, 64}::consts::FRAC_2_PI` found
+18 |     let my_frac_2_pi = 0.63661977;
    |                        ^^^^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::FRAC_2_SQRT_PI` found. Consider using it directly
   --> $DIR/approx_const.rs:21:27
    |
-21 |     let my_frac_2_sq_pi = 1.128379; //~ERROR approximate value of `f{32, 64}::consts::FRAC_2_SQRT_PI` found
+21 |     let my_frac_2_sq_pi = 1.128379;
    |                           ^^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::FRAC_PI_2` found. Consider using it directly
   --> $DIR/approx_const.rs:24:24
    |
-24 |     let my_frac_pi_2 = 1.57079632679; //~ERROR approximate value of `f{32, 64}::consts::FRAC_PI_2` found
+24 |     let my_frac_pi_2 = 1.57079632679;
    |                        ^^^^^^^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::FRAC_PI_3` found. Consider using it directly
   --> $DIR/approx_const.rs:27:24
    |
-27 |     let my_frac_pi_3 = 1.04719755119; //~ERROR approximate value of `f{32, 64}::consts::FRAC_PI_3` found
+27 |     let my_frac_pi_3 = 1.04719755119;
    |                        ^^^^^^^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::FRAC_PI_4` found. Consider using it directly
   --> $DIR/approx_const.rs:30:24
    |
-30 |     let my_frac_pi_4 = 0.785398163397; //~ERROR approximate value of `f{32, 64}::consts::FRAC_PI_4` found
+30 |     let my_frac_pi_4 = 0.785398163397;
    |                        ^^^^^^^^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::FRAC_PI_6` found. Consider using it directly
   --> $DIR/approx_const.rs:33:24
    |
-33 |     let my_frac_pi_6 = 0.523598775598; //~ERROR approximate value of `f{32, 64}::consts::FRAC_PI_6` found
+33 |     let my_frac_pi_6 = 0.523598775598;
    |                        ^^^^^^^^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::FRAC_PI_8` found. Consider using it directly
   --> $DIR/approx_const.rs:36:24
    |
-36 |     let my_frac_pi_8 = 0.3926990816987; //~ERROR approximate value of `f{32, 64}::consts::FRAC_PI_8` found
+36 |     let my_frac_pi_8 = 0.3926990816987;
    |                        ^^^^^^^^^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::LN_10` found. Consider using it directly
   --> $DIR/approx_const.rs:39:20
    |
-39 |     let my_ln_10 = 2.302585092994046; //~ERROR approximate value of `f{32, 64}::consts::LN_10` found
+39 |     let my_ln_10 = 2.302585092994046;
    |                    ^^^^^^^^^^^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::LN_2` found. Consider using it directly
   --> $DIR/approx_const.rs:42:19
    |
-42 |     let my_ln_2 = 0.6931471805599453; //~ERROR approximate value of `f{32, 64}::consts::LN_2` found
+42 |     let my_ln_2 = 0.6931471805599453;
    |                   ^^^^^^^^^^^^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::LOG10_E` found. Consider using it directly
   --> $DIR/approx_const.rs:45:22
    |
-45 |     let my_log10_e = 0.43429448190325182; //~ERROR approximate value of `f{32, 64}::consts::LOG10_E` found
+45 |     let my_log10_e = 0.43429448190325182;
    |                      ^^^^^^^^^^^^^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::LOG2_E` found. Consider using it directly
   --> $DIR/approx_const.rs:48:21
    |
-48 |     let my_log2_e = 1.4426950408889634; //~ERROR approximate value of `f{32, 64}::consts::LOG2_E` found
+48 |     let my_log2_e = 1.4426950408889634;
    |                     ^^^^^^^^^^^^^^^^^^
 
 error: approximate value of `f{32, 64}::consts::PI` found. Consider using it directly
   --> $DIR/approx_const.rs:51:17
    |
-51 |     let my_pi = 3.1415; //~ERROR approximate value of `f{32, 64}::consts::PI` found
+51 |     let my_pi = 3.1415;
    |                 ^^^^^^
 
 error: approximate value of `f{32, 64}::consts::PI` found. Consider using it directly
   --> $DIR/approx_const.rs:52:21
    |
-52 |     let almost_pi = 3.14; //~ERROR approximate value of `f{32, 64}::consts::PI` found
+52 |     let almost_pi = 3.14;
    |                     ^^^^
 
 error: approximate value of `f{32, 64}::consts::SQRT_2` found. Consider using it directly
   --> $DIR/approx_const.rs:55:18
    |
-55 |     let my_sq2 = 1.4142; //~ERROR approximate value of `f{32, 64}::consts::SQRT_2` found
+55 |     let my_sq2 = 1.4142;
    |                  ^^^^^^
 
 error: aborting due to 19 previous errors
index 5479c55e11e030ae824155757a22b023746dd6ec..b4014cc480fc8cb049f5592033b57051aeae3f5c 100644 (file)
@@ -5,12 +5,12 @@
 #![allow(unused, shadow_reuse, shadow_unrelated, no_effect, unnecessary_operation)]
 fn main() {
     let i = 1i32;
-    1 + i; //~ERROR integer arithmetic detected
-    i * 2; //~ERROR integer arithmetic detected
-    1 % //~ERROR integer arithmetic detected
+    1 + i;
+    i * 2;
+    1 %
     i / 2; // no error, this is part of the expression in the preceding line
-    i - 2 + 2 - i; //~ERROR integer arithmetic detected
-    -i; //~ERROR integer arithmetic detected
+    i - 2 + 2 - i;
+    -i;
 
     i & 1; // no wrapping
     i | 1;
@@ -20,11 +20,11 @@ fn main() {
 
     let f = 1.0f32;
 
-    f * 2.0; //~ERROR floating-point arithmetic detected
+    f * 2.0;
 
-    1.0 + f; //~ERROR floating-point arithmetic detected
-    f * 2.0; //~ERROR floating-point arithmetic detected
-    f / 2.0; //~ERROR floating-point arithmetic detected
-    f - 2.0 * 4.2; //~ERROR floating-point arithmetic detected
-    -f; //~ERROR floating-point arithmetic detected
+    1.0 + f;
+    f * 2.0;
+    f / 2.0;
+    f - 2.0 * 4.2;
+    -f;
 }
index 1c333bfdccad3fc679a035a67c7a142439cadc5a..4f68b50ccbbb9c636a3c6369e4401abaac5dd9c8 100644 (file)
@@ -1,7 +1,7 @@
 error: integer arithmetic detected
  --> $DIR/arithmetic.rs:8:5
   |
-8 |     1 + i; //~ERROR integer arithmetic detected
+8 |     1 + i;
   |     ^^^^^
   |
 note: lint level defined here
@@ -13,13 +13,13 @@ note: lint level defined here
 error: integer arithmetic detected
  --> $DIR/arithmetic.rs:9:5
   |
-9 |     i * 2; //~ERROR integer arithmetic detected
+9 |     i * 2;
   |     ^^^^^
 
 error: integer arithmetic detected
   --> $DIR/arithmetic.rs:10:5
    |
-10 |       1 % //~ERROR integer arithmetic detected
+10 |       1 %
    |  _____^ starting here...
 11 | |     i / 2; // no error, this is part of the expression in the preceding line
    | |_________^ ...ending here
@@ -27,19 +27,19 @@ error: integer arithmetic detected
 error: integer arithmetic detected
   --> $DIR/arithmetic.rs:12:5
    |
-12 |     i - 2 + 2 - i; //~ERROR integer arithmetic detected
+12 |     i - 2 + 2 - i;
    |     ^^^^^^^^^^^^^
 
 error: integer arithmetic detected
   --> $DIR/arithmetic.rs:13:5
    |
-13 |     -i; //~ERROR integer arithmetic detected
+13 |     -i;
    |     ^^
 
 error: floating-point arithmetic detected
   --> $DIR/arithmetic.rs:23:5
    |
-23 |     f * 2.0; //~ERROR floating-point arithmetic detected
+23 |     f * 2.0;
    |     ^^^^^^^
    |
 note: lint level defined here
@@ -51,31 +51,31 @@ note: lint level defined here
 error: floating-point arithmetic detected
   --> $DIR/arithmetic.rs:25:5
    |
-25 |     1.0 + f; //~ERROR floating-point arithmetic detected
+25 |     1.0 + f;
    |     ^^^^^^^
 
 error: floating-point arithmetic detected
   --> $DIR/arithmetic.rs:26:5
    |
-26 |     f * 2.0; //~ERROR floating-point arithmetic detected
+26 |     f * 2.0;
    |     ^^^^^^^
 
 error: floating-point arithmetic detected
   --> $DIR/arithmetic.rs:27:5
    |
-27 |     f / 2.0; //~ERROR floating-point arithmetic detected
+27 |     f / 2.0;
    |     ^^^^^^^
 
 error: floating-point arithmetic detected
   --> $DIR/arithmetic.rs:28:5
    |
-28 |     f - 2.0 * 4.2; //~ERROR floating-point arithmetic detected
+28 |     f - 2.0 * 4.2;
    |     ^^^^^^^^^^^^^
 
 error: floating-point arithmetic detected
   --> $DIR/arithmetic.rs:29:5
    |
-29 |     -f; //~ERROR floating-point arithmetic detected
+29 |     -f;
    |     ^^
 
 error: aborting due to 11 previous errors
index c69144fe292045106ba9c8f6c7296839840768aa..28b4c78b4448c2bf1c6e4da76bd58dbc589d99f0 100644 (file)
@@ -9,37 +9,37 @@ fn main() {
     let x = [1,2,3,4];
     x[0];
     x[3];
-    x[4]; //~ERROR: const index is out of bounds
-    x[1 << 3]; //~ERROR: const index is out of bounds
-    &x[1..5]; //~ERROR: range is out of bounds
+    x[4];
+    x[1 << 3];
+    &x[1..5];
     &x[0..3];
-    &x[0...4]; //~ERROR: range is out of bounds
-    &x[...4]; //~ERROR: range is out of bounds
+    &x[0...4];
+    &x[...4];
     &x[..];
     &x[1..];
     &x[4..];
-    &x[5..]; //~ERROR: range is out of bounds
+    &x[5..];
     &x[..4];
-    &x[..5]; //~ERROR: range is out of bounds
+    &x[..5];
 
     let y = &x;
-    y[0]; //~ERROR: indexing may panic
-    &y[1..2]; //~ERROR: slicing may panic
+    y[0];
+    &y[1..2];
     &y[..];
-    &y[0...4]; //~ERROR: slicing may panic
-    &y[...4]; //~ERROR: slicing may panic
+    &y[0...4];
+    &y[...4];
 
     let empty: [i8; 0] = [];
-    empty[0]; //~ERROR: const index is out of bounds
-    &empty[1..5]; //~ERROR: range is out of bounds
-    &empty[0...4]; //~ERROR: range is out of bounds
-    &empty[...4]; //~ERROR: range is out of bounds
+    empty[0];
+    &empty[1..5];
+    &empty[0...4];
+    &empty[...4];
     &empty[..];
     &empty[0..];
     &empty[0..0];
-    &empty[0...0]; //~ERROR: range is out of bounds
-    &empty[...0]; //~ERROR: range is out of bounds
+    &empty[0...0];
+    &empty[...0];
     &empty[..0];
-    &empty[1..]; //~ERROR: range is out of bounds
-    &empty[..4]; //~ERROR: range is out of bounds
+    &empty[1..];
+    &empty[..4];
 }
index 3eba56d35f867bb6d6ca15145adfacce0617160c..0650866ccdb64535f968b93bc68ca54fb1564790 100644 (file)
@@ -1,7 +1,7 @@
 error: const index is out of bounds
   --> $DIR/array_indexing.rs:12:5
    |
-12 |     x[4]; //~ERROR: const index is out of bounds
+12 |     x[4];
    |     ^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -9,7 +9,7 @@ error: const index is out of bounds
 error: const index is out of bounds
   --> $DIR/array_indexing.rs:13:5
    |
-13 |     x[1 << 3]; //~ERROR: const index is out of bounds
+13 |     x[1 << 3];
    |     ^^^^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -17,7 +17,7 @@ error: const index is out of bounds
 error: range is out of bounds
   --> $DIR/array_indexing.rs:14:6
    |
-14 |     &x[1..5]; //~ERROR: range is out of bounds
+14 |     &x[1..5];
    |      ^^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -25,7 +25,7 @@ error: range is out of bounds
 error: range is out of bounds
   --> $DIR/array_indexing.rs:16:6
    |
-16 |     &x[0...4]; //~ERROR: range is out of bounds
+16 |     &x[0...4];
    |      ^^^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -33,7 +33,7 @@ error: range is out of bounds
 error: range is out of bounds
   --> $DIR/array_indexing.rs:17:6
    |
-17 |     &x[...4]; //~ERROR: range is out of bounds
+17 |     &x[...4];
    |      ^^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -41,7 +41,7 @@ error: range is out of bounds
 error: range is out of bounds
   --> $DIR/array_indexing.rs:21:6
    |
-21 |     &x[5..]; //~ERROR: range is out of bounds
+21 |     &x[5..];
    |      ^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -49,7 +49,7 @@ error: range is out of bounds
 error: range is out of bounds
   --> $DIR/array_indexing.rs:23:6
    |
-23 |     &x[..5]; //~ERROR: range is out of bounds
+23 |     &x[..5];
    |      ^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -57,7 +57,7 @@ error: range is out of bounds
 error: indexing may panic
   --> $DIR/array_indexing.rs:26:5
    |
-26 |     y[0]; //~ERROR: indexing may panic
+26 |     y[0];
    |     ^^^^
    |
 note: lint level defined here
@@ -69,25 +69,25 @@ note: lint level defined here
 error: slicing may panic
   --> $DIR/array_indexing.rs:27:6
    |
-27 |     &y[1..2]; //~ERROR: slicing may panic
+27 |     &y[1..2];
    |      ^^^^^^^
 
 error: slicing may panic
   --> $DIR/array_indexing.rs:29:6
    |
-29 |     &y[0...4]; //~ERROR: slicing may panic
+29 |     &y[0...4];
    |      ^^^^^^^^
 
 error: slicing may panic
   --> $DIR/array_indexing.rs:30:6
    |
-30 |     &y[...4]; //~ERROR: slicing may panic
+30 |     &y[...4];
    |      ^^^^^^^
 
 error: const index is out of bounds
   --> $DIR/array_indexing.rs:33:5
    |
-33 |     empty[0]; //~ERROR: const index is out of bounds
+33 |     empty[0];
    |     ^^^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -95,7 +95,7 @@ error: const index is out of bounds
 error: range is out of bounds
   --> $DIR/array_indexing.rs:34:6
    |
-34 |     &empty[1..5]; //~ERROR: range is out of bounds
+34 |     &empty[1..5];
    |      ^^^^^^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -103,7 +103,7 @@ error: range is out of bounds
 error: range is out of bounds
   --> $DIR/array_indexing.rs:35:6
    |
-35 |     &empty[0...4]; //~ERROR: range is out of bounds
+35 |     &empty[0...4];
    |      ^^^^^^^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -111,7 +111,7 @@ error: range is out of bounds
 error: range is out of bounds
   --> $DIR/array_indexing.rs:36:6
    |
-36 |     &empty[...4]; //~ERROR: range is out of bounds
+36 |     &empty[...4];
    |      ^^^^^^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -119,7 +119,7 @@ error: range is out of bounds
 error: range is out of bounds
   --> $DIR/array_indexing.rs:40:6
    |
-40 |     &empty[0...0]; //~ERROR: range is out of bounds
+40 |     &empty[0...0];
    |      ^^^^^^^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -127,7 +127,7 @@ error: range is out of bounds
 error: range is out of bounds
   --> $DIR/array_indexing.rs:41:6
    |
-41 |     &empty[...0]; //~ERROR: range is out of bounds
+41 |     &empty[...0];
    |      ^^^^^^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -135,7 +135,7 @@ error: range is out of bounds
 error: range is out of bounds
   --> $DIR/array_indexing.rs:43:6
    |
-43 |     &empty[1..]; //~ERROR: range is out of bounds
+43 |     &empty[1..];
    |      ^^^^^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
@@ -143,7 +143,7 @@ error: range is out of bounds
 error: range is out of bounds
   --> $DIR/array_indexing.rs:44:6
    |
-44 |     &empty[..4]; //~ERROR: range is out of bounds
+44 |     &empty[..4];
    |      ^^^^^^^^^^
    |
    = note: #[deny(out_of_bounds_indexing)] on by default
index 2b69e110f43d7749dc9e3d93d5c4053051428c81..78f9dc0d0344af9a89982779e2c4460398e31e5f 100644 (file)
@@ -5,77 +5,77 @@
 #[allow(unused_assignments)]
 fn main() {
     let mut i = 1i32;
-    i += 2; //~ ERROR assign operation detected
-    //~^ HELP replace it with
-    //~| SUGGESTION i = i + 2
-    i += 2 + 17; //~ ERROR assign operation detected
-    //~^ HELP replace it with
-    //~| SUGGESTION i = i + 2 + 17
-    i -= 6; //~ ERROR assign operation detected
-    //~^ HELP replace it with
-    //~| SUGGESTION i = i - 6
+    i += 2;
+
+
+    i += 2 + 17;
+
+
+    i -= 6;
+
+
     i -= 2 - 1;
-    //~^ ERROR assign operation detected
-    //~| HELP replace it with
-    //~| SUGGESTION i = i - (2 - 1)
-    i *= 5; //~ ERROR assign operation detected
-    //~^ HELP replace it with
-    //~| SUGGESTION i = i * 5
-    i *= 1+5; //~ ERROR assign operation detected
-    //~^ HELP replace it with
-    //~| SUGGESTION i = i * (1+5)
-    i /= 32; //~ ERROR assign operation detected
-    //~^ HELP replace it with
-    //~| SUGGESTION i = i / 32
-    i /= 32 | 5; //~ ERROR assign operation detected
-    //~^ HELP replace it with
-    //~| SUGGESTION i = i / (32 | 5)
-    i /= 32 / 5; //~ ERROR assign operation detected
-    //~^ HELP replace it with
-    //~| SUGGESTION i = i / (32 / 5)
-    i %= 42; //~ ERROR assign operation detected
-    //~^ HELP replace it with
-    //~| SUGGESTION i = i % 42
-    i >>= i; //~ ERROR assign operation detected
-    //~^ HELP replace it with
-    //~| SUGGESTION i = i >> i
-    i <<= 9 + 6 - 7; //~ ERROR assign operation detected
-    //~^ HELP replace it with
-    //~| SUGGESTION i = i << (9 + 6 - 7)
+
+
+
+    i *= 5;
+
+
+    i *= 1+5;
+
+
+    i /= 32;
+
+
+    i /= 32 | 5;
+
+
+    i /= 32 / 5;
+
+
+    i %= 42;
+
+
+    i >>= i;
+
+
+    i <<= 9 + 6 - 7;
+
+
     i += 1 << 5;
-    //~^ ERROR assign operation detected
-    //~| HELP replace it with
-    //~| SUGGESTION i = i + (1 << 5)
+
+
+
 }
 
 #[allow(dead_code, unused_assignments)]
 #[deny(assign_op_pattern)]
 fn bla() {
     let mut a = 5;
-    a = a + 1; //~ ERROR manual implementation of an assign operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a += 1
-    a = 1 + a; //~ ERROR manual implementation of an assign operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a += 1
-    a = a - 1; //~ ERROR manual implementation of an assign operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a -= 1
-    a = a * 99; //~ ERROR manual implementation of an assign operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a *= 99
-    a = 42 * a; //~ ERROR manual implementation of an assign operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a *= 42
-    a = a / 2; //~ ERROR manual implementation of an assign operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a /= 2
-    a = a % 5; //~ ERROR manual implementation of an assign operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a %= 5
-    a = a & 1; //~ ERROR manual implementation of an assign operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a &= 1
+    a = a + 1;
+
+
+    a = 1 + a;
+
+
+    a = a - 1;
+
+
+    a = a * 99;
+
+
+    a = 42 * a;
+
+
+    a = a / 2;
+
+
+    a = a % 5;
+
+
+    a = a & 1;
+
+
     a = 1 - a;
     a = 5 / a;
     a = 42 % a;
index 61efd362a801fb4e3be8b2af645fd785be259828..8ce2ae375f362e543c5bc0a05fa392e414446eba 100644 (file)
@@ -1,7 +1,7 @@
 error: assign operation detected
  --> $DIR/assign_ops.rs:8:5
   |
-8 |     i += 2; //~ ERROR assign operation detected
+8 |     i += 2;
   |     ^^^^^^
   |
 note: lint level defined here
@@ -10,25 +10,25 @@ note: lint level defined here
 4 | #[deny(assign_ops)]
   |        ^^^^^^^^^^
 help: replace it with
-  |     i = i + 2; //~ ERROR assign operation detected
+  |     i = i + 2;
 
 error: assign operation detected
   --> $DIR/assign_ops.rs:11:5
    |
-11 |     i += 2 + 17; //~ ERROR assign operation detected
+11 |     i += 2 + 17;
    |     ^^^^^^^^^^^
    |
 help: replace it with
-   |     i = i + 2 + 17; //~ ERROR assign operation detected
+   |     i = i + 2 + 17;
 
 error: assign operation detected
   --> $DIR/assign_ops.rs:14:5
    |
-14 |     i -= 6; //~ ERROR assign operation detected
+14 |     i -= 6;
    |     ^^^^^^
    |
 help: replace it with
-   |     i = i - 6; //~ ERROR assign operation detected
+   |     i = i - 6;
 
 error: assign operation detected
   --> $DIR/assign_ops.rs:17:5
@@ -42,74 +42,74 @@ help: replace it with
 error: assign operation detected
   --> $DIR/assign_ops.rs:21:5
    |
-21 |     i *= 5; //~ ERROR assign operation detected
+21 |     i *= 5;
    |     ^^^^^^
    |
 help: replace it with
-   |     i = i * 5; //~ ERROR assign operation detected
+   |     i = i * 5;
 
 error: assign operation detected
   --> $DIR/assign_ops.rs:24:5
    |
-24 |     i *= 1+5; //~ ERROR assign operation detected
+24 |     i *= 1+5;
    |     ^^^^^^^^
    |
 help: replace it with
-   |     i = i * (1+5); //~ ERROR assign operation detected
+   |     i = i * (1+5);
 
 error: assign operation detected
   --> $DIR/assign_ops.rs:27:5
    |
-27 |     i /= 32; //~ ERROR assign operation detected
+27 |     i /= 32;
    |     ^^^^^^^
    |
 help: replace it with
-   |     i = i / 32; //~ ERROR assign operation detected
+   |     i = i / 32;
 
 error: assign operation detected
   --> $DIR/assign_ops.rs:30:5
    |
-30 |     i /= 32 | 5; //~ ERROR assign operation detected
+30 |     i /= 32 | 5;
    |     ^^^^^^^^^^^
    |
 help: replace it with
-   |     i = i / (32 | 5); //~ ERROR assign operation detected
+   |     i = i / (32 | 5);
 
 error: assign operation detected
   --> $DIR/assign_ops.rs:33:5
    |
-33 |     i /= 32 / 5; //~ ERROR assign operation detected
+33 |     i /= 32 / 5;
    |     ^^^^^^^^^^^
    |
 help: replace it with
-   |     i = i / (32 / 5); //~ ERROR assign operation detected
+   |     i = i / (32 / 5);
 
 error: assign operation detected
   --> $DIR/assign_ops.rs:36:5
    |
-36 |     i %= 42; //~ ERROR assign operation detected
+36 |     i %= 42;
    |     ^^^^^^^
    |
 help: replace it with
-   |     i = i % 42; //~ ERROR assign operation detected
+   |     i = i % 42;
 
 error: assign operation detected
   --> $DIR/assign_ops.rs:39:5
    |
-39 |     i >>= i; //~ ERROR assign operation detected
+39 |     i >>= i;
    |     ^^^^^^^
    |
 help: replace it with
-   |     i = i >> i; //~ ERROR assign operation detected
+   |     i = i >> i;
 
 error: assign operation detected
   --> $DIR/assign_ops.rs:42:5
    |
-42 |     i <<= 9 + 6 - 7; //~ ERROR assign operation detected
+42 |     i <<= 9 + 6 - 7;
    |     ^^^^^^^^^^^^^^^
    |
 help: replace it with
-   |     i = i << (9 + 6 - 7); //~ ERROR assign operation detected
+   |     i = i << (9 + 6 - 7);
 
 error: assign operation detected
   --> $DIR/assign_ops.rs:45:5
@@ -123,7 +123,7 @@ help: replace it with
 error: manual implementation of an assign operation
   --> $DIR/assign_ops.rs:55:5
    |
-55 |     a = a + 1; //~ ERROR manual implementation of an assign operation
+55 |     a = a + 1;
    |     ^^^^^^^^^
    |
 note: lint level defined here
@@ -132,70 +132,70 @@ note: lint level defined here
 52 | #[deny(assign_op_pattern)]
    |        ^^^^^^^^^^^^^^^^^
 help: replace it with
-   |     a += 1; //~ ERROR manual implementation of an assign operation
+   |     a += 1;
 
 error: manual implementation of an assign operation
   --> $DIR/assign_ops.rs:58:5
    |
-58 |     a = 1 + a; //~ ERROR manual implementation of an assign operation
+58 |     a = 1 + a;
    |     ^^^^^^^^^
    |
 help: replace it with
-   |     a += 1; //~ ERROR manual implementation of an assign operation
+   |     a += 1;
 
 error: manual implementation of an assign operation
   --> $DIR/assign_ops.rs:61:5
    |
-61 |     a = a - 1; //~ ERROR manual implementation of an assign operation
+61 |     a = a - 1;
    |     ^^^^^^^^^
    |
 help: replace it with
-   |     a -= 1; //~ ERROR manual implementation of an assign operation
+   |     a -= 1;
 
 error: manual implementation of an assign operation
   --> $DIR/assign_ops.rs:64:5
    |
-64 |     a = a * 99; //~ ERROR manual implementation of an assign operation
+64 |     a = a * 99;
    |     ^^^^^^^^^^
    |
 help: replace it with
-   |     a *= 99; //~ ERROR manual implementation of an assign operation
+   |     a *= 99;
 
 error: manual implementation of an assign operation
   --> $DIR/assign_ops.rs:67:5
    |
-67 |     a = 42 * a; //~ ERROR manual implementation of an assign operation
+67 |     a = 42 * a;
    |     ^^^^^^^^^^
    |
 help: replace it with
-   |     a *= 42; //~ ERROR manual implementation of an assign operation
+   |     a *= 42;
 
 error: manual implementation of an assign operation
   --> $DIR/assign_ops.rs:70:5
    |
-70 |     a = a / 2; //~ ERROR manual implementation of an assign operation
+70 |     a = a / 2;
    |     ^^^^^^^^^
    |
 help: replace it with
-   |     a /= 2; //~ ERROR manual implementation of an assign operation
+   |     a /= 2;
 
 error: manual implementation of an assign operation
   --> $DIR/assign_ops.rs:73:5
    |
-73 |     a = a % 5; //~ ERROR manual implementation of an assign operation
+73 |     a = a % 5;
    |     ^^^^^^^^^
    |
 help: replace it with
-   |     a %= 5; //~ ERROR manual implementation of an assign operation
+   |     a %= 5;
 
 error: manual implementation of an assign operation
   --> $DIR/assign_ops.rs:76:5
    |
-76 |     a = a & 1; //~ ERROR manual implementation of an assign operation
+76 |     a = a & 1;
    |     ^^^^^^^^^
    |
 help: replace it with
-   |     a &= 1; //~ ERROR manual implementation of an assign operation
+   |     a &= 1;
 
 error: aborting due to 21 previous errors
 
index e8549c01bc93268c7d4ff431a017150f3b14249b..3071cce161cc73d3fcc66ab602b5383a5c1eb061 100644 (file)
@@ -5,30 +5,30 @@
 #[deny(misrefactored_assign_op)]
 fn main() {
     let mut a = 5;
-    a += a + 1; //~ ERROR variable appears on both sides of an assignment operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a += 1
-    a += 1 + a; //~ ERROR variable appears on both sides of an assignment operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a += 1
-    a -= a - 1; //~ ERROR variable appears on both sides of an assignment operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a -= 1
-    a *= a * 99; //~ ERROR variable appears on both sides of an assignment operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a *= 99
-    a *= 42 * a; //~ ERROR variable appears on both sides of an assignment operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a *= 42
-    a /= a / 2; //~ ERROR variable appears on both sides of an assignment operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a /= 2
-    a %= a % 5; //~ ERROR variable appears on both sides of an assignment operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a %= 5
-    a &= a & 1; //~ ERROR variable appears on both sides of an assignment operation
-    //~^ HELP replace it with
-    //~| SUGGESTION a &= 1
+    a += a + 1;
+
+
+    a += 1 + a;
+
+
+    a -= a - 1;
+
+
+    a *= a * 99;
+
+
+    a *= 42 * a;
+
+
+    a /= a / 2;
+
+
+    a %= a % 5;
+
+
+    a &= a & 1;
+
+
     a -= 1 - a;
     a /= 5 / a;
     a %= 42 % a;
index 98968fe8d2bf03c8fd3bfc1df755980e995255df..ded39d1efc7437cc47f8ae84791e36fb4cdb7ef6 100644 (file)
@@ -1,7 +1,7 @@
 error: variable appears on both sides of an assignment operation
  --> $DIR/assign_ops2.rs:8:5
   |
-8 |     a += a + 1; //~ ERROR variable appears on both sides of an assignment operation
+8 |     a += a + 1;
   |     ^^^^^^^^^^
   |
 note: lint level defined here
@@ -10,70 +10,70 @@ note: lint level defined here
 5 | #[deny(misrefactored_assign_op)]
   |        ^^^^^^^^^^^^^^^^^^^^^^^
 help: replace it with
-  |     a += 1; //~ ERROR variable appears on both sides of an assignment operation
+  |     a += 1;
 
 error: variable appears on both sides of an assignment operation
   --> $DIR/assign_ops2.rs:11:5
    |
-11 |     a += 1 + a; //~ ERROR variable appears on both sides of an assignment operation
+11 |     a += 1 + a;
    |     ^^^^^^^^^^
    |
 help: replace it with
-   |     a += 1; //~ ERROR variable appears on both sides of an assignment operation
+   |     a += 1;
 
 error: variable appears on both sides of an assignment operation
   --> $DIR/assign_ops2.rs:14:5
    |
-14 |     a -= a - 1; //~ ERROR variable appears on both sides of an assignment operation
+14 |     a -= a - 1;
    |     ^^^^^^^^^^
    |
 help: replace it with
-   |     a -= 1; //~ ERROR variable appears on both sides of an assignment operation
+   |     a -= 1;
 
 error: variable appears on both sides of an assignment operation
   --> $DIR/assign_ops2.rs:17:5
    |
-17 |     a *= a * 99; //~ ERROR variable appears on both sides of an assignment operation
+17 |     a *= a * 99;
    |     ^^^^^^^^^^^
    |
 help: replace it with
-   |     a *= 99; //~ ERROR variable appears on both sides of an assignment operation
+   |     a *= 99;
 
 error: variable appears on both sides of an assignment operation
   --> $DIR/assign_ops2.rs:20:5
    |
-20 |     a *= 42 * a; //~ ERROR variable appears on both sides of an assignment operation
+20 |     a *= 42 * a;
    |     ^^^^^^^^^^^
    |
 help: replace it with
-   |     a *= 42; //~ ERROR variable appears on both sides of an assignment operation
+   |     a *= 42;
 
 error: variable appears on both sides of an assignment operation
   --> $DIR/assign_ops2.rs:23:5
    |
-23 |     a /= a / 2; //~ ERROR variable appears on both sides of an assignment operation
+23 |     a /= a / 2;
    |     ^^^^^^^^^^
    |
 help: replace it with
-   |     a /= 2; //~ ERROR variable appears on both sides of an assignment operation
+   |     a /= 2;
 
 error: variable appears on both sides of an assignment operation
   --> $DIR/assign_ops2.rs:26:5
    |
-26 |     a %= a % 5; //~ ERROR variable appears on both sides of an assignment operation
+26 |     a %= a % 5;
    |     ^^^^^^^^^^
    |
 help: replace it with
-   |     a %= 5; //~ ERROR variable appears on both sides of an assignment operation
+   |     a %= 5;
 
 error: variable appears on both sides of an assignment operation
   --> $DIR/assign_ops2.rs:29:5
    |
-29 |     a &= a & 1; //~ ERROR variable appears on both sides of an assignment operation
+29 |     a &= a & 1;
    |     ^^^^^^^^^^
    |
 help: replace it with
-   |     a &= 1; //~ ERROR variable appears on both sides of an assignment operation
+   |     a &= 1;
 
 error: aborting due to 8 previous errors
 
index 314602b2b0bf7bfe12f1208104a30300734fa277..50dddb83847e2463c627575cd7bc7379e7c9f3d1 100644 (file)
@@ -3,7 +3,7 @@
 
 #![deny(inline_always, deprecated_semver)]
 
-#[inline(always)] //~ERROR you have declared `#[inline(always)]` on `test_attr_lint`.
+#[inline(always)]
 fn test_attr_lint() {
     assert!(true)
 }
@@ -24,10 +24,10 @@ fn empty_and_false_positive_stmt() {
     unreachable!();
 }
 
-#[deprecated(since = "forever")] //~ERROR the since field must contain a semver-compliant version
+#[deprecated(since = "forever")]
 pub const SOME_CONST : u8 = 42;
 
-#[deprecated(since = "1")] //~ERROR the since field must contain a semver-compliant version
+#[deprecated(since = "1")]
 pub const ANOTHER_CONST : u8 = 23;
 
 #[deprecated(since = "0.1.1")]
index 411da0e22de78fb0b35b87310a55d245aa9789da..4ea0c5eece015da2d33f6a5408a394872bbe3c3b 100644 (file)
@@ -1,7 +1,7 @@
 error: you have declared `#[inline(always)]` on `test_attr_lint`. This is usually a bad idea
  --> $DIR/attrs.rs:6:1
   |
-6 | #[inline(always)] //~ERROR you have declared `#[inline(always)]` on `test_attr_lint`.
+6 | #[inline(always)]
   | ^^^^^^^^^^^^^^^^^
   |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: the since field must contain a semver-compliant version
   --> $DIR/attrs.rs:27:14
    |
-27 | #[deprecated(since = "forever")] //~ERROR the since field must contain a semver-compliant version
+27 | #[deprecated(since = "forever")]
    |              ^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -25,7 +25,7 @@ note: lint level defined here
 error: the since field must contain a semver-compliant version
   --> $DIR/attrs.rs:30:14
    |
-30 | #[deprecated(since = "1")] //~ERROR the since field must contain a semver-compliant version
+30 | #[deprecated(since = "1")]
    |              ^^^^^^^^^^^
 
 error: aborting due to 3 previous errors
index 79772840c73dbfb8977482857f8e0cb901acda79..e8f2e47b283cdb2ceabe8bad1dcd13102d7b35a4 100644 (file)
@@ -9,36 +9,36 @@
 fn main() {
     let x = 5;
 
-    x & 0 == 0; //~ERROR &-masking with zero
+    x & 0 == 0;
     x & 1 == 1; //ok, distinguishes bit 0
     x & 1 == 0; //ok, compared with zero
-    x & 2 == 1; //~ERROR incompatible bit mask
+    x & 2 == 1;
     x | 0 == 0; //ok, equals x == 0 (maybe warn?)
     x | 1 == 3; //ok, equals x == 2 || x == 3
     x | 3 == 3; //ok, equals x <= 3
-    x | 3 == 2; //~ERROR incompatible bit mask
+    x | 3 == 2;
 
-    x & 1 > 1; //~ERROR incompatible bit mask
+    x & 1 > 1;
     x & 2 > 1; // ok, distinguishes x & 2 == 2 from x & 2 == 0
     x & 2 < 1; // ok, distinguishes x & 2 == 2 from x & 2 == 0
     x | 1 > 1; // ok (if a bit silly), equals x > 1
-    x | 2 > 1; //~ERROR incompatible bit mask
+    x | 2 > 1;
     x | 2 <= 2; // ok (if a bit silly), equals x <= 2
 
     x & 192 == 128; // ok, tests for bit 7 and not bit 6
     x & 0xffc0 == 0xfe80; // ok
 
     // this also now works with constants
-    x & THREE_BITS == 8; //~ERROR incompatible bit mask
-    x | EVEN_MORE_REDIRECTION < 7; //~ERROR incompatible bit mask
+    x & THREE_BITS == 8;
+    x | EVEN_MORE_REDIRECTION < 7;
 
-    0 & x == 0; //~ERROR &-masking with zero
+    0 & x == 0;
     1 | x > 1;
 
     // and should now also match uncommon usage
-    1 < 2 | x; //~ERROR incompatible bit mask
-    2 == 3 | x; //~ERROR incompatible bit mask
-    1 == x & 2; //~ERROR incompatible bit mask
+    1 < 2 | x;
+    2 == 3 | x;
+    1 == x & 2;
 
     x | 1 > 2; // no error, because we allowed ineffective bit masks
     ineffective();
@@ -49,10 +49,10 @@ fn main() {
 fn ineffective() {
     let x = 5;
 
-    x | 1 > 3; //~ERROR ineffective bit mask
-    x | 1 < 4; //~ERROR ineffective bit mask
-    x | 1 <= 3; //~ERROR ineffective bit mask
-    x | 1 >= 8; //~ERROR ineffective bit mask
+    x | 1 > 3;
+    x | 1 < 4;
+    x | 1 <= 3;
+    x | 1 >= 8;
 
     x | 1 > 2; // not an error (yet), better written as x >= 2
     x | 1 >= 7; // not an error (yet), better written as x >= 6
index b8e63cef20ae5364e7dad286d5aba99c36462c5e..cba88f2827bd26aedfa38195225d60f0a6279735 100644 (file)
@@ -1,7 +1,7 @@
 error: &-masking with zero
   --> $DIR/bit_masks.rs:12:5
    |
-12 |     x & 0 == 0; //~ERROR &-masking with zero
+12 |     x & 0 == 0;
    |     ^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,67 +13,67 @@ note: lint level defined here
 error: incompatible bit mask: `_ & 2` can never be equal to `1`
   --> $DIR/bit_masks.rs:15:5
    |
-15 |     x & 2 == 1; //~ERROR incompatible bit mask
+15 |     x & 2 == 1;
    |     ^^^^^^^^^^
 
 error: incompatible bit mask: `_ | 3` can never be equal to `2`
   --> $DIR/bit_masks.rs:19:5
    |
-19 |     x | 3 == 2; //~ERROR incompatible bit mask
+19 |     x | 3 == 2;
    |     ^^^^^^^^^^
 
 error: incompatible bit mask: `_ & 1` will never be higher than `1`
   --> $DIR/bit_masks.rs:21:5
    |
-21 |     x & 1 > 1; //~ERROR incompatible bit mask
+21 |     x & 1 > 1;
    |     ^^^^^^^^^
 
 error: incompatible bit mask: `_ | 2` will always be higher than `1`
   --> $DIR/bit_masks.rs:25:5
    |
-25 |     x | 2 > 1; //~ERROR incompatible bit mask
+25 |     x | 2 > 1;
    |     ^^^^^^^^^
 
 error: incompatible bit mask: `_ & 7` can never be equal to `8`
   --> $DIR/bit_masks.rs:32:5
    |
-32 |     x & THREE_BITS == 8; //~ERROR incompatible bit mask
+32 |     x & THREE_BITS == 8;
    |     ^^^^^^^^^^^^^^^^^^^
 
 error: incompatible bit mask: `_ | 7` will never be lower than `7`
   --> $DIR/bit_masks.rs:33:5
    |
-33 |     x | EVEN_MORE_REDIRECTION < 7; //~ERROR incompatible bit mask
+33 |     x | EVEN_MORE_REDIRECTION < 7;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: &-masking with zero
   --> $DIR/bit_masks.rs:35:5
    |
-35 |     0 & x == 0; //~ERROR &-masking with zero
+35 |     0 & x == 0;
    |     ^^^^^^^^^^
 
 error: incompatible bit mask: `_ | 2` will always be higher than `1`
   --> $DIR/bit_masks.rs:39:5
    |
-39 |     1 < 2 | x; //~ERROR incompatible bit mask
+39 |     1 < 2 | x;
    |     ^^^^^^^^^
 
 error: incompatible bit mask: `_ | 3` can never be equal to `2`
   --> $DIR/bit_masks.rs:40:5
    |
-40 |     2 == 3 | x; //~ERROR incompatible bit mask
+40 |     2 == 3 | x;
    |     ^^^^^^^^^^
 
 error: incompatible bit mask: `_ & 2` can never be equal to `1`
   --> $DIR/bit_masks.rs:41:5
    |
-41 |     1 == x & 2; //~ERROR incompatible bit mask
+41 |     1 == x & 2;
    |     ^^^^^^^^^^
 
 error: ineffective bit mask: `x | 1` compared to `3`, is the same as x compared directly
   --> $DIR/bit_masks.rs:52:5
    |
-52 |     x | 1 > 3; //~ERROR ineffective bit mask
+52 |     x | 1 > 3;
    |     ^^^^^^^^^
    |
 note: lint level defined here
@@ -85,19 +85,19 @@ note: lint level defined here
 error: ineffective bit mask: `x | 1` compared to `4`, is the same as x compared directly
   --> $DIR/bit_masks.rs:53:5
    |
-53 |     x | 1 < 4; //~ERROR ineffective bit mask
+53 |     x | 1 < 4;
    |     ^^^^^^^^^
 
 error: ineffective bit mask: `x | 1` compared to `3`, is the same as x compared directly
   --> $DIR/bit_masks.rs:54:5
    |
-54 |     x | 1 <= 3; //~ERROR ineffective bit mask
+54 |     x | 1 <= 3;
    |     ^^^^^^^^^^
 
 error: ineffective bit mask: `x | 1` compared to `8`, is the same as x compared directly
   --> $DIR/bit_masks.rs:55:5
    |
-55 |     x | 1 >= 8; //~ERROR ineffective bit mask
+55 |     x | 1 >= 8;
    |     ^^^^^^^^^^
 
 error: aborting due to 15 previous errors
index 1afcd94a0b1d43a75e69561b7d096887a2bb5021..16b4240fac2d3452a52f45ae311cd15f9d334ebe 100644 (file)
@@ -6,21 +6,21 @@
 #![allow(unused_variables, similar_names)]
 #![deny(blacklisted_name)]
 
-fn test(foo: ()) {} //~ERROR use of a blacklisted/placeholder name `foo`
+fn test(foo: ()) {}
 
 fn main() {
-    let foo = 42; //~ERROR use of a blacklisted/placeholder name `foo`
-    let bar = 42; //~ERROR use of a blacklisted/placeholder name `bar`
-    let baz = 42; //~ERROR use of a blacklisted/placeholder name `baz`
+    let foo = 42;
+    let bar = 42;
+    let baz = 42;
 
     let barb = 42;
     let barbaric = 42;
 
     match (42, Some(1337), Some(0)) {
         (foo, Some(bar), baz @ Some(_)) => (),
-        //~^ ERROR use of a blacklisted/placeholder name `foo`
-        //~| ERROR use of a blacklisted/placeholder name `bar`
-        //~| ERROR use of a blacklisted/placeholder name `baz`
+
+
+
         _ => (),
     }
 }
index 055fb8836d78408c079de55fde946f3399ec56d0..29e9da2270f6027da161a4362a1e4d5bb2d2fc4e 100644 (file)
@@ -1,7 +1,7 @@
 error: use of a blacklisted/placeholder name `foo`
  --> $DIR/blacklisted_name.rs:9:9
   |
-9 | fn test(foo: ()) {} //~ERROR use of a blacklisted/placeholder name `foo`
+9 | fn test(foo: ()) {}
   |         ^^^
   |
 note: lint level defined here
@@ -13,19 +13,19 @@ note: lint level defined here
 error: use of a blacklisted/placeholder name `foo`
   --> $DIR/blacklisted_name.rs:12:9
    |
-12 |     let foo = 42; //~ERROR use of a blacklisted/placeholder name `foo`
+12 |     let foo = 42;
    |         ^^^
 
 error: use of a blacklisted/placeholder name `bar`
   --> $DIR/blacklisted_name.rs:13:9
    |
-13 |     let bar = 42; //~ERROR use of a blacklisted/placeholder name `bar`
+13 |     let bar = 42;
    |         ^^^
 
 error: use of a blacklisted/placeholder name `baz`
   --> $DIR/blacklisted_name.rs:14:9
    |
-14 |     let baz = 42; //~ERROR use of a blacklisted/placeholder name `baz`
+14 |     let baz = 42;
    |         ^^^
 
 error: use of a blacklisted/placeholder name `foo`
index 090c39abc9268aa1a3af0e728d8a9baf98e8d3b9..feb28e377970cd71e6f89d7a31b87829450c4232 100644 (file)
@@ -27,7 +27,7 @@ fn macro_if() {
 }
 
 fn condition_has_block() -> i32 {
-    if { //~ERROR in an 'if' condition, avoid complex blocks or closures with blocks;
+    if {
         let x = 3;
         x == 3
     } {
@@ -38,7 +38,7 @@ fn condition_has_block() -> i32 {
 }
 
 fn condition_has_block_with_single_expression() -> i32 {
-    if { true } { //~ERROR omit braces around single expression condition
+    if { true } {
         6
     } else {
         10
@@ -56,18 +56,18 @@ fn pred_test() {
     // inside a closure that the condition is using.  same principle applies.  add some extra
     // expressions to make sure linter isn't confused by them.
     if v == 3 && sky == "blue" && predicate(|x| { let target = 3; x == target }, v) {
-        //~^ERROR in an 'if' condition, avoid complex blocks or closures with blocks;
+
     }
 
     if predicate(|x| { let target = 3; x == target }, v) {
-        //~^ERROR in an 'if' condition, avoid complex blocks or closures with blocks;
+
     }
 
 }
 
 fn condition_is_normal() -> i32 {
     let x = 3;
-    if true && x == 3 { //~ WARN this boolean expression can be simplified
+    if true && x == 3 {
         6
     } else {
         10
index be63b4a7430a7ce734ef37d39df76899cde1374a..d3e869024a7d1f07b9714ce9650517ae7fcfb990 100644 (file)
@@ -1,7 +1,7 @@
 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'
   --> $DIR/block_in_if_condition.rs:30:8
    |
-30 |       if { //~ERROR in an 'if' condition, avoid complex blocks or closures with blocks;
+30 |       if {
    |  ________^ starting here...
 31 | |         let x = 3;
 32 | |         x == 3
@@ -14,7 +14,7 @@ note: lint level defined here
 5  | #![deny(block_in_if_condition_stmt)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: try
-           let res = { //~ERROR in an 'if' condition, avoid complex blocks or closures with blocks;
+           let res = {
                let x = 3;
                x == 3
            };
@@ -25,7 +25,7 @@ note: lint level defined here
 error: omit braces around single expression condition
   --> $DIR/block_in_if_condition.rs:41:8
    |
-41 |     if { true } { //~ERROR omit braces around single expression condition
+41 |     if { true } {
    |        ^^^^^^^^
    |
 note: lint level defined here
@@ -34,7 +34,7 @@ note: lint level defined here
 4  | #![deny(block_in_if_condition_expr)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: try
-           if true { //~ERROR omit braces around single expression condition
+           if true {
                6
            } ... 
 
@@ -53,7 +53,7 @@ error: in an 'if' condition, avoid complex blocks or closures with blocks; inste
 warning: this boolean expression can be simplified
   --> $DIR/block_in_if_condition.rs:70:8
    |
-70 |     if true && x == 3 { //~ WARN this boolean expression can be simplified
+70 |     if true && x == 3 {
    |        ^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -62,7 +62,7 @@ note: lint level defined here
 7  | #![warn(nonminimal_bool)]
    |         ^^^^^^^^^^^^^^^
 help: try
-   |     if x == 3 { //~ WARN this boolean expression can be simplified
+   |     if x == 3 {
 
 error: aborting due to 4 previous errors
 
index 836759455197f08d427d15e67b270f6c212902dd..3991d04bd2cc62f60701dd974f941332fdfeb9f7 100644 (file)
@@ -5,19 +5,19 @@
 fn main() {
     let x = true;
     if x == true { "yes" } else { "no" };
-    //~^ ERROR equality checks against true are unnecessary
-    //~| HELP try simplifying it as shown:
-    //~| SUGGESTION if x { "yes" } else { "no" };
+
+
+
     if x == false { "yes" } else { "no" };
-    //~^ ERROR equality checks against false can be replaced by a negation
-    //~| HELP try simplifying it as shown:
-    //~| SUGGESTION if !x { "yes" } else { "no" };
+
+
+
     if true == x { "yes" } else { "no" };
-    //~^ ERROR equality checks against true are unnecessary
-    //~| HELP try simplifying it as shown:
-    //~| SUGGESTION if x { "yes" } else { "no" };
+
+
+
     if false == x { "yes" } else { "no" };
-    //~^ ERROR equality checks against false can be replaced by a negation
-    //~| HELP try simplifying it as shown:
-    //~| SUGGESTION if !x { "yes" } else { "no" };
+
+
+
 }
index 193edebf3c4ffb8f37f5067a01120404bd43d9d1..fc1791f7f553b1fe8bd27faa21d8f93b74cf0ffc 100644 (file)
@@ -9,29 +9,29 @@ fn main() {
     let c: bool = unimplemented!();
     let d: bool = unimplemented!();
     let e: bool = unimplemented!();
-    let _ = a && b || a; //~ ERROR this boolean expression contains a logic bug
-    //~| HELP this expression can be optimized out
-    //~| HELP it would look like the following
-    //~| SUGGESTION let _ = a;
+    let _ = a && b || a;
+
+
+
     let _ = !(a && b);
-    let _ = !true; //~ ERROR this boolean expression can be simplified
-    //~| HELP try
-    //~| SUGGESTION let _ = false;
-    let _ = !false; //~ ERROR this boolean expression can be simplified
-    //~| HELP try
-    //~| SUGGESTION let _ = true;
-    let _ = !!a; //~ ERROR this boolean expression can be simplified
-    //~| HELP try
-    //~| SUGGESTION let _ = a;
-
-    let _ = false && a; //~ ERROR this boolean expression contains a logic bug
-    //~| HELP this expression can be optimized out
-    //~| HELP it would look like the following
-    //~| SUGGESTION let _ = false;
-
-    let _ = false || a; //~ ERROR this boolean expression can be simplified
-    //~| HELP try
-    //~| SUGGESTION let _ = a;
+    let _ = !true;
+
+
+    let _ = !false;
+
+
+    let _ = !!a;
+
+
+
+    let _ = false && a;
+
+
+
+
+    let _ = false || a;
+
+
 
     // don't lint on cfgs
     let _ = cfg!(you_shall_not_not_pass) && a;
@@ -40,9 +40,9 @@ fn main() {
 
     let _ = !(a && b || c);
 
-    let _ = !(!a && b); //~ ERROR this boolean expression can be simplified
-    //~| HELP try
-    //~| SUGGESTION let _ = !b || a;
+    let _ = !(!a && b);
+
+
 }
 
 #[allow(unused, many_single_char_names)]
@@ -53,38 +53,38 @@ fn equality_stuff() {
     let d: i32 = unimplemented!();
     let e: i32 = unimplemented!();
     let _ = a == b && a != b;
-    //~^ ERROR this boolean expression contains a logic bug
-    //~| HELP this expression can be optimized out
-    //~| HELP it would look like the following
-    //~| SUGGESTION let _ = false;
+
+
+
+
     let _ = a == b && c == 5 && a == b;
-    //~^ ERROR this boolean expression can be simplified
-    //~| HELP try
-    //~| SUGGESTION let _ = a == b && c == 5;
-    //~| HELP try
-    //~| SUGGESTION let _ = !(c != 5 || a != b);
+
+
+
+
+
     let _ = a == b && c == 5 && b == a;
-    //~^ ERROR this boolean expression can be simplified
-    //~| HELP try
-    //~| SUGGESTION let _ = a == b && c == 5;
-    //~| HELP try
-    //~| SUGGESTION let _ = !(c != 5 || a != b);
+
+
+
+
+
     let _ = a < b && a >= b;
-    //~^ ERROR this boolean expression contains a logic bug
-    //~| HELP this expression can be optimized out
-    //~| HELP it would look like the following
-    //~| SUGGESTION let _ = false;
+
+
+
+
     let _ = a > b && a <= b;
-    //~^ ERROR this boolean expression contains a logic bug
-    //~| HELP this expression can be optimized out
-    //~| HELP it would look like the following
-    //~| SUGGESTION let _ = false;
+
+
+
+
     let _ = a > b && a == b;
 
     let _ = a != b || !(a != b || c == d);
-    //~^ ERROR this boolean expression can be simplified
-    //~| HELP try
-    //~| SUGGESTION let _ = c != d || a != b;
-    //~| HELP try
-    //~| SUGGESTION let _ = !(a == b && c == d);
+
+
+
+
+
 }
index 9be511928b87da8b2c7d2acde1d811e0216eee56..54f6638b938c003d8e5460ca0d115340e8f551a0 100644 (file)
@@ -1,7 +1,7 @@
 error: this boolean expression contains a logic bug
   --> $DIR/booleans.rs:12:13
    |
-12 |     let _ = a && b || a; //~ ERROR this boolean expression contains a logic bug
+12 |     let _ = a && b || a;
    |             ^^^^^^^^^^^
    |
 note: lint level defined here
@@ -12,15 +12,15 @@ note: lint level defined here
 help: this expression can be optimized out by applying boolean operations to the outer expression
   --> $DIR/booleans.rs:12:18
    |
-12 |     let _ = a && b || a; //~ ERROR this boolean expression contains a logic bug
+12 |     let _ = a && b || a;
    |                  ^
 help: it would look like the following
-   |     let _ = a; //~ ERROR this boolean expression contains a logic bug
+   |     let _ = a;
 
 error: this boolean expression can be simplified
   --> $DIR/booleans.rs:17:13
    |
-17 |     let _ = !true; //~ ERROR this boolean expression can be simplified
+17 |     let _ = !true;
    |             ^^^^^
    |
 note: lint level defined here
@@ -29,57 +29,57 @@ note: lint level defined here
 3  | #![deny(nonminimal_bool, logic_bug)]
    |         ^^^^^^^^^^^^^^^
 help: try
-   |     let _ = false; //~ ERROR this boolean expression can be simplified
+   |     let _ = false;
 
 error: this boolean expression can be simplified
   --> $DIR/booleans.rs:20:13
    |
-20 |     let _ = !false; //~ ERROR this boolean expression can be simplified
+20 |     let _ = !false;
    |             ^^^^^^
    |
 help: try
-   |     let _ = true; //~ ERROR this boolean expression can be simplified
+   |     let _ = true;
 
 error: this boolean expression can be simplified
   --> $DIR/booleans.rs:23:13
    |
-23 |     let _ = !!a; //~ ERROR this boolean expression can be simplified
+23 |     let _ = !!a;
    |             ^^^
    |
 help: try
-   |     let _ = a; //~ ERROR this boolean expression can be simplified
+   |     let _ = a;
 
 error: this boolean expression contains a logic bug
   --> $DIR/booleans.rs:27:13
    |
-27 |     let _ = false && a; //~ ERROR this boolean expression contains a logic bug
+27 |     let _ = false && a;
    |             ^^^^^^^^^^
    |
 help: this expression can be optimized out by applying boolean operations to the outer expression
   --> $DIR/booleans.rs:27:22
    |
-27 |     let _ = false && a; //~ ERROR this boolean expression contains a logic bug
+27 |     let _ = false && a;
    |                      ^
 help: it would look like the following
-   |     let _ = false; //~ ERROR this boolean expression contains a logic bug
+   |     let _ = false;
 
 error: this boolean expression can be simplified
   --> $DIR/booleans.rs:32:13
    |
-32 |     let _ = false || a; //~ ERROR this boolean expression can be simplified
+32 |     let _ = false || a;
    |             ^^^^^^^^^^
    |
 help: try
-   |     let _ = a; //~ ERROR this boolean expression can be simplified
+   |     let _ = a;
 
 error: this boolean expression can be simplified
   --> $DIR/booleans.rs:43:13
    |
-43 |     let _ = !(!a && b); //~ ERROR this boolean expression can be simplified
+43 |     let _ = !(!a && b);
    |             ^^^^^^^^^^
    |
 help: try
-   |     let _ = !b || a; //~ ERROR this boolean expression can be simplified
+   |     let _ = !b || a;
 
 error: this boolean expression contains a logic bug
   --> $DIR/booleans.rs:55:13
index 071945a81b23c5d804780b54fc9e7042bed24b1a..01f1b1d09497985aaa2540d89b45ed2b6dadddf5 100644 (file)
@@ -14,7 +14,7 @@ macro_rules! boxit {
 fn test_macro() {
     boxit!(Vec::new(), Vec<u8>);
 }
-pub fn test(foo: Box<Vec<bool>>) { //~ ERROR you seem to be trying to use `Box<Vec<T>>`
+pub fn test(foo: Box<Vec<bool>>) {
     println!("{:?}", foo.get(0))
 }
 
index b5cc66b60c91ab5fe947503ac41907eef9c57cb8..a7ccf1dcd85e3b3f13d3406848bced2b4ed38819 100644 (file)
@@ -1,7 +1,7 @@
 error: you seem to be trying to use `Box<Vec<T>>`. Consider using just `Vec<T>`
   --> $DIR/box_vec.rs:17:18
    |
-17 | pub fn test(foo: Box<Vec<bool>>) { //~ ERROR you seem to be trying to use `Box<Vec<T>>`
+17 | pub fn test(foo: Box<Vec<bool>>) {
    |                  ^^^^^^^^^^^^^^
    |
    = note: #[deny(box_vec)] implied by #[deny(clippy)]
index 172875a6b9aacfe1df7c96a98c7432cd845e1718..bcf8a8dec71e93590597925af880f9f861dc4a8d 100644 (file)
@@ -2,8 +2,8 @@
 #![plugin(clippy)]
 #![deny(builtin_type_shadow)]
 
-fn foo<u32>(a: u32) -> u32 { //~ERROR shadows the built-in type `u32`
-    42  //~ERROR E0308
+fn foo<u32>(a: u32) -> u32 {
+    42
     // ^ rustc's type error
 }
 
index e3b6c68e8c23de699e627ece4ef559b060b63ae8..98cbd436686d0b55638f72501d3e416c03081da4 100644 (file)
@@ -1,7 +1,7 @@
 error: This generic shadows the built-in type `u32`
  --> $DIR/builtin-type-shadow.rs:5:8
   |
-5 | fn foo<u32>(a: u32) -> u32 { //~ERROR shadows the built-in type `u32`
+5 | fn foo<u32>(a: u32) -> u32 {
   |        ^^^
   |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error[E0308]: mismatched types
  --> $DIR/builtin-type-shadow.rs:6:5
   |
-6 |     42  //~ERROR E0308
+6 |     42
   |     ^^ expected type parameter, found integral variable
   |
   = note: expected type `u32`
index d0ea5f40789d934167a6131c8eddd7445910e1ec..ca5106102e9cc4255f9d064259fa4942595a8b60 100644 (file)
@@ -5,60 +5,60 @@
 #[allow(no_effect, unnecessary_operation)]
 fn main() {
     // Test cast_precision_loss
-    1i32 as f32; //~ERROR casting i32 to f32 causes a loss of precision (i32 is 32 bits wide, but f32's mantissa is only 23 bits wide)
-    1i64 as f32; //~ERROR casting i64 to f32 causes a loss of precision (i64 is 64 bits wide, but f32's mantissa is only 23 bits wide)
-    1i64 as f64; //~ERROR casting i64 to f64 causes a loss of precision (i64 is 64 bits wide, but f64's mantissa is only 52 bits wide)
-    1u32 as f32; //~ERROR casting u32 to f32 causes a loss of precision (u32 is 32 bits wide, but f32's mantissa is only 23 bits wide)
-    1u64 as f32; //~ERROR casting u64 to f32 causes a loss of precision (u64 is 64 bits wide, but f32's mantissa is only 23 bits wide)
-    1u64 as f64; //~ERROR casting u64 to f64 causes a loss of precision (u64 is 64 bits wide, but f64's mantissa is only 52 bits wide)
+    1i32 as f32;
+    1i64 as f32;
+    1i64 as f64;
+    1u32 as f32;
+    1u64 as f32;
+    1u64 as f64;
     1i32 as f64; // Should not trigger the lint
     1u32 as f64; // Should not trigger the lint
 
     // Test cast_possible_truncation
-    1f32 as i32;   //~ERROR casting f32 to i32 may truncate the value
-    1f32 as u32;   //~ERROR casting f32 to u32 may truncate the value
-                  //~^ERROR casting f32 to u32 may lose the sign of the value
-    1f64 as f32;   //~ERROR casting f64 to f32 may truncate the value
-    1i32 as i8;    //~ERROR casting i32 to i8 may truncate the value
-    1i32 as u8;    //~ERROR casting i32 to u8 may truncate the value
-                  //~^ERROR casting i32 to u8 may lose the sign of the value
-    1f64 as isize; //~ERROR casting f64 to isize may truncate the value
-    1f64 as usize; //~ERROR casting f64 to usize may truncate the value
-                  //~^ERROR casting f64 to usize may lose the sign of the value
+    1f32 as i32;
+    1f32 as u32;
+
+    1f64 as f32;
+    1i32 as i8;
+    1i32 as u8;
+
+    1f64 as isize;
+    1f64 as usize;
+
 
     // Test cast_possible_wrap
-    1u8 as i8;       //~ERROR casting u8 to i8 may wrap around the value
-    1u16 as i16;     //~ERROR casting u16 to i16 may wrap around the value
-    1u32 as i32;     //~ERROR casting u32 to i32 may wrap around the value
-    1u64 as i64;     //~ERROR casting u64 to i64 may wrap around the value
-    1usize as isize; //~ERROR casting usize to isize may wrap around the value
+    1u8 as i8;
+    1u16 as i16;
+    1u32 as i32;
+    1u64 as i64;
+    1usize as isize;
 
     // Test cast_sign_loss
-    1i32 as u32;     //~ERROR casting i32 to u32 may lose the sign of the value
-    1isize as usize; //~ERROR casting isize to usize may lose the sign of the value
+    1i32 as u32;
+    1isize as usize;
 
     // Extra checks for *size
     // Casting from *size
-    1isize as i8;  //~ERROR casting isize to i8 may truncate the value
-    1isize as f64; //~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)
-    1usize as f64; //~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)
-    1isize as f32; //~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)
-    1usize as f32; //~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)
-    1isize as i32; //~ERROR casting isize to i32 may truncate the value on targets with 64-bit wide pointers
-    1isize as u32; //~ERROR casting isize to u32 may lose the sign of the value
-                  //~^ERROR casting isize to u32 may truncate the value on targets with 64-bit wide pointers
-    1usize as u32; //~ERROR casting usize to u32 may truncate the value on targets with 64-bit wide pointers
-    1usize as i32; //~ERROR casting usize to i32 may truncate the value on targets with 64-bit wide pointers
-                  //~^ERROR casting usize to i32 may wrap around the value on targets with 32-bit wide pointers
+    1isize as i8;
+    1isize as f64;
+    1usize as f64;
+    1isize as f32;
+    1usize as f32;
+    1isize as i32;
+    1isize as u32;
+
+    1usize as u32;
+    1usize as i32;
+
     // Casting to *size
-    1i64 as isize; //~ERROR casting i64 to isize may truncate the value on targets with 32-bit wide pointers
-    1i64 as usize; //~ERROR casting i64 to usize may truncate the value on targets with 32-bit wide pointers
-                  //~^ERROR casting i64 to usize may lose the sign of the value
-    1u64 as isize; //~ERROR casting u64 to isize may truncate the value on targets with 32-bit wide pointers
-                  //~^ERROR casting u64 to isize may wrap around the value on targets with 64-bit wide pointers
-    1u64 as usize; //~ERROR casting u64 to usize may truncate the value on targets with 32-bit wide pointers
-    1u32 as isize; //~ERROR casting u32 to isize may wrap around the value on targets with 32-bit wide pointers
+    1i64 as isize;
+    1i64 as usize;
+
+    1u64 as isize;
+
+    1u64 as usize;
+    1u32 as isize;
     1u32 as usize; // Should not trigger any lint
     1i32 as isize; // Neither should this
-    1i32 as usize; //~ERROR casting i32 to usize may lose the sign of the value
+    1i32 as usize;
 }
index e5fbc8fe4da17e800d3c6716584b92a58e6a7752..f4d8ec21d8d9b3263ad0e7888f9c1d7cef86a314 100644 (file)
@@ -1,7 +1,7 @@
 error: casting i32 to f32 causes a loss of precision (i32 is 32 bits wide, but f32's mantissa is only 23 bits wide)
  --> $DIR/cast.rs:8:5
   |
-8 |     1i32 as f32; //~ERROR casting i32 to f32 causes a loss of precision (i32 is 32 bits wide, but f32's mantissa is only 23 bits wide)
+8 |     1i32 as f32;
   |     ^^^^^^^^^^^
   |
 note: lint level defined here
@@ -13,37 +13,37 @@ note: lint level defined here
 error: casting i64 to f32 causes a loss of precision (i64 is 64 bits wide, but f32's mantissa is only 23 bits wide)
  --> $DIR/cast.rs:9:5
   |
-9 |     1i64 as f32; //~ERROR casting i64 to f32 causes a loss of precision (i64 is 64 bits wide, but f32's mantissa is only 23 bits wide)
+9 |     1i64 as f32;
   |     ^^^^^^^^^^^
 
 error: casting i64 to f64 causes a loss of precision (i64 is 64 bits wide, but f64's mantissa is only 52 bits wide)
   --> $DIR/cast.rs:10:5
    |
-10 |     1i64 as f64; //~ERROR casting i64 to f64 causes a loss of precision (i64 is 64 bits wide, but f64's mantissa is only 52 bits wide)
+10 |     1i64 as f64;
    |     ^^^^^^^^^^^
 
 error: casting u32 to f32 causes a loss of precision (u32 is 32 bits wide, but f32's mantissa is only 23 bits wide)
   --> $DIR/cast.rs:11:5
    |
-11 |     1u32 as f32; //~ERROR casting u32 to f32 causes a loss of precision (u32 is 32 bits wide, but f32's mantissa is only 23 bits wide)
+11 |     1u32 as f32;
    |     ^^^^^^^^^^^
 
 error: casting u64 to f32 causes a loss of precision (u64 is 64 bits wide, but f32's mantissa is only 23 bits wide)
   --> $DIR/cast.rs:12:5
    |
-12 |     1u64 as f32; //~ERROR casting u64 to f32 causes a loss of precision (u64 is 64 bits wide, but f32's mantissa is only 23 bits wide)
+12 |     1u64 as f32;
    |     ^^^^^^^^^^^
 
 error: casting u64 to f64 causes a loss of precision (u64 is 64 bits wide, but f64's mantissa is only 52 bits wide)
   --> $DIR/cast.rs:13:5
    |
-13 |     1u64 as f64; //~ERROR casting u64 to f64 causes a loss of precision (u64 is 64 bits wide, but f64's mantissa is only 52 bits wide)
+13 |     1u64 as f64;
    |     ^^^^^^^^^^^
 
 error: casting f32 to i32 may truncate the value
   --> $DIR/cast.rs:18:5
    |
-18 |     1f32 as i32;   //~ERROR casting f32 to i32 may truncate the value
+18 |     1f32 as i32;
    |     ^^^^^^^^^^^
    |
 note: lint level defined here
@@ -55,13 +55,13 @@ note: lint level defined here
 error: casting f32 to u32 may truncate the value
   --> $DIR/cast.rs:19:5
    |
-19 |     1f32 as u32;   //~ERROR casting f32 to u32 may truncate the value
+19 |     1f32 as u32;
    |     ^^^^^^^^^^^
 
 error: casting f32 to u32 may lose the sign of the value
   --> $DIR/cast.rs:19:5
    |
-19 |     1f32 as u32;   //~ERROR casting f32 to u32 may truncate the value
+19 |     1f32 as u32;
    |     ^^^^^^^^^^^
    |
 note: lint level defined here
@@ -73,49 +73,49 @@ note: lint level defined here
 error: casting f64 to f32 may truncate the value
   --> $DIR/cast.rs:21:5
    |
-21 |     1f64 as f32;   //~ERROR casting f64 to f32 may truncate the value
+21 |     1f64 as f32;
    |     ^^^^^^^^^^^
 
 error: casting i32 to i8 may truncate the value
   --> $DIR/cast.rs:22:5
    |
-22 |     1i32 as i8;    //~ERROR casting i32 to i8 may truncate the value
+22 |     1i32 as i8;
    |     ^^^^^^^^^^
 
 error: casting i32 to u8 may lose the sign of the value
   --> $DIR/cast.rs:23:5
    |
-23 |     1i32 as u8;    //~ERROR casting i32 to u8 may truncate the value
+23 |     1i32 as u8;
    |     ^^^^^^^^^^
 
 error: casting i32 to u8 may truncate the value
   --> $DIR/cast.rs:23:5
    |
-23 |     1i32 as u8;    //~ERROR casting i32 to u8 may truncate the value
+23 |     1i32 as u8;
    |     ^^^^^^^^^^
 
 error: casting f64 to isize may truncate the value
   --> $DIR/cast.rs:25:5
    |
-25 |     1f64 as isize; //~ERROR casting f64 to isize may truncate the value
+25 |     1f64 as isize;
    |     ^^^^^^^^^^^^^
 
 error: casting f64 to usize may truncate the value
   --> $DIR/cast.rs:26:5
    |
-26 |     1f64 as usize; //~ERROR casting f64 to usize may truncate the value
+26 |     1f64 as usize;
    |     ^^^^^^^^^^^^^
 
 error: casting f64 to usize may lose the sign of the value
   --> $DIR/cast.rs:26:5
    |
-26 |     1f64 as usize; //~ERROR casting f64 to usize may truncate the value
+26 |     1f64 as usize;
    |     ^^^^^^^^^^^^^
 
 error: casting u8 to i8 may wrap around the value
   --> $DIR/cast.rs:30:5
    |
-30 |     1u8 as i8;       //~ERROR casting u8 to i8 may wrap around the value
+30 |     1u8 as i8;
    |     ^^^^^^^^^
    |
 note: lint level defined here
@@ -127,151 +127,151 @@ note: lint level defined here
 error: casting u16 to i16 may wrap around the value
   --> $DIR/cast.rs:31:5
    |
-31 |     1u16 as i16;     //~ERROR casting u16 to i16 may wrap around the value
+31 |     1u16 as i16;
    |     ^^^^^^^^^^^
 
 error: casting u32 to i32 may wrap around the value
   --> $DIR/cast.rs:32:5
    |
-32 |     1u32 as i32;     //~ERROR casting u32 to i32 may wrap around the value
+32 |     1u32 as i32;
    |     ^^^^^^^^^^^
 
 error: casting u64 to i64 may wrap around the value
   --> $DIR/cast.rs:33:5
    |
-33 |     1u64 as i64;     //~ERROR casting u64 to i64 may wrap around the value
+33 |     1u64 as i64;
    |     ^^^^^^^^^^^
 
 error: casting usize to isize may wrap around the value
   --> $DIR/cast.rs:34:5
    |
-34 |     1usize as isize; //~ERROR casting usize to isize may wrap around the value
+34 |     1usize as isize;
    |     ^^^^^^^^^^^^^^^
 
 error: casting i32 to u32 may lose the sign of the value
   --> $DIR/cast.rs:37:5
    |
-37 |     1i32 as u32;     //~ERROR casting i32 to u32 may lose the sign of the value
+37 |     1i32 as u32;
    |     ^^^^^^^^^^^
 
 error: casting isize to usize may lose the sign of the value
   --> $DIR/cast.rs:38:5
    |
-38 |     1isize as usize; //~ERROR casting isize to usize may lose the sign of the value
+38 |     1isize as usize;
    |     ^^^^^^^^^^^^^^^
 
 error: casting isize to i8 may truncate the value
   --> $DIR/cast.rs:42:5
    |
-42 |     1isize as i8;  //~ERROR casting isize to i8 may truncate the value
+42 |     1isize as i8;
    |     ^^^^^^^^^^^^
 
 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)
   --> $DIR/cast.rs:43:5
    |
-43 |     1isize as f64; //~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)
+43 |     1isize as f64;
    |     ^^^^^^^^^^^^^
 
 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)
   --> $DIR/cast.rs:44:5
    |
-44 |     1usize as f64; //~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)
+44 |     1usize as f64;
    |     ^^^^^^^^^^^^^
 
 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)
   --> $DIR/cast.rs:45:5
    |
-45 |     1isize as f32; //~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)
+45 |     1isize as f32;
    |     ^^^^^^^^^^^^^
 
 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)
   --> $DIR/cast.rs:46:5
    |
-46 |     1usize as f32; //~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)
+46 |     1usize as f32;
    |     ^^^^^^^^^^^^^
 
 error: casting isize to i32 may truncate the value on targets with 64-bit wide pointers
   --> $DIR/cast.rs:47:5
    |
-47 |     1isize as i32; //~ERROR casting isize to i32 may truncate the value on targets with 64-bit wide pointers
+47 |     1isize as i32;
    |     ^^^^^^^^^^^^^
 
 error: casting isize to u32 may lose the sign of the value
   --> $DIR/cast.rs:48:5
    |
-48 |     1isize as u32; //~ERROR casting isize to u32 may lose the sign of the value
+48 |     1isize as u32;
    |     ^^^^^^^^^^^^^
 
 error: casting isize to u32 may truncate the value on targets with 64-bit wide pointers
   --> $DIR/cast.rs:48:5
    |
-48 |     1isize as u32; //~ERROR casting isize to u32 may lose the sign of the value
+48 |     1isize as u32;
    |     ^^^^^^^^^^^^^
 
 error: casting usize to u32 may truncate the value on targets with 64-bit wide pointers
   --> $DIR/cast.rs:50:5
    |
-50 |     1usize as u32; //~ERROR casting usize to u32 may truncate the value on targets with 64-bit wide pointers
+50 |     1usize as u32;
    |     ^^^^^^^^^^^^^
 
 error: casting usize to i32 may truncate the value on targets with 64-bit wide pointers
   --> $DIR/cast.rs:51:5
    |
-51 |     1usize as i32; //~ERROR casting usize to i32 may truncate the value on targets with 64-bit wide pointers
+51 |     1usize as i32;
    |     ^^^^^^^^^^^^^
 
 error: casting usize to i32 may wrap around the value on targets with 32-bit wide pointers
   --> $DIR/cast.rs:51:5
    |
-51 |     1usize as i32; //~ERROR casting usize to i32 may truncate the value on targets with 64-bit wide pointers
+51 |     1usize as i32;
    |     ^^^^^^^^^^^^^
 
 error: casting i64 to isize may truncate the value on targets with 32-bit wide pointers
   --> $DIR/cast.rs:54:5
    |
-54 |     1i64 as isize; //~ERROR casting i64 to isize may truncate the value on targets with 32-bit wide pointers
+54 |     1i64 as isize;
    |     ^^^^^^^^^^^^^
 
 error: casting i64 to usize may lose the sign of the value
   --> $DIR/cast.rs:55:5
    |
-55 |     1i64 as usize; //~ERROR casting i64 to usize may truncate the value on targets with 32-bit wide pointers
+55 |     1i64 as usize;
    |     ^^^^^^^^^^^^^
 
 error: casting i64 to usize may truncate the value on targets with 32-bit wide pointers
   --> $DIR/cast.rs:55:5
    |
-55 |     1i64 as usize; //~ERROR casting i64 to usize may truncate the value on targets with 32-bit wide pointers
+55 |     1i64 as usize;
    |     ^^^^^^^^^^^^^
 
 error: casting u64 to isize may truncate the value on targets with 32-bit wide pointers
   --> $DIR/cast.rs:57:5
    |
-57 |     1u64 as isize; //~ERROR casting u64 to isize may truncate the value on targets with 32-bit wide pointers
+57 |     1u64 as isize;
    |     ^^^^^^^^^^^^^
 
 error: casting u64 to isize may wrap around the value on targets with 64-bit wide pointers
   --> $DIR/cast.rs:57:5
    |
-57 |     1u64 as isize; //~ERROR casting u64 to isize may truncate the value on targets with 32-bit wide pointers
+57 |     1u64 as isize;
    |     ^^^^^^^^^^^^^
 
 error: casting u64 to usize may truncate the value on targets with 32-bit wide pointers
   --> $DIR/cast.rs:59:5
    |
-59 |     1u64 as usize; //~ERROR casting u64 to usize may truncate the value on targets with 32-bit wide pointers
+59 |     1u64 as usize;
    |     ^^^^^^^^^^^^^
 
 error: casting u32 to isize may wrap around the value on targets with 32-bit wide pointers
   --> $DIR/cast.rs:60:5
    |
-60 |     1u32 as isize; //~ERROR casting u32 to isize may wrap around the value on targets with 32-bit wide pointers
+60 |     1u32 as isize;
    |     ^^^^^^^^^^^^^
 
 error: casting i32 to usize may lose the sign of the value
   --> $DIR/cast.rs:63:5
    |
-63 |     1i32 as usize; //~ERROR casting i32 to usize may lose the sign of the value
+63 |     1i32 as usize;
    |     ^^^^^^^^^^^^^
 
 error: aborting due to 42 previous errors
index 4fca878c4daf2eadbc3b0aca1ab6903f36dfe2d4..84f76fb0131e10cd8865bdf2a40c131c54856558 100644 (file)
@@ -4,5 +4,5 @@
 #![deny(char_lit_as_u8)]
 #![allow(unused_variables)]
 fn main() {
-    let c = 'a' as u8; //~ERROR casting character literal
+    let c = 'a' as u8;
 }
index f297f692dbbfeaae134acf709677056cb806619c..95550194a8d2e3cdb63c40d5d550d3d454efd123 100644 (file)
@@ -1,7 +1,7 @@
 error: casting character literal to u8. `char`s are 4 bytes wide in rust, so casting to u8 truncates them
  --> $DIR/char_lit_as_u8.rs:7:13
   |
-7 |     let c = 'a' as u8; //~ERROR casting character literal
+7 |     let c = 'a' as u8;
   |             ^^^^^^^^^
   |
 note: lint level defined here
index 8d173665a2429fb241ebe4159063fefb112049fb..53aaba61787b8045dc76c92a000ccf084bdbb075 100644 (file)
@@ -5,18 +5,18 @@
 #[allow(float_cmp, no_effect, unnecessary_operation)]
 fn main() {
     let x = 5f32;
-    x == std::f32::NAN; //~ERROR doomed comparison with NAN
-    x != std::f32::NAN; //~ERROR doomed comparison with NAN
-    x < std::f32::NAN;  //~ERROR doomed comparison with NAN
-    x > std::f32::NAN;  //~ERROR doomed comparison with NAN
-    x <= std::f32::NAN; //~ERROR doomed comparison with NAN
-    x >= std::f32::NAN; //~ERROR doomed comparison with NAN
+    x == std::f32::NAN;
+    x != std::f32::NAN;
+    x < std::f32::NAN;
+    x > std::f32::NAN;
+    x <= std::f32::NAN;
+    x >= std::f32::NAN;
 
     let y = 0f64;
-    y == std::f64::NAN; //~ERROR doomed comparison with NAN
-    y != std::f64::NAN; //~ERROR doomed comparison with NAN
-    y < std::f64::NAN;  //~ERROR doomed comparison with NAN
-    y > std::f64::NAN;  //~ERROR doomed comparison with NAN
-    y <= std::f64::NAN; //~ERROR doomed comparison with NAN
-    y >= std::f64::NAN; //~ERROR doomed comparison with NAN
+    y == std::f64::NAN;
+    y != std::f64::NAN;
+    y < std::f64::NAN;
+    y > std::f64::NAN;
+    y <= std::f64::NAN;
+    y >= std::f64::NAN;
 }
index 9d76a076b4a7fc4ba884bfb7fd0a78782ce32108..9015e2fd3b275eab6713a2b70cd1826e8527a07b 100644 (file)
@@ -1,7 +1,7 @@
 error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
  --> $DIR/cmp_nan.rs:8:5
   |
-8 |     x == std::f32::NAN; //~ERROR doomed comparison with NAN
+8 |     x == std::f32::NAN;
   |     ^^^^^^^^^^^^^^^^^^
   |
   = note: #[deny(cmp_nan)] on by default
@@ -9,7 +9,7 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
 error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
  --> $DIR/cmp_nan.rs:9:5
   |
-9 |     x != std::f32::NAN; //~ERROR doomed comparison with NAN
+9 |     x != std::f32::NAN;
   |     ^^^^^^^^^^^^^^^^^^
   |
   = note: #[deny(cmp_nan)] on by default
@@ -17,7 +17,7 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
 error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
   --> $DIR/cmp_nan.rs:10:5
    |
-10 |     x < std::f32::NAN;  //~ERROR doomed comparison with NAN
+10 |     x < std::f32::NAN;
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(cmp_nan)] on by default
@@ -25,7 +25,7 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
 error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
   --> $DIR/cmp_nan.rs:11:5
    |
-11 |     x > std::f32::NAN;  //~ERROR doomed comparison with NAN
+11 |     x > std::f32::NAN;
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(cmp_nan)] on by default
@@ -33,7 +33,7 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
 error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
   --> $DIR/cmp_nan.rs:12:5
    |
-12 |     x <= std::f32::NAN; //~ERROR doomed comparison with NAN
+12 |     x <= std::f32::NAN;
    |     ^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(cmp_nan)] on by default
@@ -41,7 +41,7 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
 error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
   --> $DIR/cmp_nan.rs:13:5
    |
-13 |     x >= std::f32::NAN; //~ERROR doomed comparison with NAN
+13 |     x >= std::f32::NAN;
    |     ^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(cmp_nan)] on by default
@@ -49,7 +49,7 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
 error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
   --> $DIR/cmp_nan.rs:16:5
    |
-16 |     y == std::f64::NAN; //~ERROR doomed comparison with NAN
+16 |     y == std::f64::NAN;
    |     ^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(cmp_nan)] on by default
@@ -57,7 +57,7 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
 error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
   --> $DIR/cmp_nan.rs:17:5
    |
-17 |     y != std::f64::NAN; //~ERROR doomed comparison with NAN
+17 |     y != std::f64::NAN;
    |     ^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(cmp_nan)] on by default
@@ -65,7 +65,7 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
 error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
   --> $DIR/cmp_nan.rs:18:5
    |
-18 |     y < std::f64::NAN;  //~ERROR doomed comparison with NAN
+18 |     y < std::f64::NAN;
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(cmp_nan)] on by default
@@ -73,7 +73,7 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
 error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
   --> $DIR/cmp_nan.rs:19:5
    |
-19 |     y > std::f64::NAN;  //~ERROR doomed comparison with NAN
+19 |     y > std::f64::NAN;
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(cmp_nan)] on by default
@@ -81,7 +81,7 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
 error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
   --> $DIR/cmp_nan.rs:20:5
    |
-20 |     y <= std::f64::NAN; //~ERROR doomed comparison with NAN
+20 |     y <= std::f64::NAN;
    |     ^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(cmp_nan)] on by default
@@ -89,7 +89,7 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
 error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
   --> $DIR/cmp_nan.rs:21:5
    |
-21 |     y >= std::f64::NAN; //~ERROR doomed comparison with NAN
+21 |     y >= std::f64::NAN;
    |     ^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(cmp_nan)] on by default
index a55ea6f5bca29fdc8294310a8c0fc67146280ad8..5449d2d31ac80a8fc6ba6abcbdd4197e83642f40 100644 (file)
@@ -8,12 +8,12 @@
 fn main() {
     let x = 0;
     let p : *const usize = &x;
-    if p == ptr::null() { //~ERROR:  Comparing with null
+    if p == ptr::null() {
         println!("This is surprising!");
     }
     let mut y = 0;
     let mut m : *mut usize = &mut y;
-    if m == ptr::null_mut() { //~ERROR:  Comparing with null
+    if m == ptr::null_mut() {
         println!("This is surprising, too!");
     }
 }
index 45523cea39e60237b7600b9107f36b9ecdf59a94..f98edeaca46b8fd041620413385963481c5a69dd 100644 (file)
@@ -1,7 +1,7 @@
 error: Comparing with null is better expressed by the .is_null() method
   --> $DIR/cmp_null.rs:11:8
    |
-11 |     if p == ptr::null() { //~ERROR:  Comparing with null
+11 |     if p == ptr::null() {
    |        ^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: Comparing with null is better expressed by the .is_null() method
   --> $DIR/cmp_null.rs:16:8
    |
-16 |     if m == ptr::null_mut() { //~ERROR:  Comparing with null
+16 |     if m == ptr::null_mut() {
    |        ^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index f7c7824e9d1cddb1c326c9f3a6028ddc521bd08f..30cd502a105704be7e052dadc24c21dae176fc34 100644 (file)
@@ -6,22 +6,22 @@
 fn main() {
     fn with_to_string(x : &str) {
         x != "foo".to_string();
-        //~^ ERROR this creates an owned instance just for comparison. Consider using `x != "foo"` to compare without allocation
+
 
         "foo".to_string() != x;
-        //~^ ERROR this creates an owned instance just for comparison. Consider using `"foo" != x` to compare without allocation
+
     }
 
     let x = "oh";
 
     with_to_string(x);
 
-    x != "foo".to_owned(); //~ERROR this creates an owned instance
+    x != "foo".to_owned();
 
     // removed String::from_str(..), as it has finally been removed in 1.4.0
     // as of 2015-08-14
 
-    x != String::from("foo"); //~ERROR this creates an owned instance
+    x != String::from("foo");
 
     42.to_string() == "42";
 }
index 5c4ff833849ebc08bb0d93c2fa930df87d294856..231e2752c81307cf1497c5aaf5443e9a3a506f4b 100644 (file)
@@ -19,13 +19,13 @@ error: this creates an owned instance just for comparison. Consider using `"foo"
 error: this creates an owned instance just for comparison. Consider using `x != "foo"` to compare without allocation
   --> $DIR/cmp_owned.rs:19:10
    |
-19 |     x != "foo".to_owned(); //~ERROR this creates an owned instance
+19 |     x != "foo".to_owned();
    |          ^^^^^^^^^^^^^^^^
 
 error: this creates an owned instance just for comparison. Consider using `x != "foo"` to compare without allocation
   --> $DIR/cmp_owned.rs:24:10
    |
-24 |     x != String::from("foo"); //~ERROR this creates an owned instance
+24 |     x != String::from("foo");
    |          ^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 4 previous errors
index b23d6a6e4c186c19c237d927700fdd94b27a7ba2..6034bba848e0bc2bc52984d8d2cac2f00f5de888 100644 (file)
@@ -6,54 +6,54 @@ fn main() {
     let x = "hello";
     let y = "world";
     if x == "hello" {
-    //~^ ERROR this if statement can be collapsed
-    //~| HELP try
-    //~| SUGGESTION if x == "hello" && y == "world" {
+
+
+
         if y == "world" {
             println!("Hello world!");
         }
     }
 
     if x == "hello" || x == "world" {
-    //~^ ERROR this if statement can be collapsed
-    //~| HELP try
-    //~| SUGGESTION if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
+
+
+
         if y == "world" || y == "hello" {
             println!("Hello world!");
         }
     }
 
     if x == "hello" && x == "world" {
-    //~^ ERROR this if statement can be collapsed
-    //~| HELP try
-    //~| SUGGESTION if x == "hello" && x == "world" && (y == "world" || y == "hello") {
+
+
+
         if y == "world" || y == "hello" {
             println!("Hello world!");
         }
     }
 
     if x == "hello" || x == "world" {
-    //~^ ERROR this if statement can be collapsed
-    //~| HELP try
-    //~| SUGGESTION if (x == "hello" || x == "world") && y == "world" && y == "hello" {
+
+
+
         if y == "world" && y == "hello" {
             println!("Hello world!");
         }
     }
 
     if x == "hello" && x == "world" {
-    //~^ ERROR this if statement can be collapsed
-    //~| HELP try
-    //~| SUGGESTION if x == "hello" && x == "world" && y == "world" && y == "hello" {
+
+
+
         if y == "world" && y == "hello" {
             println!("Hello world!");
         }
     }
 
     if 42 == 1337 {
-    //~^ ERROR this if statement can be collapsed
-    //~| HELP try
-    //~| SUGGESTION if 42 == 1337 && 'a' != 'A' {
+
+
+
         if 'a' != 'A' {
             println!("world!")
         }
@@ -63,9 +63,9 @@ fn main() {
     if x == "hello" {
         print!("Hello ");
     } else {
-        //~^ ERROR: this `else { if .. }`
-        //~| HELP try
-        //~| SUGGESTION } else if y == "world"
+
+
+
         if y == "world" {
             println!("world!")
         }
@@ -74,9 +74,9 @@ fn main() {
     if x == "hello" {
         print!("Hello ");
     } else {
-        //~^ ERROR: this `else { if .. }`
-        //~| HELP try
-        //~| SUGGESTION } else if let Some(42)
+
+
+
         if let Some(42) = Some(42) {
             println!("world!")
         }
@@ -85,9 +85,9 @@ fn main() {
     if x == "hello" {
         print!("Hello ");
     } else {
-        //~^ ERROR this `else { if .. }`
-        //~| HELP try
-        //~| SUGGESTION } else if y == "world"
+
+
+
         if y == "world" {
             println!("world")
         }
@@ -99,9 +99,9 @@ fn main() {
     if x == "hello" {
         print!("Hello ");
     } else {
-        //~^ ERROR this `else { if .. }`
-        //~| HELP try
-        //~| SUGGESTION } else if let Some(42)
+
+
+
         if let Some(42) = Some(42) {
             println!("world")
         }
@@ -113,9 +113,9 @@ fn main() {
     if let Some(42) = Some(42) {
         print!("Hello ");
     } else {
-        //~^ ERROR this `else { if .. }`
-        //~| HELP try
-        //~| SUGGESTION } else if let Some(42)
+
+
+
         if let Some(42) = Some(42) {
             println!("world")
         }
@@ -127,9 +127,9 @@ fn main() {
     if let Some(42) = Some(42) {
         print!("Hello ");
     } else {
-        //~^ ERROR this `else { if .. }`
-        //~| HELP try
-        //~| SUGGESTION } else if x == "hello"
+
+
+
         if x == "hello" {
             println!("world")
         }
@@ -141,9 +141,9 @@ fn main() {
     if let Some(42) = Some(42) {
         print!("Hello ");
     } else {
-        //~^ ERROR this `else { if .. }`
-        //~| HELP try
-        //~| SUGGESTION } else if let Some(42)
+
+
+
         if let Some(42) = Some(42) {
             println!("world")
         }
index ed510f96229b8883d4d784b9a282f39b319e4e42..eeac9166ad27228f33d9377955277686f1372391 100644 (file)
@@ -3,9 +3,9 @@ error: this if statement can be collapsed
    |
 8  |       if x == "hello" {
    |  _____^ starting here...
-9  | |     //~^ ERROR this if statement can be collapsed
-10 | |     //~| HELP try
-11 | |     //~| SUGGESTION if x == "hello" && y == "world" {
+9  | |
+10 | |
+11 | |
 12 | |         if y == "world" {
 13 | |             println!("Hello world!");
 14 | |         }
@@ -27,9 +27,9 @@ error: this if statement can be collapsed
    |
 17 |       if x == "hello" || x == "world" {
    |  _____^ starting here...
-18 | |     //~^ ERROR this if statement can be collapsed
-19 | |     //~| HELP try
-20 | |     //~| SUGGESTION if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
+18 | |
+19 | |
+20 | |
 21 | |         if y == "world" || y == "hello" {
 22 | |             println!("Hello world!");
 23 | |         }
@@ -46,9 +46,9 @@ error: this if statement can be collapsed
    |
 26 |       if x == "hello" && x == "world" {
    |  _____^ starting here...
-27 | |     //~^ ERROR this if statement can be collapsed
-28 | |     //~| HELP try
-29 | |     //~| SUGGESTION if x == "hello" && x == "world" && (y == "world" || y == "hello") {
+27 | |
+28 | |
+29 | |
 30 | |         if y == "world" || y == "hello" {
 31 | |             println!("Hello world!");
 32 | |         }
@@ -65,9 +65,9 @@ error: this if statement can be collapsed
    |
 35 |       if x == "hello" || x == "world" {
    |  _____^ starting here...
-36 | |     //~^ ERROR this if statement can be collapsed
-37 | |     //~| HELP try
-38 | |     //~| SUGGESTION if (x == "hello" || x == "world") && y == "world" && y == "hello" {
+36 | |
+37 | |
+38 | |
 39 | |         if y == "world" && y == "hello" {
 40 | |             println!("Hello world!");
 41 | |         }
@@ -84,9 +84,9 @@ error: this if statement can be collapsed
    |
 44 |       if x == "hello" && x == "world" {
    |  _____^ starting here...
-45 | |     //~^ ERROR this if statement can be collapsed
-46 | |     //~| HELP try
-47 | |     //~| SUGGESTION if x == "hello" && x == "world" && y == "world" && y == "hello" {
+45 | |
+46 | |
+47 | |
 48 | |         if y == "world" && y == "hello" {
 49 | |             println!("Hello world!");
 50 | |         }
@@ -103,9 +103,9 @@ error: this if statement can be collapsed
    |
 53 |       if 42 == 1337 {
    |  _____^ starting here...
-54 | |     //~^ ERROR this if statement can be collapsed
-55 | |     //~| HELP try
-56 | |     //~| SUGGESTION if 42 == 1337 && 'a' != 'A' {
+54 | |
+55 | |
+56 | |
 57 | |         if 'a' != 'A' {
 58 | |             println!("world!")
 59 | |         }
@@ -122,9 +122,9 @@ error: this `else { if .. }` block can be collapsed
    |
 65 |       } else {
    |  ____________^ starting here...
-66 | |         //~^ ERROR: this `else { if .. }`
-67 | |         //~| HELP try
-68 | |         //~| SUGGESTION } else if y == "world"
+66 | |
+67 | |
+68 | |
 69 | |         if y == "world" {
 70 | |             println!("world!")
 71 | |         }
@@ -141,9 +141,9 @@ error: this `else { if .. }` block can be collapsed
    |
 76 |       } else {
    |  ____________^ starting here...
-77 | |         //~^ ERROR: this `else { if .. }`
-78 | |         //~| HELP try
-79 | |         //~| SUGGESTION } else if let Some(42)
+77 | |
+78 | |
+79 | |
 80 | |         if let Some(42) = Some(42) {
 81 | |             println!("world!")
 82 | |         }
index ad01e4fadd5f80d581eedaf61585f6fe871ed87a..ef5cd68972db2b6628003a58453f4652b1f57b46 100644 (file)
@@ -6,38 +6,38 @@
 
 type Alias = Vec<Vec<Box<(u32, u32, u32, u32)>>>; // no warning here
 
-const CST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0)))); //~ERROR very complex type
-static ST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0)))); //~ERROR very complex type
+const CST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
+static ST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
 
 struct S {
-    f: Vec<Vec<Box<(u32, u32, u32, u32)>>>, //~ERROR very complex type
+    f: Vec<Vec<Box<(u32, u32, u32, u32)>>>,
 }
 
-struct TS(Vec<Vec<Box<(u32, u32, u32, u32)>>>); //~ERROR very complex type
+struct TS(Vec<Vec<Box<(u32, u32, u32, u32)>>>);
 
 enum E {
-    Tuple(Vec<Vec<Box<(u32, u32, u32, u32)>>>), //~ERROR very complex type
-    Struct { f: Vec<Vec<Box<(u32, u32, u32, u32)>>> }, //~ERROR very complex type
+    Tuple(Vec<Vec<Box<(u32, u32, u32, u32)>>>),
+    Struct { f: Vec<Vec<Box<(u32, u32, u32, u32)>>> },
 }
 
 impl S {
-    const A: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0)))); //~ERROR very complex type
-    fn impl_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { } //~ERROR very complex type
+    const A: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
+    fn impl_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { }
 }
 
 trait T {
-    const A: Vec<Vec<Box<(u32, u32, u32, u32)>>>; //~ERROR very complex type
-    type B = Vec<Vec<Box<(u32, u32, u32, u32)>>>; //~ERROR very complex type
-    fn method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>); //~ERROR very complex type
-    fn def_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { } //~ERROR very complex type
+    const A: Vec<Vec<Box<(u32, u32, u32, u32)>>>;
+    type B = Vec<Vec<Box<(u32, u32, u32, u32)>>>;
+    fn method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>);
+    fn def_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { }
 }
 
-fn test1() -> Vec<Vec<Box<(u32, u32, u32, u32)>>> { vec![] } //~ERROR very complex type
+fn test1() -> Vec<Vec<Box<(u32, u32, u32, u32)>>> { vec![] }
 
-fn test2(_x: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { } //~ERROR very complex type
+fn test2(_x: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { }
 
 fn test3() {
-    let _y: Vec<Vec<Box<(u32, u32, u32, u32)>>> = vec![]; //~ERROR very complex type
+    let _y: Vec<Vec<Box<(u32, u32, u32, u32)>>> = vec![];
 }
 
 fn main() {
index b502a3fd5c1dd603a17bf69c2040ab0510bcbf88..a2e7f9384d1013979f514b3b267c43cf941c59b4 100644 (file)
@@ -1,7 +1,7 @@
 error: very complex type used. Consider factoring parts into `type` definitions
  --> $DIR/complex_types.rs:9:12
   |
-9 | const CST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0)))); //~ERROR very complex type
+9 | const CST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -14,7 +14,7 @@ note: lint level defined here
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:10:12
    |
-10 | static ST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0)))); //~ERROR very complex type
+10 | static ST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -22,7 +22,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:13:8
    |
-13 |     f: Vec<Vec<Box<(u32, u32, u32, u32)>>>, //~ERROR very complex type
+13 |     f: Vec<Vec<Box<(u32, u32, u32, u32)>>>,
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -30,7 +30,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:16:11
    |
-16 | struct TS(Vec<Vec<Box<(u32, u32, u32, u32)>>>); //~ERROR very complex type
+16 | struct TS(Vec<Vec<Box<(u32, u32, u32, u32)>>>);
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -38,7 +38,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:19:11
    |
-19 |     Tuple(Vec<Vec<Box<(u32, u32, u32, u32)>>>), //~ERROR very complex type
+19 |     Tuple(Vec<Vec<Box<(u32, u32, u32, u32)>>>),
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -46,7 +46,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:20:17
    |
-20 |     Struct { f: Vec<Vec<Box<(u32, u32, u32, u32)>>> }, //~ERROR very complex type
+20 |     Struct { f: Vec<Vec<Box<(u32, u32, u32, u32)>>> },
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -54,7 +54,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:24:14
    |
-24 |     const A: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0)))); //~ERROR very complex type
+24 |     const A: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -62,7 +62,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:25:30
    |
-25 |     fn impl_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { } //~ERROR very complex type
+25 |     fn impl_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { }
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -70,7 +70,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:29:14
    |
-29 |     const A: Vec<Vec<Box<(u32, u32, u32, u32)>>>; //~ERROR very complex type
+29 |     const A: Vec<Vec<Box<(u32, u32, u32, u32)>>>;
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -78,7 +78,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:30:14
    |
-30 |     type B = Vec<Vec<Box<(u32, u32, u32, u32)>>>; //~ERROR very complex type
+30 |     type B = Vec<Vec<Box<(u32, u32, u32, u32)>>>;
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -86,7 +86,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:31:25
    |
-31 |     fn method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>); //~ERROR very complex type
+31 |     fn method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>);
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -94,7 +94,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:32:29
    |
-32 |     fn def_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { } //~ERROR very complex type
+32 |     fn def_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { }
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -102,7 +102,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:35:15
    |
-35 | fn test1() -> Vec<Vec<Box<(u32, u32, u32, u32)>>> { vec![] } //~ERROR very complex type
+35 | fn test1() -> Vec<Vec<Box<(u32, u32, u32, u32)>>> { vec![] }
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -110,7 +110,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:37:14
    |
-37 | fn test2(_x: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { } //~ERROR very complex type
+37 | fn test2(_x: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
@@ -118,7 +118,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
 error: very complex type used. Consider factoring parts into `type` definitions
   --> $DIR/complex_types.rs:40:13
    |
-40 |     let _y: Vec<Vec<Box<(u32, u32, u32, u32)>>> = vec![]; //~ERROR very complex type
+40 |     let _y: Vec<Vec<Box<(u32, u32, u32, u32)>>> = vec![];
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(type_complexity)] implied by #[deny(clippy)]
index 4c306a98b2014497cc9be1cc8db2643148ed608a..20cd6aba369ad40eeb8dab73bf1f50d1b4afee20 100644 (file)
@@ -6,21 +6,21 @@
 #![allow(unused_variables)]
 #![deny(blacklisted_name)]
 
-fn test(toto: ()) {} //~ERROR use of a blacklisted/placeholder name `toto`
+fn test(toto: ()) {}
 
 fn main() {
-    let toto = 42; //~ERROR use of a blacklisted/placeholder name `toto`
-    let tata = 42; //~ERROR use of a blacklisted/placeholder name `tata`
-    let titi = 42; //~ERROR use of a blacklisted/placeholder name `titi`
+    let toto = 42;
+    let tata = 42;
+    let titi = 42;
 
     let tatab = 42;
     let tatatataic = 42;
 
     match (42, Some(1337), Some(0)) {
         (toto, Some(tata), titi @ Some(_)) => (),
-        //~^ ERROR use of a blacklisted/placeholder name `toto`
-        //~| ERROR use of a blacklisted/placeholder name `tata`
-        //~| ERROR use of a blacklisted/placeholder name `titi`
+
+
+
         _ => (),
     }
 }
index 0c4996c2c5ff391dc29241667ed4c147571ad09a..b750f4564f6d6319fc2ace5b01dd6fa78d31fc02 100644 (file)
@@ -1,7 +1,7 @@
 error: use of a blacklisted/placeholder name `toto`
  --> $DIR/conf_french_blacklisted_name.rs:9:9
   |
-9 | fn test(toto: ()) {} //~ERROR use of a blacklisted/placeholder name `toto`
+9 | fn test(toto: ()) {}
   |         ^^^^
   |
 note: lint level defined here
@@ -13,19 +13,19 @@ note: lint level defined here
 error: use of a blacklisted/placeholder name `toto`
   --> $DIR/conf_french_blacklisted_name.rs:12:9
    |
-12 |     let toto = 42; //~ERROR use of a blacklisted/placeholder name `toto`
+12 |     let toto = 42;
    |         ^^^^
 
 error: use of a blacklisted/placeholder name `tata`
   --> $DIR/conf_french_blacklisted_name.rs:13:9
    |
-13 |     let tata = 42; //~ERROR use of a blacklisted/placeholder name `tata`
+13 |     let tata = 42;
    |         ^^^^
 
 error: use of a blacklisted/placeholder name `titi`
   --> $DIR/conf_french_blacklisted_name.rs:14:9
    |
-14 |     let titi = 42; //~ERROR use of a blacklisted/placeholder name `titi`
+14 |     let titi = 42;
    |         ^^^^
 
 error: use of a blacklisted/placeholder name `toto`
index f26f581f5c014d1e8b710a4ba9ec0f838623d062..ba78ccce7159abf7c538ddbd6dba286381b167dd 100644 (file)
@@ -1,6 +1,6 @@
 #![feature(attr_literals)]
 #![feature(plugin)]
 #![plugin(clippy(conf_file=42))]
-//~^ ERROR `conf_file` value must be a string
+
 
 fn main() {}
index 9b1e1ec801ec92670b399b557d9ceeca46d08bc5..15c1491417677fd4d17d084d9f6205a56ee274f7 100644 (file)
@@ -28,7 +28,7 @@ pub enum Abc {
 #[deny(match_same_arms)]
 fn if_same_then_else() -> Result<&'static str, ()> {
     if true {
-        //~^NOTE same as this
+
         Foo { bar: 42 };
         0..10;
         ..;
@@ -37,7 +37,7 @@ fn if_same_then_else() -> Result<&'static str, ()> {
         0...10;
         foo();
     }
-    else { //~ERROR this `if` has identical blocks
+    else {
         Foo { bar: 42 };
         0..10;
         ..;
@@ -78,8 +78,8 @@ fn if_same_then_else() -> Result<&'static str, ()> {
 
     let _ = match 42 {
         42 => {
-            //~^ NOTE same as this
-            //~| NOTE removing
+
+
             foo();
             let mut a = 42 + [23].len() as i32;
             if true {
@@ -88,7 +88,7 @@ fn if_same_then_else() -> Result<&'static str, ()> {
             a = -31-a;
             a
         }
-        _ => { //~ERROR this `match` has identical arm bodies
+        _ => {
             foo();
             let mut a = 42 + [23].len() as i32;
             if true {
@@ -101,10 +101,10 @@ fn if_same_then_else() -> Result<&'static str, ()> {
 
     let _ = match Abc::A {
         Abc::A => 0,
-        //~^ NOTE same as this
-        //~| NOTE removing
+
+
         Abc::B => 1,
-        _ => 0, //~ERROR this `match` has identical arm bodies
+        _ => 0,
     };
 
     if true {
@@ -112,15 +112,15 @@ fn if_same_then_else() -> Result<&'static str, ()> {
     }
 
     let _ = if true {
-        //~^NOTE same as this
+
         42
     }
-    else { //~ERROR this `if` has identical blocks
+    else {
         42
     };
 
     if true {
-        //~^NOTE same as this
+
         for _ in &[42] {
             let foo: &Option<_> = &Some::<u8>(42);
             if true {
@@ -130,7 +130,7 @@ fn if_same_then_else() -> Result<&'static str, ()> {
             }
         }
     }
-    else { //~ERROR this `if` has identical blocks
+    else {
         for _ in &[42] {
             let foo: &Option<_> = &Some::<u8>(42);
             if true {
@@ -142,7 +142,7 @@ fn if_same_then_else() -> Result<&'static str, ()> {
     }
 
     if true {
-        //~^NOTE same as this
+
         let bar = if true {
             42
         }
@@ -153,7 +153,7 @@ fn if_same_then_else() -> Result<&'static str, ()> {
         while foo() { break; }
         bar + 1;
     }
-    else { //~ERROR this `if` has identical blocks
+    else {
         let bar = if true {
             42
         }
@@ -166,7 +166,7 @@ fn if_same_then_else() -> Result<&'static str, ()> {
     }
 
     if true {
-        //~^NOTE same as this
+
         let _ = match 42 {
             42 => 1,
             a if a > 0 => 2,
@@ -177,7 +177,7 @@ fn if_same_then_else() -> Result<&'static str, ()> {
     else if false {
         foo();
     }
-    else if foo() { //~ERROR this `if` has identical blocks
+    else if foo() {
         let _ = match 42 {
             42 => 1,
             a if a > 0 => 2,
@@ -187,18 +187,18 @@ fn if_same_then_else() -> Result<&'static str, ()> {
     }
 
     if true {
-        //~^NOTE same as this
+
         if let Some(a) = Some(42) {}
     }
-    else { //~ERROR this `if` has identical blocks
+    else {
         if let Some(a) = Some(42) {}
     }
 
     if true {
-        //~^NOTE same as this
+
         if let (1, .., 3) = (1, 2, 3) {}
     }
-    else { //~ERROR this `if` has identical blocks
+    else {
         if let (1, .., 3) = (1, 2, 3) {}
     }
 
@@ -253,17 +253,17 @@ fn if_same_then_else() -> Result<&'static str, ()> {
 
     let _ = match 42 {
         42 => foo(),
-        //~^NOTE same as this
-        //~|NOTE `42 | 51`
-        51 => foo(), //~ERROR this `match` has identical arm bodies
+
+
+        51 => foo(),
         _ => true,
     };
 
     let _ = match Some(42) {
         Some(_) => 24,
-        //~^NOTE same as this
-        //~|NOTE `Some(_) | None`
-        None => 24, //~ERROR this `match` has identical arm bodies
+
+
+        None => 24,
     };
 
     let _ = match Some(42) {
@@ -285,39 +285,39 @@ fn if_same_then_else() -> Result<&'static str, ()> {
 
     match (Some(42), Some(42)) {
         (Some(a), None) => bar(a),
-        //~^NOTE same as this
-        //~|NOTE `(Some(a), None) | (None, Some(a))`
-        (None, Some(a)) => bar(a), //~ERROR this `match` has identical arm bodies
+
+
+        (None, Some(a)) => bar(a),
         _ => (),
     }
 
     match (Some(42), Some(42)) {
         (Some(a), ..) => bar(a),
-        //~^NOTE same as this
-        //~|NOTE `(Some(a), ..) | (.., Some(a))`
-        (.., Some(a)) => bar(a), //~ERROR this `match` has identical arm bodies
+
+
+        (.., Some(a)) => bar(a),
         _ => (),
     }
 
     match (1, 2, 3) {
         (1, .., 3) => 42,
-        //~^NOTE same as this
-        //~|NOTE `(1, .., 3) | (.., 3)`
-        (.., 3) => 42, //~ERROR this `match` has identical arm bodies
+
+
+        (.., 3) => 42,
         _ => 0,
     };
 
     let _ = if true {
-        //~^NOTE same as this
+
         0.0
-    } else { //~ERROR this `if` has identical blocks
+    } else {
         0.0
     };
 
     let _ = if true {
-        //~^NOTE same as this
+
         -0.0
-    } else { //~ERROR this `if` has identical blocks
+    } else {
         -0.0
     };
 
@@ -336,9 +336,9 @@ fn if_same_then_else() -> Result<&'static str, ()> {
 
     // Same NaNs
     let _ = if true {
-        //~^NOTE same as this
+
         std::f32::NAN
-    } else { //~ERROR this `if` has identical blocks
+    } else {
         std::f32::NAN
     };
 
@@ -354,15 +354,15 @@ fn if_same_then_else() -> Result<&'static str, ()> {
     }
 
     if true {
-        //~^NOTE same as this
+
         try!(Ok("foo"));
     }
-    else { //~ERROR this `if` has identical blocks
+    else {
         try!(Ok("foo"));
     }
 
     if true {
-        //~^NOTE same as this
+
         let foo = "";
         return Ok(&foo[0..]);
     }
@@ -370,7 +370,7 @@ fn if_same_then_else() -> Result<&'static str, ()> {
         let foo = "bar";
         return Ok(&foo[0..]);
     }
-    else { //~ERROR this `if` has identical blocks
+    else {
         let foo = "";
         return Ok(&foo[0..]);
     }
@@ -383,23 +383,23 @@ fn ifs_same_cond() {
     let b = false;
 
     if b {
-        //~^NOTE same as this
+
     }
-    else if b { //~ERROR this `if` has the same condition as a previous if
+    else if b {
     }
 
     if a == 1 {
-        //~^NOTE same as this
+
     }
-    else if a == 1 { //~ERROR this `if` has the same condition as a previous if
+    else if a == 1 {
     }
 
     if 2*a == 1 {
-        //~^NOTE same as this
+
     }
     else if 2*a == 2 {
     }
-    else if 2*a == 1 { //~ERROR this `if` has the same condition as a previous if
+    else if 2*a == 1 {
     }
     else if a == 1 {
     }
index 634eb5d546f208dc71f8d2dc3a27a7a1fa912532..7f5cfe070bf1ea00a71e60d12a0d544afe9c6138 100644 (file)
@@ -1,7 +1,7 @@
 error: this `if` has identical blocks
   --> $DIR/copies.rs:40:10
    |
-40 |       else { //~ERROR this `if` has identical blocks
+40 |       else {
    |  __________^ starting here...
 41 | |         Foo { bar: 42 };
 42 | |         0..10;
@@ -27,7 +27,7 @@ note: same as this
 error: this `match` has identical arm bodies
   --> $DIR/copies.rs:91:14
    |
-91 |           _ => { //~ERROR this `match` has identical arm bodies
+91 |           _ => {
    |  ______________^ starting here...
 92 | |             foo();
 93 | |             let mut a = 42 + [23].len() as i32;
@@ -58,7 +58,7 @@ note: `42` has the same arm body as the `_` wildcard, consider removing it`
 error: this `match` has identical arm bodies
    --> $DIR/copies.rs:107:14
     |
-107 |         _ => 0, //~ERROR this `match` has identical arm bodies
+107 |         _ => 0,
     |              ^
     |
 note: same as this
@@ -75,7 +75,7 @@ note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
 error: this `if` has identical blocks
    --> $DIR/copies.rs:118:10
     |
-118 |       else { //~ERROR this `if` has identical blocks
+118 |       else {
     |  __________^ starting here...
 119 | |         42
 120 | |     };
@@ -86,7 +86,7 @@ note: same as this
     |
 114 |       let _ = if true {
     |  _____________________^ starting here...
-115 | |         //~^NOTE same as this
+115 | |
 116 | |         42
 117 | |     }
     | |_____^ ...ending here
@@ -94,7 +94,7 @@ note: same as this
 error: this `if` has identical blocks
    --> $DIR/copies.rs:133:10
     |
-133 |     else { //~ERROR this `if` has identical blocks
+133 |     else {
     |          ^
     |
 note: same as this
@@ -106,7 +106,7 @@ note: same as this
 error: this `if` has identical blocks
    --> $DIR/copies.rs:156:10
     |
-156 |     else { //~ERROR this `if` has identical blocks
+156 |     else {
     |          ^
     |
 note: same as this
@@ -118,7 +118,7 @@ note: same as this
 error: this `if` has identical blocks
    --> $DIR/copies.rs:180:19
     |
-180 |       else if foo() { //~ERROR this `if` has identical blocks
+180 |       else if foo() {
     |  ___________________^ starting here...
 181 | |         let _ = match 42 {
 182 | |             42 => 1,
@@ -134,7 +134,7 @@ note: same as this
     |
 168 |       if true {
     |  _____________^ starting here...
-169 | |         //~^NOTE same as this
+169 | |
 170 | |         let _ = match 42 {
 171 | |             42 => 1,
 172 | |             a if a > 0 => 2,
@@ -147,7 +147,7 @@ note: same as this
 error: this `if` has identical blocks
    --> $DIR/copies.rs:193:10
     |
-193 |       else { //~ERROR this `if` has identical blocks
+193 |       else {
     |  __________^ starting here...
 194 | |         if let Some(a) = Some(42) {}
 195 | |     }
@@ -158,7 +158,7 @@ note: same as this
     |
 189 |       if true {
     |  _____________^ starting here...
-190 | |         //~^NOTE same as this
+190 | |
 191 | |         if let Some(a) = Some(42) {}
 192 | |     }
     | |_____^ ...ending here
@@ -166,7 +166,7 @@ note: same as this
 error: this `if` has identical blocks
    --> $DIR/copies.rs:201:10
     |
-201 |       else { //~ERROR this `if` has identical blocks
+201 |       else {
     |  __________^ starting here...
 202 | |         if let (1, .., 3) = (1, 2, 3) {}
 203 | |     }
@@ -177,7 +177,7 @@ note: same as this
     |
 197 |       if true {
     |  _____________^ starting here...
-198 | |         //~^NOTE same as this
+198 | |
 199 | |         if let (1, .., 3) = (1, 2, 3) {}
 200 | |     }
     | |_____^ ...ending here
@@ -185,7 +185,7 @@ note: same as this
 error: this `match` has identical arm bodies
    --> $DIR/copies.rs:258:15
     |
-258 |         51 => foo(), //~ERROR this `match` has identical arm bodies
+258 |         51 => foo(),
     |               ^^^^^
     |
 note: same as this
@@ -202,7 +202,7 @@ note: consider refactoring into `42 | 51`
 error: this `match` has identical arm bodies
    --> $DIR/copies.rs:266:17
     |
-266 |         None => 24, //~ERROR this `match` has identical arm bodies
+266 |         None => 24,
     |                 ^^
     |
 note: same as this
@@ -219,7 +219,7 @@ note: consider refactoring into `Some(_) | None`
 error: this `match` has identical arm bodies
    --> $DIR/copies.rs:290:28
     |
-290 |         (None, Some(a)) => bar(a), //~ERROR this `match` has identical arm bodies
+290 |         (None, Some(a)) => bar(a),
     |                            ^^^^^^
     |
 note: same as this
@@ -236,7 +236,7 @@ note: consider refactoring into `(Some(a), None) | (None, Some(a))`
 error: this `match` has identical arm bodies
    --> $DIR/copies.rs:298:26
     |
-298 |         (.., Some(a)) => bar(a), //~ERROR this `match` has identical arm bodies
+298 |         (.., Some(a)) => bar(a),
     |                          ^^^^^^
     |
 note: same as this
@@ -253,7 +253,7 @@ note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
 error: this `match` has identical arm bodies
    --> $DIR/copies.rs:306:20
     |
-306 |         (.., 3) => 42, //~ERROR this `match` has identical arm bodies
+306 |         (.., 3) => 42,
     |                    ^^
     |
 note: same as this
@@ -270,7 +270,7 @@ note: consider refactoring into `(1, .., 3) | (.., 3)`
 error: this `if` has identical blocks
    --> $DIR/copies.rs:313:12
     |
-313 |       } else { //~ERROR this `if` has identical blocks
+313 |       } else {
     |  ____________^ starting here...
 314 | |         0.0
 315 | |     };
@@ -281,15 +281,15 @@ note: same as this
     |
 310 |       let _ = if true {
     |  _____________________^ starting here...
-311 | |         //~^NOTE same as this
+311 | |
 312 | |         0.0
-313 | |     } else { //~ERROR this `if` has identical blocks
+313 | |     } else {
     | |_____^ ...ending here
 
 error: this `if` has identical blocks
    --> $DIR/copies.rs:320:12
     |
-320 |       } else { //~ERROR this `if` has identical blocks
+320 |       } else {
     |  ____________^ starting here...
 321 | |         -0.0
 322 | |     };
@@ -300,15 +300,15 @@ note: same as this
     |
 317 |       let _ = if true {
     |  _____________________^ starting here...
-318 | |         //~^NOTE same as this
+318 | |
 319 | |         -0.0
-320 | |     } else { //~ERROR this `if` has identical blocks
+320 | |     } else {
     | |_____^ ...ending here
 
 error: this `if` has identical blocks
    --> $DIR/copies.rs:341:12
     |
-341 |       } else { //~ERROR this `if` has identical blocks
+341 |       } else {
     |  ____________^ starting here...
 342 | |         std::f32::NAN
 343 | |     };
@@ -319,15 +319,15 @@ note: same as this
     |
 338 |       let _ = if true {
     |  _____________________^ starting here...
-339 | |         //~^NOTE same as this
+339 | |
 340 | |         std::f32::NAN
-341 | |     } else { //~ERROR this `if` has identical blocks
+341 | |     } else {
     | |_____^ ...ending here
 
 error: this `if` has identical blocks
    --> $DIR/copies.rs:360:10
     |
-360 |       else { //~ERROR this `if` has identical blocks
+360 |       else {
     |  __________^ starting here...
 361 | |         try!(Ok("foo"));
 362 | |     }
@@ -338,7 +338,7 @@ note: same as this
     |
 356 |       if true {
     |  _____________^ starting here...
-357 | |         //~^NOTE same as this
+357 | |
 358 | |         try!(Ok("foo"));
 359 | |     }
     | |_____^ ...ending here
@@ -346,7 +346,7 @@ note: same as this
 error: this `if` has identical blocks
    --> $DIR/copies.rs:373:10
     |
-373 |       else { //~ERROR this `if` has identical blocks
+373 |       else {
     |  __________^ starting here...
 374 | |         let foo = "";
 375 | |         return Ok(&foo[0..]);
@@ -358,7 +358,7 @@ note: same as this
     |
 364 |       if true {
     |  _____________^ starting here...
-365 | |         //~^NOTE same as this
+365 | |
 366 | |         let foo = "";
 367 | |         return Ok(&foo[0..]);
 368 | |     }
@@ -367,7 +367,7 @@ note: same as this
 error: this `if` has the same condition as a previous if
    --> $DIR/copies.rs:388:13
     |
-388 |     else if b { //~ERROR this `if` has the same condition as a previous if
+388 |     else if b {
     |             ^
     |
 note: lint level defined here
@@ -384,7 +384,7 @@ note: same as this
 error: this `if` has the same condition as a previous if
    --> $DIR/copies.rs:394:13
     |
-394 |     else if a == 1 { //~ERROR this `if` has the same condition as a previous if
+394 |     else if a == 1 {
     |             ^^^^^^
     |
 note: same as this
@@ -396,7 +396,7 @@ note: same as this
 error: this `if` has the same condition as a previous if
    --> $DIR/copies.rs:402:13
     |
-402 |     else if 2*a == 1 { //~ERROR this `if` has the same condition as a previous if
+402 |     else if 2*a == 1 {
     |             ^^^^^^^^
     |
 note: same as this
index 30bbcc6cb278a5ab83e3bde153d0022bc0151e66..0b02c937be6a6c494cf3539ddae4e93faa776050 100644 (file)
@@ -4,7 +4,7 @@
 #![deny(cyclomatic_complexity)]
 #![allow(unused)]
 
-fn main() { //~ERROR the function has a cyclomatic complexity of 28
+fn main() {
     if true {
         println!("a");
     }
@@ -89,7 +89,7 @@ fn main() { //~ERROR the function has a cyclomatic complexity of 28
 }
 
 #[cyclomatic_complexity = "0"]
-fn kaboom() {  //~ ERROR: the function has a cyclomatic complexity of 7
+fn kaboom() {
     let n = 0;
     'a: for i in 0..20 {
         'b: for j in i..20 {
@@ -135,18 +135,18 @@ fn bloo() {
 }
 
 #[cyclomatic_complexity = "0"]
-fn lots_of_short_circuits() -> bool { //~ ERROR: the function has a cyclomatic complexity of 1
+fn lots_of_short_circuits() -> bool {
     true && false && true && false && true && false && true
 }
 
 #[cyclomatic_complexity = "0"]
-fn lots_of_short_circuits2() -> bool { //~ ERROR: the function has a cyclomatic complexity of 1
+fn lots_of_short_circuits2() -> bool {
     true || false || true || false || true || false || true
 }
 
 #[cyclomatic_complexity = "0"]
-fn baa() { //~ ERROR: the function has a cyclomatic complexity of 2
-    let x = || match 99 { //~ ERROR: the function has a cyclomatic complexity of 2
+fn baa() {
+    let x = || match 99 {
         0 => 0,
         1 => 1,
         2 => 2,
@@ -163,7 +163,7 @@ fn baa() { //~ ERROR: the function has a cyclomatic complexity of 2
 }
 
 #[cyclomatic_complexity = "0"]
-fn bar() { //~ ERROR: the function has a cyclomatic complexity of 2
+fn bar() {
     match 99 {
         0 => println!("hi"),
         _ => println!("bye"),
@@ -182,7 +182,7 @@ fn dont_warn_on_tests() {
 }
 
 #[cyclomatic_complexity = "0"]
-fn barr() { //~ ERROR: the function has a cyclomatic complexity of 2
+fn barr() {
     match 99 {
         0 => println!("hi"),
         1 => println!("bla"),
@@ -192,7 +192,7 @@ fn barr() { //~ ERROR: the function has a cyclomatic complexity of 2
 }
 
 #[cyclomatic_complexity = "0"]
-fn barr2() { //~ ERROR: the function has a cyclomatic complexity of 3
+fn barr2() {
     match 99 {
         0 => println!("hi"),
         1 => println!("bla"),
@@ -208,7 +208,7 @@ fn barr2() { //~ ERROR: the function has a cyclomatic complexity of 3
 }
 
 #[cyclomatic_complexity = "0"]
-fn barrr() { //~ ERROR: the function has a cyclomatic complexity of 2
+fn barrr() {
     match 99 {
         0 => println!("hi"),
         1 => panic!("bla"),
@@ -218,7 +218,7 @@ fn barrr() { //~ ERROR: the function has a cyclomatic complexity of 2
 }
 
 #[cyclomatic_complexity = "0"]
-fn barrr2() { //~ ERROR: the function has a cyclomatic complexity of 3
+fn barrr2() {
     match 99 {
         0 => println!("hi"),
         1 => panic!("bla"),
@@ -234,7 +234,7 @@ fn barrr2() { //~ ERROR: the function has a cyclomatic complexity of 3
 }
 
 #[cyclomatic_complexity = "0"]
-fn barrrr() { //~ ERROR: the function has a cyclomatic complexity of 2
+fn barrrr() {
     match 99 {
         0 => println!("hi"),
         1 => println!("bla"),
@@ -244,7 +244,7 @@ fn barrrr() { //~ ERROR: the function has a cyclomatic complexity of 2
 }
 
 #[cyclomatic_complexity = "0"]
-fn barrrr2() { //~ ERROR: the function has a cyclomatic complexity of 3
+fn barrrr2() {
     match 99 {
         0 => println!("hi"),
         1 => println!("bla"),
@@ -260,7 +260,7 @@ fn barrrr2() { //~ ERROR: the function has a cyclomatic complexity of 3
 }
 
 #[cyclomatic_complexity = "0"]
-fn cake() { //~ ERROR: the function has a cyclomatic complexity of 2
+fn cake() {
     if 4 == 5 {
         println!("yea");
     } else {
@@ -271,7 +271,7 @@ fn cake() { //~ ERROR: the function has a cyclomatic complexity of 2
 
 
 #[cyclomatic_complexity = "0"]
-pub fn read_file(input_path: &str) -> String { //~ ERROR: the function has a cyclomatic complexity of 4
+pub fn read_file(input_path: &str) -> String {
     use std::fs::File;
     use std::io::{Read, Write};
     use std::path::Path;
@@ -302,7 +302,7 @@ pub fn read_file(input_path: &str) -> String { //~ ERROR: the function has a cyc
 enum Void {}
 
 #[cyclomatic_complexity = "0"]
-fn void(void: Void) { //~ ERROR: the function has a cyclomatic complexity of 1
+fn void(void: Void) {
     if true {
         match void {
         }
@@ -316,7 +316,7 @@ fn mcarton_sees_all() {
 }
 
 #[cyclomatic_complexity = "0"]
-fn try() -> Result<i32, &'static str> { //~ ERROR: cyclomatic complexity of 1
+fn try() -> Result<i32, &'static str> {
     match 5 {
         5 => Ok(5),
         _ => return Err("bla"),
@@ -324,7 +324,7 @@ fn try() -> Result<i32, &'static str> { //~ ERROR: cyclomatic complexity of 1
 }
 
 #[cyclomatic_complexity = "0"]
-fn try_again() -> Result<i32, &'static str> { //~ ERROR: cyclomatic complexity of 1
+fn try_again() -> Result<i32, &'static str> {
     let _ = try!(Ok(42));
     let _ = try!(Ok(43));
     let _ = try!(Ok(44));
@@ -340,7 +340,7 @@ fn try_again() -> Result<i32, &'static str> { //~ ERROR: cyclomatic complexity o
 }
 
 #[cyclomatic_complexity = "0"]
-fn early() -> Result<i32, &'static str> { //~ ERROR: cyclomatic complexity of 1
+fn early() -> Result<i32, &'static str> {
     return Ok(5);
     return Ok(5);
     return Ok(5);
@@ -353,7 +353,7 @@ fn early() -> Result<i32, &'static str> { //~ ERROR: cyclomatic complexity of 1
 }
 
 #[cyclomatic_complexity = "0"]
-fn early_ret() -> i32 { //~ ERROR: cyclomatic complexity of 8
+fn early_ret() -> i32 {
     let a = if true { 42 } else { return 0; };
     let a = if a < 99 { 42 } else { return 0; };
     let a = if a < 99 { 42 } else { return 0; };
index 45f258f95604b40fea8668b5bd46e56626c3d7ee..70eb05e8db6f7e079a3db7ca7bfd921770b0347b 100644 (file)
@@ -1,7 +1,7 @@
 error: the function has a cyclomatic complexity of 28
   --> $DIR/cyclomatic_complexity.rs:7:1
    |
-7  | fn main() { //~ERROR the function has a cyclomatic complexity of 28
+7  | fn main() {
    | ^
    |
 note: lint level defined here
@@ -14,7 +14,7 @@ note: lint level defined here
 error: the function has a cyclomatic complexity of 7
    --> $DIR/cyclomatic_complexity.rs:92:1
     |
-92  | fn kaboom() {  //~ ERROR: the function has a cyclomatic complexity of 7
+92  | fn kaboom() {
     | ^
     |
     = help: you could split it up into multiple smaller functions
@@ -22,7 +22,7 @@ error: the function has a cyclomatic complexity of 7
 error: the function has a cyclomatic complexity of 1
    --> $DIR/cyclomatic_complexity.rs:138:1
     |
-138 |   fn lots_of_short_circuits() -> bool { //~ ERROR: the function has a cyclomatic complexity of 1
+138 |   fn lots_of_short_circuits() -> bool {
     |  _^ starting here...
 139 | |     true && false && true && false && true && false && true
 140 | | }
@@ -33,7 +33,7 @@ error: the function has a cyclomatic complexity of 1
 error: the function has a cyclomatic complexity of 1
    --> $DIR/cyclomatic_complexity.rs:143:1
     |
-143 |   fn lots_of_short_circuits2() -> bool { //~ ERROR: the function has a cyclomatic complexity of 1
+143 |   fn lots_of_short_circuits2() -> bool {
     |  _^ starting here...
 144 | |     true || false || true || false || true || false || true
 145 | | }
@@ -44,7 +44,7 @@ error: the function has a cyclomatic complexity of 1
 error: the function has a cyclomatic complexity of 2
    --> $DIR/cyclomatic_complexity.rs:148:1
     |
-148 | fn baa() { //~ ERROR: the function has a cyclomatic complexity of 2
+148 | fn baa() {
     | ^
     |
     = help: you could split it up into multiple smaller functions
@@ -52,7 +52,7 @@ error: the function has a cyclomatic complexity of 2
 error: the function has a cyclomatic complexity of 2
    --> $DIR/cyclomatic_complexity.rs:149:13
     |
-149 |       let x = || match 99 { //~ ERROR: the function has a cyclomatic complexity of 2
+149 |       let x = || match 99 {
     |  _____________^ starting here...
 150 | |         0 => 0,
 151 | |         1 => 1,
@@ -69,7 +69,7 @@ error: the function has a cyclomatic complexity of 2
 error: the function has a cyclomatic complexity of 2
    --> $DIR/cyclomatic_complexity.rs:166:1
     |
-166 |   fn bar() { //~ ERROR: the function has a cyclomatic complexity of 2
+166 |   fn bar() {
     |  _^ starting here...
 167 | |     match 99 {
 168 | |         0 => println!("hi"),
@@ -83,7 +83,7 @@ error: the function has a cyclomatic complexity of 2
 error: the function has a cyclomatic complexity of 2
    --> $DIR/cyclomatic_complexity.rs:185:1
     |
-185 |   fn barr() { //~ ERROR: the function has a cyclomatic complexity of 2
+185 |   fn barr() {
     |  _^ starting here...
 186 | |     match 99 {
 187 | |         0 => println!("hi"),
@@ -99,7 +99,7 @@ error: the function has a cyclomatic complexity of 2
 error: the function has a cyclomatic complexity of 3
    --> $DIR/cyclomatic_complexity.rs:195:1
     |
-195 | fn barr2() { //~ ERROR: the function has a cyclomatic complexity of 3
+195 | fn barr2() {
     | ^
     |
     = help: you could split it up into multiple smaller functions
@@ -107,7 +107,7 @@ error: the function has a cyclomatic complexity of 3
 error: the function has a cyclomatic complexity of 2
    --> $DIR/cyclomatic_complexity.rs:211:1
     |
-211 |   fn barrr() { //~ ERROR: the function has a cyclomatic complexity of 2
+211 |   fn barrr() {
     |  _^ starting here...
 212 | |     match 99 {
 213 | |         0 => println!("hi"),
@@ -123,7 +123,7 @@ error: the function has a cyclomatic complexity of 2
 error: the function has a cyclomatic complexity of 3
    --> $DIR/cyclomatic_complexity.rs:221:1
     |
-221 | fn barrr2() { //~ ERROR: the function has a cyclomatic complexity of 3
+221 | fn barrr2() {
     | ^
     |
     = help: you could split it up into multiple smaller functions
@@ -131,7 +131,7 @@ error: the function has a cyclomatic complexity of 3
 error: the function has a cyclomatic complexity of 2
    --> $DIR/cyclomatic_complexity.rs:237:1
     |
-237 |   fn barrrr() { //~ ERROR: the function has a cyclomatic complexity of 2
+237 |   fn barrrr() {
     |  _^ starting here...
 238 | |     match 99 {
 239 | |         0 => println!("hi"),
@@ -147,7 +147,7 @@ error: the function has a cyclomatic complexity of 2
 error: the function has a cyclomatic complexity of 3
    --> $DIR/cyclomatic_complexity.rs:247:1
     |
-247 | fn barrrr2() { //~ ERROR: the function has a cyclomatic complexity of 3
+247 | fn barrrr2() {
     | ^
     |
     = help: you could split it up into multiple smaller functions
@@ -155,7 +155,7 @@ error: the function has a cyclomatic complexity of 3
 error: the function has a cyclomatic complexity of 2
    --> $DIR/cyclomatic_complexity.rs:263:1
     |
-263 |   fn cake() { //~ ERROR: the function has a cyclomatic complexity of 2
+263 |   fn cake() {
     |  _^ starting here...
 264 | |     if 4 == 5 {
 265 | |         println!("yea");
@@ -171,7 +171,7 @@ error: the function has a cyclomatic complexity of 2
 error: the function has a cyclomatic complexity of 4
    --> $DIR/cyclomatic_complexity.rs:274:1
     |
-274 | pub fn read_file(input_path: &str) -> String { //~ ERROR: the function has a cyclomatic complexity of 4
+274 | pub fn read_file(input_path: &str) -> String {
     | ^
     |
     = help: you could split it up into multiple smaller functions
@@ -179,7 +179,7 @@ error: the function has a cyclomatic complexity of 4
 error: the function has a cyclomatic complexity of 1
    --> $DIR/cyclomatic_complexity.rs:305:1
     |
-305 |   fn void(void: Void) { //~ ERROR: the function has a cyclomatic complexity of 1
+305 |   fn void(void: Void) {
     |  _^ starting here...
 306 | |     if true {
 307 | |         match void {
@@ -193,7 +193,7 @@ error: the function has a cyclomatic complexity of 1
 error: the function has a cyclomatic complexity of 1
    --> $DIR/cyclomatic_complexity.rs:319:1
     |
-319 |   fn try() -> Result<i32, &'static str> { //~ ERROR: cyclomatic complexity of 1
+319 |   fn try() -> Result<i32, &'static str> {
     |  _^ starting here...
 320 | |     match 5 {
 321 | |         5 => Ok(5),
@@ -207,7 +207,7 @@ error: the function has a cyclomatic complexity of 1
 error: the function has a cyclomatic complexity of 1
    --> $DIR/cyclomatic_complexity.rs:327:1
     |
-327 | fn try_again() -> Result<i32, &'static str> { //~ ERROR: cyclomatic complexity of 1
+327 | fn try_again() -> Result<i32, &'static str> {
     | ^
     |
     = help: you could split it up into multiple smaller functions
@@ -215,7 +215,7 @@ error: the function has a cyclomatic complexity of 1
 error: the function has a cyclomatic complexity of 1
    --> $DIR/cyclomatic_complexity.rs:343:1
     |
-343 | fn early() -> Result<i32, &'static str> { //~ ERROR: cyclomatic complexity of 1
+343 | fn early() -> Result<i32, &'static str> {
     | ^
     |
     = help: you could split it up into multiple smaller functions
@@ -223,7 +223,7 @@ error: the function has a cyclomatic complexity of 1
 error: the function has a cyclomatic complexity of 8
    --> $DIR/cyclomatic_complexity.rs:356:1
     |
-356 | fn early_ret() -> i32 { //~ ERROR: cyclomatic complexity of 8
+356 | fn early_ret() -> i32 {
     | ^
     |
     = help: you could split it up into multiple smaller functions
index f322a7b51da4a5cd0af5b92bb41a09209f1f8c46..143888279796b167c040ed63809e18c9da049788 100644 (file)
@@ -8,7 +8,7 @@ fn main() {
 }
 
 #[cyclomatic_complexity = "0"]
-fn kaboom() {  //~ ERROR: the function has a cyclomatic complexity of 3
+fn kaboom() {
     if 42 == 43 {
         panic!();
     } else if "cake" == "lie" {
index aa87b75058ce4c5cdc16337f3bc5414c287abfc2..f5ee0e7999161e056cb68f19d218f0191c638921 100644 (file)
@@ -1,7 +1,7 @@
 error: the function has a cyclomatic complexity of 3
   --> $DIR/cyclomatic_complexity_attr_used.rs:11:1
    |
-11 |   fn kaboom() {  //~ ERROR: the function has a cyclomatic complexity of 3
+11 |   fn kaboom() {
    |  _^ starting here...
 12 | |     if 42 == 43 {
 13 | |         panic!();
index cf4467f30a59271abe40ea019cf4efdf1890db6f..7274c0fb7ad3c3433a0d3f8d9e86c38c01c0a197 100644 (file)
@@ -16,7 +16,7 @@ fn eq(&self, _: &u64) -> bool { true }
 }
 
 #[derive(Hash)]
-//~^ ERROR you are deriving `Hash` but have implemented `PartialEq` explicitly
+
 struct Bar;
 
 impl PartialEq for Bar {
@@ -24,7 +24,7 @@ fn eq(&self, _: &Bar) -> bool { true }
 }
 
 #[derive(Hash)]
-//~^ ERROR you are deriving `Hash` but have implemented `PartialEq` explicitly
+
 struct Baz;
 
 impl PartialEq<Baz> for Baz {
@@ -35,7 +35,7 @@ fn eq(&self, _: &Baz) -> bool { true }
 struct Bah;
 
 impl Hash for Bah {
-//~^ ERROR you are implementing `Hash` explicitly but have derived `PartialEq`
+
     fn hash<H: Hasher>(&self, _: &mut H) {}
 }
 
@@ -43,7 +43,7 @@ fn hash<H: Hasher>(&self, _: &mut H) {}
 struct Qux;
 
 impl Clone for Qux {
-//~^ ERROR you are implementing `Clone` explicitly on a `Copy` type
+
     fn clone(&self) -> Self { Qux }
 }
 
@@ -68,7 +68,7 @@ struct Lt<'a> {
 }
 
 impl<'a> Clone for Lt<'a> {
-//~^ ERROR you are implementing `Clone` explicitly on a `Copy` type
+
     fn clone(&self) -> Self { unimplemented!() }
 }
 
index 97b5344ee7f71ca97b9604e11c706cf8e03e0a9c..d435b52db4417be75bfd8628f87b45580f528696 100644 (file)
@@ -40,7 +40,7 @@ error: you are implementing `Hash` explicitly but have derived `PartialEq`
    |
 37 |   impl Hash for Bah {
    |  _^ starting here...
-38 | | //~^ ERROR you are implementing `Hash` explicitly but have derived `PartialEq`
+38 | |
 39 | |     fn hash<H: Hasher>(&self, _: &mut H) {}
 40 | | }
    | |_^ ...ending here
@@ -57,7 +57,7 @@ error: you are implementing `Clone` explicitly on a `Copy` type
    |
 45 |   impl Clone for Qux {
    |  _^ starting here...
-46 | | //~^ ERROR you are implementing `Clone` explicitly on a `Copy` type
+46 | |
 47 | |     fn clone(&self) -> Self { Qux }
 48 | | }
    | |_^ ...ending here
@@ -73,7 +73,7 @@ note: consider deriving `Clone` or removing `Copy`
    |
 45 |   impl Clone for Qux {
    |  _^ starting here...
-46 | | //~^ ERROR you are implementing `Clone` explicitly on a `Copy` type
+46 | |
 47 | |     fn clone(&self) -> Self { Qux }
 48 | | }
    | |_^ ...ending here
@@ -83,7 +83,7 @@ error: you are implementing `Clone` explicitly on a `Copy` type
    |
 70 |   impl<'a> Clone for Lt<'a> {
    |  _^ starting here...
-71 | | //~^ ERROR you are implementing `Clone` explicitly on a `Copy` type
+71 | |
 72 | |     fn clone(&self) -> Self { unimplemented!() }
 73 | | }
    | |_^ ...ending here
@@ -94,7 +94,7 @@ note: consider deriving `Clone` or removing `Copy`
    |
 70 |   impl<'a> Clone for Lt<'a> {
    |  _^ starting here...
-71 | | //~^ ERROR you are implementing `Clone` explicitly on a `Copy` type
+71 | |
 72 | |     fn clone(&self) -> Self { unimplemented!() }
 73 | | }
    | |_^ ...ending here
index 02e6d0693d1d86a83061b2f9b78aafdfc094e5ec..57e7a545b7c5b8905265241733cd3411c51c9dff 100644 (file)
@@ -15,8 +15,8 @@ fn foo(&self) -> ! { diverge() }
 #[allow(unused_variables, unnecessary_operation, short_circuit_statement)]
 fn main() {
     let b = true;
-    b || diverge(); //~ ERROR sub-expression diverges
-    b || A.foo(); //~ ERROR sub-expression diverges
+    b || diverge();
+    b || A.foo();
 }
 
 #[allow(dead_code, unused_variables)]
@@ -25,16 +25,16 @@ fn foobar() {
         let x = match 5 {
             4 => return,
             5 => continue,
-            6 => true || return, //~ ERROR sub-expression diverges
-            7 => true || continue, //~ ERROR sub-expression diverges
+            6 => true || return,
+            7 => true || continue,
             8 => break,
             9 => diverge(),
-            3 => true || diverge(), //~ ERROR sub-expression diverges
+            3 => true || diverge(),
             10 => match 42 {
                 99 => return,
                 _ => true || panic!("boo"),
             },
-            _ => true || break, //~ ERROR sub-expression diverges
+            _ => true || break,
         };
     }
 }
index 805a01840de73b32f6ebb4b734cf73fa5ee2bd80..108c228fdc9ef36dddb9d9e47fc319f15867a51b 100644 (file)
@@ -1,7 +1,7 @@
 error: sub-expression diverges
   --> $DIR/diverging_sub_expression.rs:18:10
    |
-18 |     b || diverge(); //~ ERROR sub-expression diverges
+18 |     b || diverge();
    |          ^^^^^^^^^
    |
 note: lint level defined here
@@ -13,31 +13,31 @@ note: lint level defined here
 error: sub-expression diverges
   --> $DIR/diverging_sub_expression.rs:19:10
    |
-19 |     b || A.foo(); //~ ERROR sub-expression diverges
+19 |     b || A.foo();
    |          ^^^^^^^
 
 error: sub-expression diverges
   --> $DIR/diverging_sub_expression.rs:28:26
    |
-28 |             6 => true || return, //~ ERROR sub-expression diverges
+28 |             6 => true || return,
    |                          ^^^^^^
 
 error: sub-expression diverges
   --> $DIR/diverging_sub_expression.rs:29:26
    |
-29 |             7 => true || continue, //~ ERROR sub-expression diverges
+29 |             7 => true || continue,
    |                          ^^^^^^^^
 
 error: sub-expression diverges
   --> $DIR/diverging_sub_expression.rs:32:26
    |
-32 |             3 => true || diverge(), //~ ERROR sub-expression diverges
+32 |             3 => true || diverge(),
    |                          ^^^^^^^^^
 
 error: sub-expression diverges
   --> $DIR/diverging_sub_expression.rs:37:26
    |
-37 |             _ => true || break, //~ ERROR sub-expression diverges
+37 |             _ => true || break,
    |                          ^^^^^
 
 error: aborting due to 6 previous errors
index 63c678eb69c285dabf478fef2ed0b05e223c8e26..10d0beab8344d2ba2213f22ef38ce71a67b223c3 100644 (file)
@@ -10,9 +10,9 @@
 use collections::linked_list::LinkedList;
 
 trait Foo {
-    type Baz = LinkedList<u8>; //~ ERROR I see you're using a LinkedList!
-    fn foo(LinkedList<u8>); //~ ERROR I see you're using a LinkedList!
-    const BAR : Option<LinkedList<u8>>; //~ ERROR I see you're using a LinkedList!
+    type Baz = LinkedList<u8>;
+    fn foo(LinkedList<u8>);
+    const BAR : Option<LinkedList<u8>>;
 }
 
 // ok, we don’t want to warn for implementations, see #605
@@ -23,14 +23,14 @@ fn foo(_: LinkedList<u8>) {}
 
 struct Bar;
 impl Bar {
-    fn foo(_: LinkedList<u8>) {} //~ ERROR I see you're using a LinkedList!
+    fn foo(_: LinkedList<u8>) {}
 }
 
-pub fn test(my_favourite_linked_list: LinkedList<u8>) { //~ ERROR I see you're using a LinkedList!
+pub fn test(my_favourite_linked_list: LinkedList<u8>) {
     println!("{:?}", my_favourite_linked_list)
 }
 
-pub fn test_ret() -> Option<LinkedList<u8>> { //~ ERROR I see you're using a LinkedList!
+pub fn test_ret() -> Option<LinkedList<u8>> {
     unimplemented!();
 }
 
index 1d0507d1e0408e9bd00de8ed7377d04d8c561688..7af01a32ec0278cf7ed91cf87f305ef657e1c5c3 100644 (file)
@@ -1,7 +1,7 @@
 error: I see you're using a LinkedList! Perhaps you meant some other data structure?
   --> $DIR/dlist.rs:13:16
    |
-13 |     type Baz = LinkedList<u8>; //~ ERROR I see you're using a LinkedList!
+13 |     type Baz = LinkedList<u8>;
    |                ^^^^^^^^^^^^^^
    |
    = note: #[deny(linkedlist)] implied by #[deny(clippy)]
@@ -15,7 +15,7 @@ note: lint level defined here
 error: I see you're using a LinkedList! Perhaps you meant some other data structure?
   --> $DIR/dlist.rs:14:12
    |
-14 |     fn foo(LinkedList<u8>); //~ ERROR I see you're using a LinkedList!
+14 |     fn foo(LinkedList<u8>);
    |            ^^^^^^^^^^^^^^
    |
    = note: #[deny(linkedlist)] implied by #[deny(clippy)]
@@ -24,7 +24,7 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct
 error: I see you're using a LinkedList! Perhaps you meant some other data structure?
   --> $DIR/dlist.rs:15:24
    |
-15 |     const BAR : Option<LinkedList<u8>>; //~ ERROR I see you're using a LinkedList!
+15 |     const BAR : Option<LinkedList<u8>>;
    |                        ^^^^^^^^^^^^^^
    |
    = note: #[deny(linkedlist)] implied by #[deny(clippy)]
@@ -33,7 +33,7 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct
 error: I see you're using a LinkedList! Perhaps you meant some other data structure?
   --> $DIR/dlist.rs:26:15
    |
-26 |     fn foo(_: LinkedList<u8>) {} //~ ERROR I see you're using a LinkedList!
+26 |     fn foo(_: LinkedList<u8>) {}
    |               ^^^^^^^^^^^^^^
    |
    = note: #[deny(linkedlist)] implied by #[deny(clippy)]
@@ -42,7 +42,7 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct
 error: I see you're using a LinkedList! Perhaps you meant some other data structure?
   --> $DIR/dlist.rs:29:39
    |
-29 | pub fn test(my_favourite_linked_list: LinkedList<u8>) { //~ ERROR I see you're using a LinkedList!
+29 | pub fn test(my_favourite_linked_list: LinkedList<u8>) {
    |                                       ^^^^^^^^^^^^^^
    |
    = note: #[deny(linkedlist)] implied by #[deny(clippy)]
@@ -51,7 +51,7 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct
 error: I see you're using a LinkedList! Perhaps you meant some other data structure?
   --> $DIR/dlist.rs:33:29
    |
-33 | pub fn test_ret() -> Option<LinkedList<u8>> { //~ ERROR I see you're using a LinkedList!
+33 | pub fn test_ret() -> Option<LinkedList<u8>> {
    |                             ^^^^^^^^^^^^^^
    |
    = note: #[deny(linkedlist)] implied by #[deny(clippy)]
index 84283a8316e9f93cbc281de8a83c1dcb8d38a0b9..1e34b391915e552df222638fc218ea716039675c 100644 (file)
@@ -1,5 +1,5 @@
 //! This file tests for the DOC_MARKDOWN lint
-//~^ ERROR: you should put `DOC_MARKDOWN` between ticks
+
 
 #![feature(plugin)]
 #![plugin(clippy)]
@@ -7,17 +7,17 @@
 #![deny(doc_markdown)]
 
 /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
-//~^ ERROR: you should put `foo_bar` between ticks
-//~| ERROR: you should put `foo::bar` between ticks
+
+
 /// Markdown is _weird_. I mean _really weird_.  This \_ is ok. So is `_`. But not Foo::some_fun
-//~^ ERROR: you should put `Foo::some_fun` between ticks
+
 /// which should be reported only once despite being __doubly bad__.
 /// Here be ::is::a::global:path.
-//~^ ERROR: you should put `is::a::global:path` between ticks
+
 /// That's not code ~NotInCodeBlock~.
-//~^ ERROR: you should put `NotInCodeBlock` between ticks
+
 /// be_sure_we_got_to_the_end_of_it
-//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
+
 fn foo_bar() {
 }
 
@@ -32,7 +32,7 @@ fn foo_bar() {
 /// _foo bar_
 /// ~~~
 /// be_sure_we_got_to_the_end_of_it
-//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
+
 fn multiline_codeblock() {
 }
 
@@ -40,7 +40,7 @@ fn multiline_codeblock() {
 /// multiline
 /// emphasis_.
 /// be_sure_we_got_to_the_end_of_it
-//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
+
 fn test_emphasis() {
 }
 
@@ -55,7 +55,7 @@ fn test_emphasis() {
 /// 32kb 32Mb 32Gb 32Tb 32Pb 32Eb
 /// NaN
 /// be_sure_we_got_to_the_end_of_it
-//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
+
 fn test_units() {
 }
 
@@ -65,15 +65,15 @@ fn test_units() {
 /// `💣`
 /// `❤️`
 /// ß_foo
-//~^ ERROR: you should put `ß_foo` between ticks
+
 /// ℝ_foo
-//~^ ERROR: you should put `ℝ_foo` between ticks
+
 /// 💣_foo
 /// ❤️_foo
 /// foo_ß
-//~^ ERROR: you should put `foo_ß` between ticks
+
 /// foo_ℝ
-//~^ ERROR: you should put `foo_ℝ` between ticks
+
 /// foo_💣
 /// foo_❤️
 /// [ßdummy textß][foo_1ß]
@@ -89,16 +89,16 @@ fn test_units() {
 /// [foo3_💣]: dummy text
 /// [foo4_❤️]: dummy text
 /// be_sure_we_got_to_the_end_of_it
-//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
+
 fn test_unicode() {
 }
 
 /// This test has [a link_with_underscores][chunked-example] inside it. See #823.
-//~^ ERROR: you should put `link_with_underscores` between ticks
+
 /// See also [the issue tracker](https://github.com/Manishearth/rust-clippy/search?q=doc_markdown&type=Issues)
 /// on GitHub (which is a camel-cased word, but is OK). And here is another [inline link][inline_link].
 /// It can also be [inline_link2].
-//~^ ERROR: you should put `inline_link2` between ticks
+
 ///
 /// [chunked-example]: https://en.wikipedia.org/wiki/Chunked_transfer_encoding#Example
 /// [inline_link]: https://foobar
@@ -110,7 +110,7 @@ fn test_unicode() {
 /// expression of the type  `_ <bit_op> m <cmp_op> c` (where `<bit_op>`
 /// is one of {`&`, '|'} and `<cmp_op>` is one of {`!=`, `>=`, `>` ,
 /// be_sure_we_got_to_the_end_of_it
-//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
+
 fn main() {
     foo_bar();
     multiline_codeblock();
@@ -124,9 +124,9 @@ fn main() {
 /// # CamelCaseThing
 ///
 /// Not a title #897 CamelCaseThing
-//~^ ERROR: you should put `CamelCaseThing` between ticks
+
 /// be_sure_we_got_to_the_end_of_it
-//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
+
 fn issue897() {
 }
 
@@ -134,7 +134,7 @@ fn issue897() {
 /// I am confused by brackets? (foo `x_y`)
 /// I am confused by brackets? (`x_y` foo)
 /// be_sure_we_got_to_the_end_of_it
-//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
+
 fn issue900() {
 }
 
@@ -148,7 +148,7 @@ fn issue900() {
 /// [iterator]: https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html
 /// [helper_types]: ../helper_types/index.html
 /// be_sure_we_got_to_the_end_of_it
-//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
+
 fn issue883() {
 }
 
@@ -167,9 +167,9 @@ fn multiline() {
 And BarQuz too.
 be_sure_we_got_to_the_end_of_it
 */
-//~^^^^^^^^ ERROR: you should put `FooBar` between ticks
-//~^^^^ ERROR: you should put `BarQuz` between ticks
-//~^^^^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
+
+
+
 fn issue1073() {
 }
 
@@ -181,9 +181,9 @@ fn issue1073() {
 And BarQuz too.
 be_sure_we_got_to_the_end_of_it
 */
-//~^^^^^^^^ ERROR: you should put `FooBar` between ticks
-//~^^^^ ERROR: you should put `BarQuz` between ticks
-//~^^^^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
+
+
+
 fn issue1073_alt() {
 }
 
@@ -194,6 +194,6 @@ fn issue1073_alt() {
 /// StillDont
 /// ````
 /// be_sure_we_got_to_the_end_of_it
-//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
+
 fn four_quotes() {
 }
index 790ca93728bac6043f026d442fc264d572407aeb..362b3a72dd75d7bef885883560320ee4a887d3b0 100644 (file)
@@ -6,5 +6,5 @@ fn main() {
     let x = 1;
     -x;
     -(-x);
-    --x; //~ERROR: `--x` could be misinterpreted as pre-decrement by C programmers, is usually a no-op
+    --x;
 }
index 2964344029ceb9b406e9f23e2210fde63bfca9f3..aeabbc8dfa905a8a18995b06f7615395ffc4d10b 100644 (file)
@@ -1,7 +1,7 @@
 error: `--x` could be misinterpreted as pre-decrement by C programmers, is usually a no-op
  --> $DIR/double_neg.rs:9:5
   |
-9 |     --x; //~ERROR: `--x` could be misinterpreted as pre-decrement by C programmers, is usually a no-op
+9 |     --x;
   |     ^^^
   |
 note: lint level defined here
index 2e415d7232dff72cd69e42f719d2dd2490f9363d..208482eb6cec3cf9583a5332b9222e73fbb9368c 100644 (file)
@@ -13,23 +13,23 @@ fn dummy_method<T>(self, _: T) {}
 }
 
 fn simple_double_parens() -> i32 {
-    ((0)) //~ERROR Consider removing unnecessary double parentheses
+    ((0))
 }
 
 fn fn_double_parens() {
-    dummy_fn((0)); //~ERROR Consider removing unnecessary double parentheses
+    dummy_fn((0));
 }
 
 fn method_double_parens(x: DummyStruct) {
-    x.dummy_method((0)); //~ERROR Consider removing unnecessary double parentheses
+    x.dummy_method((0));
 }
 
 fn tuple_double_parens() -> (i32, i32) {
-    ((1, 2)) //~ERROR Consider removing unnecessary double parentheses
+    ((1, 2))
 }
 
 fn unit_double_parens() {
-    (()) //~ERROR Consider removing unnecessary double parentheses
+    (())
 }
 
 fn fn_tuple_ok() {
index ba778c656eede5f85a75de8dff3ee27465278741..1011ad1c0141726e7261c70fe881cd228f19a461 100644 (file)
@@ -1,7 +1,7 @@
 error: Consider removing unnecessary double parentheses
   --> $DIR/double_parens.rs:16:5
    |
-16 |     ((0)) //~ERROR Consider removing unnecessary double parentheses
+16 |     ((0))
    |     ^^^^^
    |
 note: lint level defined here
@@ -13,25 +13,25 @@ note: lint level defined here
 error: Consider removing unnecessary double parentheses
   --> $DIR/double_parens.rs:20:14
    |
-20 |     dummy_fn((0)); //~ERROR Consider removing unnecessary double parentheses
+20 |     dummy_fn((0));
    |              ^^^
 
 error: Consider removing unnecessary double parentheses
   --> $DIR/double_parens.rs:24:20
    |
-24 |     x.dummy_method((0)); //~ERROR Consider removing unnecessary double parentheses
+24 |     x.dummy_method((0));
    |                    ^^^
 
 error: Consider removing unnecessary double parentheses
   --> $DIR/double_parens.rs:28:5
    |
-28 |     ((1, 2)) //~ERROR Consider removing unnecessary double parentheses
+28 |     ((1, 2))
    |     ^^^^^^^^
 
 error: Consider removing unnecessary double parentheses
   --> $DIR/double_parens.rs:32:5
    |
-32 |     (()) //~ERROR Consider removing unnecessary double parentheses
+32 |     (())
    |     ^^^^
 
 error: aborting due to 5 previous errors
index 55cfe63dac4c947b6894f89161b7b62330f07f4a..911d3433e4d887e11b7ebd74b204e79a4533d8f9 100644 (file)
@@ -9,43 +9,43 @@
 struct SomeStruct;
 
 fn main() {
-    drop(&SomeStruct); //~ERROR call to `std::mem::drop` with a reference argument
-    forget(&SomeStruct); //~ERROR call to `std::mem::forget` with a reference argument
+    drop(&SomeStruct);
+    forget(&SomeStruct);
 
     let mut owned1 = SomeStruct;
-    drop(&owned1); //~ERROR call to `std::mem::drop` with a reference argument
-    drop(&&owned1); //~ERROR call to `std::mem::drop` with a reference argument
-    drop(&mut owned1); //~ERROR call to `std::mem::drop` with a reference argument
+    drop(&owned1);
+    drop(&&owned1);
+    drop(&mut owned1);
     drop(owned1); //OK
     let mut owned2 = SomeStruct;
-    forget(&owned2); //~ERROR call to `std::mem::forget` with a reference argument
-    forget(&&owned2); //~ERROR call to `std::mem::forget` with a reference argument
-    forget(&mut owned2); //~ERROR call to `std::mem::forget` with a reference argument
+    forget(&owned2);
+    forget(&&owned2);
+    forget(&mut owned2);
     forget(owned2); //OK
 
     let reference1 = &SomeStruct;
-    drop(reference1); //~ERROR call to `std::mem::drop` with a reference argument
-    forget(&*reference1); //~ERROR call to `std::mem::forget` with a reference argument
+    drop(reference1);
+    forget(&*reference1);
 
     let reference2 = &mut SomeStruct;
-    drop(reference2); //~ERROR call to `std::mem::drop` with a reference argument
+    drop(reference2);
     let reference3 = &mut SomeStruct;
-    forget(reference3); //~ERROR call to `std::mem::forget` with a reference argument
+    forget(reference3);
 
     let ref reference4 = SomeStruct;
-    drop(reference4); //~ERROR call to `std::mem::drop` with a reference argument
-    forget(reference4); //~ERROR call to `std::mem::forget` with a reference argument
+    drop(reference4);
+    forget(reference4);
 }
 
 #[allow(dead_code)]
 fn test_generic_fn_drop<T>(val: T) {
-    drop(&val); //~ERROR call to `std::mem::drop` with a reference argument
+    drop(&val);
     drop(val); //OK
 }
 
 #[allow(dead_code)]
 fn test_generic_fn_forget<T>(val: T) {
-    forget(&val); //~ERROR call to `std::mem::forget` with a reference argument
+    forget(&val);
     forget(val); //OK
 }
 
@@ -53,8 +53,8 @@ fn test_generic_fn_forget<T>(val: T) {
 fn test_similarly_named_function() {
     fn drop<T>(_val: T) {}
     drop(&SomeStruct); //OK; call to unrelated function which happens to have the same name
-    std::mem::drop(&SomeStruct); //~ERROR call to `std::mem::drop` with a reference argument
+    std::mem::drop(&SomeStruct);
     fn forget<T>(_val: T) {}
     forget(&SomeStruct); //OK; call to unrelated function which happens to have the same name
-    std::mem::forget(&SomeStruct); //~ERROR call to `std::mem::forget` with a reference argument
+    std::mem::forget(&SomeStruct);
 }
index 346426b723184d9f2f83b62eccb9d178e6e2685b..80c724c19c42426bf924b8418f713a973fc24d43 100644 (file)
@@ -1,7 +1,7 @@
 error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
   --> $DIR/drop_forget_ref.rs:12:5
    |
-12 |     drop(&SomeStruct); //~ERROR call to `std::mem::drop` with a reference argument
+12 |     drop(&SomeStruct);
    |     ^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -12,13 +12,13 @@ note: lint level defined here
 note: argument has type &SomeStruct
   --> $DIR/drop_forget_ref.rs:12:10
    |
-12 |     drop(&SomeStruct); //~ERROR call to `std::mem::drop` with a reference argument
+12 |     drop(&SomeStruct);
    |          ^^^^^^^^^^^
 
 error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
   --> $DIR/drop_forget_ref.rs:13:5
    |
-13 |     forget(&SomeStruct); //~ERROR call to `std::mem::forget` with a reference argument
+13 |     forget(&SomeStruct);
    |     ^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -29,199 +29,199 @@ note: lint level defined here
 note: argument has type &SomeStruct
   --> $DIR/drop_forget_ref.rs:13:12
    |
-13 |     forget(&SomeStruct); //~ERROR call to `std::mem::forget` with a reference argument
+13 |     forget(&SomeStruct);
    |            ^^^^^^^^^^^
 
 error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
   --> $DIR/drop_forget_ref.rs:16:5
    |
-16 |     drop(&owned1); //~ERROR call to `std::mem::drop` with a reference argument
+16 |     drop(&owned1);
    |     ^^^^^^^^^^^^^
    |
 note: argument has type &SomeStruct
   --> $DIR/drop_forget_ref.rs:16:10
    |
-16 |     drop(&owned1); //~ERROR call to `std::mem::drop` with a reference argument
+16 |     drop(&owned1);
    |          ^^^^^^^
 
 error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
   --> $DIR/drop_forget_ref.rs:17:5
    |
-17 |     drop(&&owned1); //~ERROR call to `std::mem::drop` with a reference argument
+17 |     drop(&&owned1);
    |     ^^^^^^^^^^^^^^
    |
 note: argument has type &&SomeStruct
   --> $DIR/drop_forget_ref.rs:17:10
    |
-17 |     drop(&&owned1); //~ERROR call to `std::mem::drop` with a reference argument
+17 |     drop(&&owned1);
    |          ^^^^^^^^
 
 error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
   --> $DIR/drop_forget_ref.rs:18:5
    |
-18 |     drop(&mut owned1); //~ERROR call to `std::mem::drop` with a reference argument
+18 |     drop(&mut owned1);
    |     ^^^^^^^^^^^^^^^^^
    |
 note: argument has type &mut SomeStruct
   --> $DIR/drop_forget_ref.rs:18:10
    |
-18 |     drop(&mut owned1); //~ERROR call to `std::mem::drop` with a reference argument
+18 |     drop(&mut owned1);
    |          ^^^^^^^^^^^
 
 error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
   --> $DIR/drop_forget_ref.rs:21:5
    |
-21 |     forget(&owned2); //~ERROR call to `std::mem::forget` with a reference argument
+21 |     forget(&owned2);
    |     ^^^^^^^^^^^^^^^
    |
 note: argument has type &SomeStruct
   --> $DIR/drop_forget_ref.rs:21:12
    |
-21 |     forget(&owned2); //~ERROR call to `std::mem::forget` with a reference argument
+21 |     forget(&owned2);
    |            ^^^^^^^
 
 error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
   --> $DIR/drop_forget_ref.rs:22:5
    |
-22 |     forget(&&owned2); //~ERROR call to `std::mem::forget` with a reference argument
+22 |     forget(&&owned2);
    |     ^^^^^^^^^^^^^^^^
    |
 note: argument has type &&SomeStruct
   --> $DIR/drop_forget_ref.rs:22:12
    |
-22 |     forget(&&owned2); //~ERROR call to `std::mem::forget` with a reference argument
+22 |     forget(&&owned2);
    |            ^^^^^^^^
 
 error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
   --> $DIR/drop_forget_ref.rs:23:5
    |
-23 |     forget(&mut owned2); //~ERROR call to `std::mem::forget` with a reference argument
+23 |     forget(&mut owned2);
    |     ^^^^^^^^^^^^^^^^^^^
    |
 note: argument has type &mut SomeStruct
   --> $DIR/drop_forget_ref.rs:23:12
    |
-23 |     forget(&mut owned2); //~ERROR call to `std::mem::forget` with a reference argument
+23 |     forget(&mut owned2);
    |            ^^^^^^^^^^^
 
 error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
   --> $DIR/drop_forget_ref.rs:27:5
    |
-27 |     drop(reference1); //~ERROR call to `std::mem::drop` with a reference argument
+27 |     drop(reference1);
    |     ^^^^^^^^^^^^^^^^
    |
 note: argument has type &SomeStruct
   --> $DIR/drop_forget_ref.rs:27:10
    |
-27 |     drop(reference1); //~ERROR call to `std::mem::drop` with a reference argument
+27 |     drop(reference1);
    |          ^^^^^^^^^^
 
 error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
   --> $DIR/drop_forget_ref.rs:28:5
    |
-28 |     forget(&*reference1); //~ERROR call to `std::mem::forget` with a reference argument
+28 |     forget(&*reference1);
    |     ^^^^^^^^^^^^^^^^^^^^
    |
 note: argument has type &SomeStruct
   --> $DIR/drop_forget_ref.rs:28:12
    |
-28 |     forget(&*reference1); //~ERROR call to `std::mem::forget` with a reference argument
+28 |     forget(&*reference1);
    |            ^^^^^^^^^^^^
 
 error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
   --> $DIR/drop_forget_ref.rs:31:5
    |
-31 |     drop(reference2); //~ERROR call to `std::mem::drop` with a reference argument
+31 |     drop(reference2);
    |     ^^^^^^^^^^^^^^^^
    |
 note: argument has type &mut SomeStruct
   --> $DIR/drop_forget_ref.rs:31:10
    |
-31 |     drop(reference2); //~ERROR call to `std::mem::drop` with a reference argument
+31 |     drop(reference2);
    |          ^^^^^^^^^^
 
 error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
   --> $DIR/drop_forget_ref.rs:33:5
    |
-33 |     forget(reference3); //~ERROR call to `std::mem::forget` with a reference argument
+33 |     forget(reference3);
    |     ^^^^^^^^^^^^^^^^^^
    |
 note: argument has type &mut SomeStruct
   --> $DIR/drop_forget_ref.rs:33:12
    |
-33 |     forget(reference3); //~ERROR call to `std::mem::forget` with a reference argument
+33 |     forget(reference3);
    |            ^^^^^^^^^^
 
 error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
   --> $DIR/drop_forget_ref.rs:36:5
    |
-36 |     drop(reference4); //~ERROR call to `std::mem::drop` with a reference argument
+36 |     drop(reference4);
    |     ^^^^^^^^^^^^^^^^
    |
 note: argument has type &SomeStruct
   --> $DIR/drop_forget_ref.rs:36:10
    |
-36 |     drop(reference4); //~ERROR call to `std::mem::drop` with a reference argument
+36 |     drop(reference4);
    |          ^^^^^^^^^^
 
 error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
   --> $DIR/drop_forget_ref.rs:37:5
    |
-37 |     forget(reference4); //~ERROR call to `std::mem::forget` with a reference argument
+37 |     forget(reference4);
    |     ^^^^^^^^^^^^^^^^^^
    |
 note: argument has type &SomeStruct
   --> $DIR/drop_forget_ref.rs:37:12
    |
-37 |     forget(reference4); //~ERROR call to `std::mem::forget` with a reference argument
+37 |     forget(reference4);
    |            ^^^^^^^^^^
 
 error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
   --> $DIR/drop_forget_ref.rs:42:5
    |
-42 |     drop(&val); //~ERROR call to `std::mem::drop` with a reference argument
+42 |     drop(&val);
    |     ^^^^^^^^^^
    |
 note: argument has type &T
   --> $DIR/drop_forget_ref.rs:42:10
    |
-42 |     drop(&val); //~ERROR call to `std::mem::drop` with a reference argument
+42 |     drop(&val);
    |          ^^^^
 
 error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
   --> $DIR/drop_forget_ref.rs:48:5
    |
-48 |     forget(&val); //~ERROR call to `std::mem::forget` with a reference argument
+48 |     forget(&val);
    |     ^^^^^^^^^^^^
    |
 note: argument has type &T
   --> $DIR/drop_forget_ref.rs:48:12
    |
-48 |     forget(&val); //~ERROR call to `std::mem::forget` with a reference argument
+48 |     forget(&val);
    |            ^^^^
 
 error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
   --> $DIR/drop_forget_ref.rs:56:5
    |
-56 |     std::mem::drop(&SomeStruct); //~ERROR call to `std::mem::drop` with a reference argument
+56 |     std::mem::drop(&SomeStruct);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: argument has type &SomeStruct
   --> $DIR/drop_forget_ref.rs:56:20
    |
-56 |     std::mem::drop(&SomeStruct); //~ERROR call to `std::mem::drop` with a reference argument
+56 |     std::mem::drop(&SomeStruct);
    |                    ^^^^^^^^^^^
 
 error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
   --> $DIR/drop_forget_ref.rs:59:5
    |
-59 |     std::mem::forget(&SomeStruct); //~ERROR call to `std::mem::forget` with a reference argument
+59 |     std::mem::forget(&SomeStruct);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: argument has type &SomeStruct
   --> $DIR/drop_forget_ref.rs:59:22
    |
-59 |     std::mem::forget(&SomeStruct); //~ERROR call to `std::mem::forget` with a reference argument
+59 |     std::mem::forget(&SomeStruct);
    |                      ^^^^^^^^^^^
 
 error: aborting due to 18 previous errors
index 4d908e7f02bc94775bd63cf9622a0f4e0fa70c3d..ca02002bcc02a2777938a9d63c6dc4d0217976b3 100644 (file)
@@ -4,10 +4,10 @@
 #![deny(duplicate_underscore_argument)]
 #[allow(dead_code, unused)]
 
-fn join_the_dark_side(darth: i32, _darth: i32) {} //~ERROR `darth` already exists
+fn join_the_dark_side(darth: i32, _darth: i32) {}
 fn join_the_light_side(knight: i32, _master: i32) {} // the Force is strong with this one
 
 fn main() {
     join_the_dark_side(0, 0);
     join_the_light_side(0, 0);
-}
\ No newline at end of file
+}
index 0550aaae566f6b5b85d9d6a8d3e3acf4813c38c0..3e507acd98bb386f778e2082feba759075ed3c30 100644 (file)
@@ -1,7 +1,7 @@
 error: `darth` already exists, having another argument having almost the same name makes code comprehension and documentation more difficult
  --> $DIR/duplicate_underscore_argument.rs:7:23
   |
-7 | fn join_the_dark_side(darth: i32, _darth: i32) {} //~ERROR `darth` already exists
+7 | fn join_the_dark_side(darth: i32, _darth: i32) {}
   |                       ^^^^^
   |
 note: lint level defined here
index ac9b314c00a69e2a6c3e00c493001a996bc19aaf..9f32b7ede10e777150a58a148b7a275b0b0531ce 100644 (file)
@@ -4,8 +4,8 @@
 #![allow(dead_code)]
 #![deny(empty_enum)]
 
-enum Empty {} //~ ERROR enum with no variants
-    //~^ HELP consider using the uninhabited type `!` or a wrapper around it
+enum Empty {}
+
 
 fn main() {
 }
index 93aeb2ddb9ab92e593f48536e8017de5d6eb07d8..2a5e1165fb374b207cfe8a7cddc6b782ab4d68eb 100644 (file)
@@ -1,7 +1,7 @@
 error: enum with no variants
  --> $DIR/empty_enum.rs:7:1
   |
-7 | enum Empty {} //~ ERROR enum with no variants
+7 | enum Empty {}
   | ^^^^^^^^^^^^^
   |
 note: lint level defined here
@@ -12,7 +12,7 @@ note: lint level defined here
 help: consider using the uninhabited type `!` or a wrapper around it
  --> $DIR/empty_enum.rs:7:1
   |
-7 | enum Empty {} //~ ERROR enum with no variants
+7 | enum Empty {}
   | ^^^^^^^^^^^^^
 
 error: aborting due to previous error
index ec3b75abb371c3a7db3605ffe2dc0f624337b25e..816da06b956f5aac3dab4f0782ba213c5fb43517 100644 (file)
@@ -11,51 +11,51 @@ fn foo() {}
 
 fn insert_if_absent0<K: Eq + Hash, V>(m: &mut HashMap<K, V>, k: K, v: V) {
     if !m.contains_key(&k) { m.insert(k, v); }
-    //~^ ERROR usage of `contains_key` followed by `insert` on a `HashMap`
-    //~| HELP consider
-    //~| SUGGESTION m.entry(k).or_insert(v)
+
+
+
 }
 
 fn insert_if_absent1<K: Eq + Hash, V>(m: &mut HashMap<K, V>, k: K, v: V) {
     if !m.contains_key(&k) { foo(); m.insert(k, v); }
-    //~^ ERROR usage of `contains_key` followed by `insert` on a `HashMap`
-    //~| HELP consider
-    //~| SUGGESTION m.entry(k)
+
+
+
 }
 
 fn insert_if_absent2<K: Eq + Hash, V>(m: &mut HashMap<K, V>, k: K, v: V) {
     if !m.contains_key(&k) { m.insert(k, v) } else { None };
-    //~^ ERROR usage of `contains_key` followed by `insert` on a `HashMap`
-    //~| HELP consider
-    //~| SUGGESTION m.entry(k)
+
+
+
 }
 
 fn insert_if_present2<K: Eq + Hash, V>(m: &mut HashMap<K, V>, k: K, v: V) {
     if m.contains_key(&k) { None } else { m.insert(k, v) };
-    //~^ ERROR usage of `contains_key` followed by `insert` on a `HashMap`
-    //~| HELP consider
-    //~| SUGGESTION m.entry(k)
+
+
+
 }
 
 fn insert_if_absent3<K: Eq + Hash, V>(m: &mut HashMap<K, V>, k: K, v: V) {
     if !m.contains_key(&k) { foo(); m.insert(k, v) } else { None };
-    //~^ ERROR usage of `contains_key` followed by `insert` on a `HashMap`
-    //~| HELP consider
-    //~| SUGGESTION m.entry(k)
+
+
+
 }
 
 fn insert_if_present3<K: Eq + Hash, V>(m: &mut HashMap<K, V>, k: K, v: V) {
     if m.contains_key(&k) { None } else { foo(); m.insert(k, v) };
-    //~^ ERROR usage of `contains_key` followed by `insert` on a `HashMap`
-    //~| HELP consider
-    //~| SUGGESTION m.entry(k)
+
+
+
 }
 
 fn insert_in_btreemap<K: Ord, V>(m: &mut BTreeMap<K, V>, k: K, v: V) {
     if !m.contains_key(&k) { foo(); m.insert(k, v) } else { None };
-    //~^ ERROR usage of `contains_key` followed by `insert` on a `BTreeMap`
-    //~| HELP consider
-    //~| SUGGESTION m.entry(k)
+
+
+
 }
 
 fn insert_other_if_absent<K: Eq + Hash, V>(m: &mut HashMap<K, V>, k: K, o: K, v: V) {
index 86539c2b13efe48a4348a011a21a6a3fb3dad0a1..6becdb3c9aeb53cd971c94848d0b6452ed99a894 100644 (file)
@@ -3,13 +3,13 @@
 #![deny(clippy, clippy_pedantic)]
 #![allow(unused_imports, dead_code, missing_docs_in_private_items)]
 
-use std::cmp::Ordering::*; //~ ERROR: don't use glob imports for enum variants
+use std::cmp::Ordering::*;
 
 enum Enum {
     _Foo,
 }
 
-use self::Enum::*; //~ ERROR: don't use glob imports for enum variants
+use self::Enum::*;
 
 fn blarg() {
     use self::Enum::*; // ok, just for a function
index e109269dc2f454a84edaa75259d89a3c43465c36..657ab13ebbe41160499448777825bd1f916c0239 100644 (file)
@@ -1,7 +1,7 @@
 error: don't use glob imports for enum variants
  --> $DIR/enum_glob_use.rs:6:1
   |
-6 | use std::cmp::Ordering::*; //~ ERROR: don't use glob imports for enum variants
+6 | use std::cmp::Ordering::*;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[deny(enum_glob_use)] implied by #[deny(clippy_pedantic)]
@@ -14,7 +14,7 @@ note: lint level defined here
 error: don't use glob imports for enum variants
   --> $DIR/enum_glob_use.rs:12:1
    |
-12 | use self::Enum::*; //~ ERROR: don't use glob imports for enum variants
+12 | use self::Enum::*;
    | ^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(enum_glob_use)] implied by #[deny(clippy_pedantic)]
index 585535f9d999b83f157656cbe5f98e578d69a8f2..8d7a41b986e22ae77d831cf2070654b54ee5d846 100644 (file)
@@ -11,7 +11,7 @@ enum FakeCallType2 {
 }
 
 enum Foo {
-    cFoo, //~ ERROR: Variant name ends with the enum's name
+    cFoo,
     cBar,
     cBaz,
 }
@@ -21,17 +21,17 @@ enum Fooo {
     cBar,
 }
 
-enum Food { //~ ERROR: All variants have the same prefix: `Food`
-    FoodGood, //~ ERROR: Variant name starts with the enum's name
-    FoodMiddle, //~ ERROR: Variant name starts with the enum's name
-    FoodBad, //~ ERROR: Variant name starts with the enum's name
+enum Food {
+    FoodGood,
+    FoodMiddle,
+    FoodBad,
 }
 
 enum Stuff {
     StuffBad, // no error
 }
 
-enum BadCallType { //~ ERROR: All variants have the same prefix: `CallType`
+enum BadCallType {
     CallTypeCall,
     CallTypeCreate,
     CallTypeDestroy,
@@ -42,7 +42,7 @@ enum TwoCallType { // no error
     CallTypeCreate,
 }
 
-enum Consts { //~ ERROR: All variants have the same prefix: `Constant`
+enum Consts {
     ConstantInt,
     ConstantCake,
     ConstantLie,
@@ -75,19 +75,19 @@ enum Sealll {
     WithOut,
 }
 
-enum Seallll { //~ ERROR: All variants have the same prefix: `With`
+enum Seallll {
     WithOutCake,
     WithOutTea,
     WithOut,
 }
 
-enum NonCaps { //~ ERROR: All variants have the same prefix: `Prefix`
+enum NonCaps {
     Prefix的,
     PrefixTea,
     PrefixCake,
 }
 
-pub enum PubSeall { //~ ERROR: All variants have the same prefix:
+pub enum PubSeall {
     WithOutCake,
     WithOutTea,
     WithOut,
index 115fe8ea226feca1fe1fafa50349f49fa45626eb..5ff441605302d2918728da3ad1b1c433b7e0ddcf 100644 (file)
@@ -1,7 +1,7 @@
 error: Variant name ends with the enum's name
   --> $DIR/enum_variants.rs:14:5
    |
-14 |     cFoo, //~ ERROR: Variant name ends with the enum's name
+14 |     cFoo,
    |     ^^^^
    |
    = note: #[deny(enum_variant_names)] implied by #[deny(clippy)]
@@ -14,7 +14,7 @@ note: lint level defined here
 error: Variant name starts with the enum's name
   --> $DIR/enum_variants.rs:25:5
    |
-25 |     FoodGood, //~ ERROR: Variant name starts with the enum's name
+25 |     FoodGood,
    |     ^^^^^^^^
    |
    = note: #[deny(enum_variant_names)] implied by #[deny(clippy)]
@@ -22,7 +22,7 @@ error: Variant name starts with the enum's name
 error: Variant name starts with the enum's name
   --> $DIR/enum_variants.rs:26:5
    |
-26 |     FoodMiddle, //~ ERROR: Variant name starts with the enum's name
+26 |     FoodMiddle,
    |     ^^^^^^^^^^
    |
    = note: #[deny(enum_variant_names)] implied by #[deny(clippy)]
@@ -30,7 +30,7 @@ error: Variant name starts with the enum's name
 error: Variant name starts with the enum's name
   --> $DIR/enum_variants.rs:27:5
    |
-27 |     FoodBad, //~ ERROR: Variant name starts with the enum's name
+27 |     FoodBad,
    |     ^^^^^^^
    |
    = note: #[deny(enum_variant_names)] implied by #[deny(clippy)]
@@ -38,11 +38,11 @@ error: Variant name starts with the enum's name
 error: All variants have the same prefix: `Food`
   --> $DIR/enum_variants.rs:24:1
    |
-24 |   enum Food { //~ ERROR: All variants have the same prefix: `Food`
+24 |   enum Food {
    |  _^ starting here...
-25 | |     FoodGood, //~ ERROR: Variant name starts with the enum's name
-26 | |     FoodMiddle, //~ ERROR: Variant name starts with the enum's name
-27 | |     FoodBad, //~ ERROR: Variant name starts with the enum's name
+25 | |     FoodGood,
+26 | |     FoodMiddle,
+27 | |     FoodBad,
 28 | | }
    | |_^ ...ending here
    |
@@ -52,7 +52,7 @@ error: All variants have the same prefix: `Food`
 error: All variants have the same prefix: `CallType`
   --> $DIR/enum_variants.rs:34:1
    |
-34 |   enum BadCallType { //~ ERROR: All variants have the same prefix: `CallType`
+34 |   enum BadCallType {
    |  _^ starting here...
 35 | |     CallTypeCall,
 36 | |     CallTypeCreate,
@@ -66,7 +66,7 @@ error: All variants have the same prefix: `CallType`
 error: All variants have the same prefix: `Constant`
   --> $DIR/enum_variants.rs:45:1
    |
-45 |   enum Consts { //~ ERROR: All variants have the same prefix: `Constant`
+45 |   enum Consts {
    |  _^ starting here...
 46 | |     ConstantInt,
 47 | |     ConstantCake,
@@ -80,7 +80,7 @@ error: All variants have the same prefix: `Constant`
 error: All variants have the same prefix: `With`
   --> $DIR/enum_variants.rs:78:1
    |
-78 |   enum Seallll { //~ ERROR: All variants have the same prefix: `With`
+78 |   enum Seallll {
    |  _^ starting here...
 79 | |     WithOutCake,
 80 | |     WithOutTea,
@@ -94,7 +94,7 @@ error: All variants have the same prefix: `With`
 error: All variants have the same prefix: `Prefix`
   --> $DIR/enum_variants.rs:84:1
    |
-84 |   enum NonCaps { //~ ERROR: All variants have the same prefix: `Prefix`
+84 |   enum NonCaps {
    |  _^ starting here...
 85 | |     Prefix的,
 86 | |     PrefixTea,
@@ -108,7 +108,7 @@ error: All variants have the same prefix: `Prefix`
 error: All variants have the same prefix: `With`
   --> $DIR/enum_variants.rs:90:1
    |
-90 |   pub enum PubSeall { //~ ERROR: All variants have the same prefix:
+90 |   pub enum PubSeall {
    |  _^ starting here...
 91 | |     WithOutCake,
 92 | |     WithOutTea,
index c342bf8f332b3f694dca74f34878591b9628d1d1..9b4cdbb56b817a5f667a0e232499b1537cf1d172 100644 (file)
@@ -7,34 +7,34 @@
 
 #[repr(usize)]
 enum NonPortable {
-    X = 0x1_0000_0000, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+    X = 0x1_0000_0000,
     Y = 0,
     Z = 0x7FFF_FFFF,
     A = 0xFFFF_FFFF,
 }
 
 enum NonPortableNoHint {
-    X = 0x1_0000_0000, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+    X = 0x1_0000_0000,
     Y = 0,
     Z = 0x7FFF_FFFF,
-    A = 0xFFFF_FFFF, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+    A = 0xFFFF_FFFF,
 }
 
 #[repr(isize)]
 enum NonPortableSigned {
     X = -1,
     Y = 0x7FFF_FFFF,
-    Z = 0xFFFF_FFFF, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
-    A = 0x1_0000_0000, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+    Z = 0xFFFF_FFFF,
+    A = 0x1_0000_0000,
     B = std::i32::MIN as isize,
-    C = (std::i32::MIN as isize) - 1, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+    C = (std::i32::MIN as isize) - 1,
 }
 
 enum NonPortableSignedNoHint {
     X = -1,
     Y = 0x7FFF_FFFF,
-    Z = 0xFFFF_FFFF, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
-    A = 0x1_0000_0000, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+    Z = 0xFFFF_FFFF,
+    A = 0x1_0000_0000,
 }
 
 /*
index a3b7ba411dfb7afa873d07067065fe8d8d054e45..0bfb732feb565cb12ecc7de87ff7018ced450fcc 100644 (file)
@@ -1,7 +1,7 @@
 error: Clike enum variant discriminant is not portable to 32-bit targets
   --> $DIR/enums_clike.rs:10:5
    |
-10 |     X = 0x1_0000_0000, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+10 |     X = 0x1_0000_0000,
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(enum_clike_unportable_variant)] implied by #[deny(clippy)]
@@ -14,7 +14,7 @@ note: lint level defined here
 error: Clike enum variant discriminant is not portable to 32-bit targets
   --> $DIR/enums_clike.rs:17:5
    |
-17 |     X = 0x1_0000_0000, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+17 |     X = 0x1_0000_0000,
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(enum_clike_unportable_variant)] implied by #[deny(clippy)]
@@ -22,7 +22,7 @@ error: Clike enum variant discriminant is not portable to 32-bit targets
 error: Clike enum variant discriminant is not portable to 32-bit targets
   --> $DIR/enums_clike.rs:20:5
    |
-20 |     A = 0xFFFF_FFFF, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+20 |     A = 0xFFFF_FFFF,
    |     ^^^^^^^^^^^^^^^
    |
    = note: #[deny(enum_clike_unportable_variant)] implied by #[deny(clippy)]
@@ -30,7 +30,7 @@ error: Clike enum variant discriminant is not portable to 32-bit targets
 error: Clike enum variant discriminant is not portable to 32-bit targets
   --> $DIR/enums_clike.rs:27:5
    |
-27 |     Z = 0xFFFF_FFFF, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+27 |     Z = 0xFFFF_FFFF,
    |     ^^^^^^^^^^^^^^^
    |
    = note: #[deny(enum_clike_unportable_variant)] implied by #[deny(clippy)]
@@ -38,7 +38,7 @@ error: Clike enum variant discriminant is not portable to 32-bit targets
 error: Clike enum variant discriminant is not portable to 32-bit targets
   --> $DIR/enums_clike.rs:28:5
    |
-28 |     A = 0x1_0000_0000, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+28 |     A = 0x1_0000_0000,
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(enum_clike_unportable_variant)] implied by #[deny(clippy)]
@@ -46,7 +46,7 @@ error: Clike enum variant discriminant is not portable to 32-bit targets
 error: Clike enum variant discriminant is not portable to 32-bit targets
   --> $DIR/enums_clike.rs:30:5
    |
-30 |     C = (std::i32::MIN as isize) - 1, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+30 |     C = (std::i32::MIN as isize) - 1,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(enum_clike_unportable_variant)] implied by #[deny(clippy)]
@@ -54,7 +54,7 @@ error: Clike enum variant discriminant is not portable to 32-bit targets
 error: Clike enum variant discriminant is not portable to 32-bit targets
   --> $DIR/enums_clike.rs:36:5
    |
-36 |     Z = 0xFFFF_FFFF, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+36 |     Z = 0xFFFF_FFFF,
    |     ^^^^^^^^^^^^^^^
    |
    = note: #[deny(enum_clike_unportable_variant)] implied by #[deny(clippy)]
@@ -62,7 +62,7 @@ error: Clike enum variant discriminant is not portable to 32-bit targets
 error: Clike enum variant discriminant is not portable to 32-bit targets
   --> $DIR/enums_clike.rs:37:5
    |
-37 |     A = 0x1_0000_0000, //~ ERROR: Clike enum variant discriminant is not portable to 32-bit targets
+37 |     A = 0x1_0000_0000,
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(enum_clike_unportable_variant)] implied by #[deny(clippy)]
index c133f42277767405e9dd5bf354489c493f0c6ef7..842e5729fcd8fcb907b4a4645a4570d4f93e845e 100644 (file)
@@ -7,56 +7,56 @@
 #[deny(nonminimal_bool)]
 fn main() {
     // simple values and comparisons
-    1 == 1; //~ERROR equal expressions
-    "no" == "no"; //~ERROR equal expressions
+    1 == 1;
+    "no" == "no";
     // even though I agree that no means no ;-)
-    false != false; //~ERROR equal expressions
-    1.5 < 1.5; //~ERROR equal expressions
-    1u64 >= 1u64; //~ERROR equal expressions
+    false != false;
+    1.5 < 1.5;
+    1u64 >= 1u64;
 
     // casts, methods, parentheses
-    (1 as u64) & (1 as u64); //~ERROR equal expressions
-    1 ^ ((((((1)))))); //~ERROR equal expressions
+    (1 as u64) & (1 as u64);
+    1 ^ ((((((1))))));
 
     // unary and binary operators
-    (-(2) < -(2));  //~ERROR equal expressions
+    (-(2) < -(2));
     ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
-          //~^ ERROR equal expressions as operands to `==`
-                    //~^^ ERROR equal expressions as operands to `&`
-                               //~^^^ ERROR equal expressions as operands to `&`
-    (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4; //~ERROR equal expressions
+
+
+
+    (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4;
 
     // various other things
-    ([1] != [1]); //~ERROR equal expressions
-    ((1, 2) != (1, 2)); //~ERROR equal expressions
+    ([1] != [1]);
+    ((1, 2) != (1, 2));
     vec![1, 2, 3] == vec![1, 2, 3]; //no error yet, as we don't match macros
 
     // const folding
-    1 + 1 == 2; //~ERROR equal expressions
-    1 - 1 == 0; //~ERROR equal expressions as operands to `==`
-                //~^ ERROR equal expressions as operands to `-`
+    1 + 1 == 2;
+    1 - 1 == 0;
+
+
+    1 - 1;
+    1 / 1;
+    true && true;
+
+    true || true;
 
-    1 - 1; //~ERROR equal expressions
-    1 / 1; //~ERROR equal expressions
-    true && true; //~ERROR equal expressions
-    //~|ERROR this boolean expression can be simplified
-    true || true; //~ERROR equal expressions
-    //~|ERROR this boolean expression can be simplified
 
     let a: u32 = 0;
     let b: u32 = 0;
 
-    a == b && b == a; //~ERROR equal expressions
-    //~|ERROR this boolean expression can be simplified
-    a != b && b != a; //~ERROR equal expressions
-    //~|ERROR this boolean expression can be simplified
-    a < b && b > a; //~ERROR equal expressions
-    //~|ERROR this boolean expression can be simplified
-    a <= b && b >= a; //~ERROR equal expressions
-    //~|ERROR this boolean expression can be simplified
+    a == b && b == a;
+
+    a != b && b != a;
+
+    a < b && b > a;
+
+    a <= b && b >= a;
+
 
     let mut a = vec![1];
-    a == a; //~ERROR equal expressions
+    a == a;
     2*a.len() == 2*a.len(); // ok, functions
     a.pop() == a.pop(); // ok, functions
 }
index 867156f6c599f722db9b69407aab0c39e5171967..dc2df524df252bcd9f5f6d13641d026913ec2e03 100644 (file)
@@ -1,7 +1,7 @@
 error: this boolean expression can be simplified
   --> $DIR/eq_op.rs:41:5
    |
-41 |     true && true; //~ERROR equal expressions
+41 |     true && true;
    |     ^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -10,57 +10,57 @@ note: lint level defined here
 7  | #[deny(nonminimal_bool)]
    |        ^^^^^^^^^^^^^^^
 help: try
-   |     true; //~ERROR equal expressions
+   |     true;
 
 error: this boolean expression can be simplified
   --> $DIR/eq_op.rs:43:5
    |
-43 |     true || true; //~ERROR equal expressions
+43 |     true || true;
    |     ^^^^^^^^^^^^
    |
 help: try
-   |     true; //~ERROR equal expressions
+   |     true;
 
 error: this boolean expression can be simplified
   --> $DIR/eq_op.rs:49:5
    |
-49 |     a == b && b == a; //~ERROR equal expressions
+49 |     a == b && b == a;
    |     ^^^^^^^^^^^^^^^^
    |
 help: try
-   |     a == b; //~ERROR equal expressions
+   |     a == b;
 
 error: this boolean expression can be simplified
   --> $DIR/eq_op.rs:51:5
    |
-51 |     a != b && b != a; //~ERROR equal expressions
+51 |     a != b && b != a;
    |     ^^^^^^^^^^^^^^^^
    |
 help: try
-   |     a != b; //~ERROR equal expressions
+   |     a != b;
 
 error: this boolean expression can be simplified
   --> $DIR/eq_op.rs:53:5
    |
-53 |     a < b && b > a; //~ERROR equal expressions
+53 |     a < b && b > a;
    |     ^^^^^^^^^^^^^^
    |
 help: try
-   |     a < b; //~ERROR equal expressions
+   |     a < b;
 
 error: this boolean expression can be simplified
   --> $DIR/eq_op.rs:55:5
    |
-55 |     a <= b && b >= a; //~ERROR equal expressions
+55 |     a <= b && b >= a;
    |     ^^^^^^^^^^^^^^^^
    |
 help: try
-   |     a <= b; //~ERROR equal expressions
+   |     a <= b;
 
 error: equal expressions as operands to `==`
   --> $DIR/eq_op.rs:10:5
    |
-10 |     1 == 1; //~ERROR equal expressions
+10 |     1 == 1;
    |     ^^^^^^
    |
 note: lint level defined here
@@ -72,43 +72,43 @@ note: lint level defined here
 error: equal expressions as operands to `==`
   --> $DIR/eq_op.rs:11:5
    |
-11 |     "no" == "no"; //~ERROR equal expressions
+11 |     "no" == "no";
    |     ^^^^^^^^^^^^
 
 error: equal expressions as operands to `!=`
   --> $DIR/eq_op.rs:13:5
    |
-13 |     false != false; //~ERROR equal expressions
+13 |     false != false;
    |     ^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `<`
   --> $DIR/eq_op.rs:14:5
    |
-14 |     1.5 < 1.5; //~ERROR equal expressions
+14 |     1.5 < 1.5;
    |     ^^^^^^^^^
 
 error: equal expressions as operands to `>=`
   --> $DIR/eq_op.rs:15:5
    |
-15 |     1u64 >= 1u64; //~ERROR equal expressions
+15 |     1u64 >= 1u64;
    |     ^^^^^^^^^^^^
 
 error: equal expressions as operands to `&`
   --> $DIR/eq_op.rs:18:5
    |
-18 |     (1 as u64) & (1 as u64); //~ERROR equal expressions
+18 |     (1 as u64) & (1 as u64);
    |     ^^^^^^^^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `^`
   --> $DIR/eq_op.rs:19:5
    |
-19 |     1 ^ ((((((1)))))); //~ERROR equal expressions
+19 |     1 ^ ((((((1))))));
    |     ^^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `<`
   --> $DIR/eq_op.rs:22:5
    |
-22 |     (-(2) < -(2));  //~ERROR equal expressions
+22 |     (-(2) < -(2));
    |     ^^^^^^^^^^^^^
 
 error: equal expressions as operands to `==`
@@ -132,91 +132,91 @@ error: equal expressions as operands to `&`
 error: equal expressions as operands to `==`
   --> $DIR/eq_op.rs:27:5
    |
-27 |     (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4; //~ERROR equal expressions
+27 |     (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `!=`
   --> $DIR/eq_op.rs:30:5
    |
-30 |     ([1] != [1]); //~ERROR equal expressions
+30 |     ([1] != [1]);
    |     ^^^^^^^^^^^^
 
 error: equal expressions as operands to `!=`
   --> $DIR/eq_op.rs:31:5
    |
-31 |     ((1, 2) != (1, 2)); //~ERROR equal expressions
+31 |     ((1, 2) != (1, 2));
    |     ^^^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `==`
   --> $DIR/eq_op.rs:35:5
    |
-35 |     1 + 1 == 2; //~ERROR equal expressions
+35 |     1 + 1 == 2;
    |     ^^^^^^^^^^
 
 error: equal expressions as operands to `==`
   --> $DIR/eq_op.rs:36:5
    |
-36 |     1 - 1 == 0; //~ERROR equal expressions as operands to `==`
+36 |     1 - 1 == 0;
    |     ^^^^^^^^^^
 
 error: equal expressions as operands to `-`
   --> $DIR/eq_op.rs:36:5
    |
-36 |     1 - 1 == 0; //~ERROR equal expressions as operands to `==`
+36 |     1 - 1 == 0;
    |     ^^^^^
 
 error: equal expressions as operands to `-`
   --> $DIR/eq_op.rs:39:5
    |
-39 |     1 - 1; //~ERROR equal expressions
+39 |     1 - 1;
    |     ^^^^^
 
 error: equal expressions as operands to `/`
   --> $DIR/eq_op.rs:40:5
    |
-40 |     1 / 1; //~ERROR equal expressions
+40 |     1 / 1;
    |     ^^^^^
 
 error: equal expressions as operands to `&&`
   --> $DIR/eq_op.rs:41:5
    |
-41 |     true && true; //~ERROR equal expressions
+41 |     true && true;
    |     ^^^^^^^^^^^^
 
 error: equal expressions as operands to `||`
   --> $DIR/eq_op.rs:43:5
    |
-43 |     true || true; //~ERROR equal expressions
+43 |     true || true;
    |     ^^^^^^^^^^^^
 
 error: equal expressions as operands to `&&`
   --> $DIR/eq_op.rs:49:5
    |
-49 |     a == b && b == a; //~ERROR equal expressions
+49 |     a == b && b == a;
    |     ^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `&&`
   --> $DIR/eq_op.rs:51:5
    |
-51 |     a != b && b != a; //~ERROR equal expressions
+51 |     a != b && b != a;
    |     ^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `&&`
   --> $DIR/eq_op.rs:53:5
    |
-53 |     a < b && b > a; //~ERROR equal expressions
+53 |     a < b && b > a;
    |     ^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `&&`
   --> $DIR/eq_op.rs:55:5
    |
-55 |     a <= b && b >= a; //~ERROR equal expressions
+55 |     a <= b && b >= a;
    |     ^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `==`
   --> $DIR/eq_op.rs:59:5
    |
-59 |     a == a; //~ERROR equal expressions
+59 |     a == a;
    |     ^^^^^^
 
 error: aborting due to 32 previous errors
index 1d4bc89ef4923fdf9d3cb775730276a360e7055c..595857b82df45ac3e6d8b97456fc2c1a49c14b4b 100644 (file)
@@ -30,11 +30,11 @@ fn ok_box_trait(boxed_trait: &Box<Z>) {
 }
 
 fn warn_call() {
-    let x = box A; //~ ERROR local variable
+    let x = box A;
     x.foo();
 }
 
-fn warn_arg(x: Box<A>) { //~ ERROR local variable
+fn warn_arg(x: Box<A>) {
     x.foo();
 }
 
@@ -46,16 +46,16 @@ fn nowarn_closure_arg() {
 fn warn_rename_call() {
     let x = box A;
 
-    let y = x; //~ ERROR local variable
+    let y = x;
     y.foo(); // via autoderef
 }
 
 fn warn_notuse() {
-    let bz = box A; //~ ERROR local variable
+    let bz = box A;
 }
 
 fn warn_pass() {
-    let bz = box A; //~ ERROR local variable
+    let bz = box A;
     take_ref(&bz); // via deref coercion
 }
 
@@ -85,7 +85,7 @@ fn take_ref(x: &A) {}
 
 fn nowarn_ref_take() {
     // false positive, should actually warn
-    let x = box A; //~ ERROR local variable
+    let x = box A;
     let y = &x;
     take_box(y);
 }
@@ -98,7 +98,7 @@ fn nowarn_match() {
 }
 
 fn warn_match() {
-    let x = box A; //~ ERROR local variable
+    let x = box A;
     match &x { // not moved
         ref y => ()
     }
@@ -127,5 +127,5 @@ pub struct PeekableSeekable<I: Foo> {
     _peeked: I::Item,
 }
 
-pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () { //~ ERROR local variable doesn't need
+pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () {
 }
index f05f1b32dcf7892b7559e129e509c15dda8af167..e3898e4b2774d07c52de3d4a18e73ab691975f61 100644 (file)
@@ -1,7 +1,7 @@
 error: local variable doesn't need to be boxed here
   --> $DIR/escape_analysis.rs:33:9
    |
-33 |     let x = box A; //~ ERROR local variable
+33 |     let x = box A;
    |         ^
    |
 note: lint level defined here
@@ -13,43 +13,43 @@ note: lint level defined here
 error: local variable doesn't need to be boxed here
   --> $DIR/escape_analysis.rs:37:13
    |
-37 | fn warn_arg(x: Box<A>) { //~ ERROR local variable
+37 | fn warn_arg(x: Box<A>) {
    |             ^
 
 error: local variable doesn't need to be boxed here
   --> $DIR/escape_analysis.rs:49:9
    |
-49 |     let y = x; //~ ERROR local variable
+49 |     let y = x;
    |         ^
 
 error: local variable doesn't need to be boxed here
   --> $DIR/escape_analysis.rs:54:9
    |
-54 |     let bz = box A; //~ ERROR local variable
+54 |     let bz = box A;
    |         ^^
 
 error: local variable doesn't need to be boxed here
   --> $DIR/escape_analysis.rs:58:9
    |
-58 |     let bz = box A; //~ ERROR local variable
+58 |     let bz = box A;
    |         ^^
 
 error: local variable doesn't need to be boxed here
   --> $DIR/escape_analysis.rs:88:9
    |
-88 |     let x = box A; //~ ERROR local variable
+88 |     let x = box A;
    |         ^
 
 error: local variable doesn't need to be boxed here
    --> $DIR/escape_analysis.rs:101:9
     |
-101 |     let x = box A; //~ ERROR local variable
+101 |     let x = box A;
     |         ^
 
 error: local variable doesn't need to be boxed here
    --> $DIR/escape_analysis.rs:130:12
     |
-130 | pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () { //~ ERROR local variable doesn't need
+130 | pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () {
     |            ^^^^^^^^^^^
 
 error: aborting due to 8 previous errors
index c932f8f9a0fe06992e2b76e704520ab16f7a70bb..90ffa61216fdab8106885bc70c65fab9ab05c12c 100644 (file)
@@ -5,20 +5,20 @@
 
 fn main() {
     let a = Some(1u8).map(|a| foo(a));
-    //~^ ERROR redundant closure found
-    //~| HELP remove closure as shown
-    //~| SUGGESTION let a = Some(1u8).map(foo);
+
+
+
     meta(|a| foo(a));
-    //~^ ERROR redundant closure found
-    //~| HELP remove closure as shown
-    //~| SUGGESTION meta(foo);
+
+
+
     let c = Some(1u8).map(|a| {1+2; foo}(a));
-    //~^ ERROR redundant closure found
-    //~| HELP remove closure as shown
-    //~| SUGGESTION let c = Some(1u8).map({1+2; foo});
+
+
+
     let d = Some(1u8).map(|a| foo((|b| foo2(b))(a))); //is adjusted?
     all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted
-    //~^ WARN needless_borrow
+
     unsafe {
         Some(1u8).map(|a| unsafe_fn(a)); // unsafe fn
     }
@@ -26,9 +26,9 @@ fn main() {
     // See #815
     let e = Some(1u8).map(|a| divergent(a));
     let e = Some(1u8).map(|a| generic(a));
-    //~^ ERROR redundant closure found
-    //~| HELP remove closure as shown
-    //~| SUGGESTION map(generic);
+
+
+
     let e = Some(1u8).map(generic);
 
     // See #515
index 0b2605d01bd58f8ce218e98d8d044e5963e505ca..851a199f929f1dec8a303d3e12837fbb27ba17c9 100644 (file)
@@ -6,21 +6,21 @@
 fn main() {
     let mut x = 0;
     let a = { x = 1; 1 } + x;
-                        //~^ ERROR unsequenced read
+
 
     // Example from iss#277
-    x += { x = 20; 2 }; //~ERROR unsequenced read
+    x += { x = 20; 2 };
 
     // Does it work in weird places?
     // ...in the base for a struct expression?
     struct Foo { a: i32, b: i32 };
     let base = Foo { a: 4, b: 5 };
     let foo = Foo { a: x, .. { x = 6; base } };
-                    //~^ ERROR unsequenced read
+
     // ...inside a closure?
     let closure = || {
         let mut x = 0;
-        x += { x = 20; 2 }; //~ERROR unsequenced read
+        x += { x = 20; 2 };
     };
     // ...not across a closure?
     let mut y = 0;
index d47e96862c2019062e8f181f838b96efae7ce3a7..ba985dd907a04137eb7bec9d7a5672bcbc66a4ab 100644 (file)
@@ -18,13 +18,13 @@ note: whether read occurs before this write depends on evaluation order
 error: unsequenced read of a variable
   --> $DIR/eval_order_dependence.rs:12:5
    |
-12 |     x += { x = 20; 2 }; //~ERROR unsequenced read
+12 |     x += { x = 20; 2 };
    |     ^
    |
 note: whether read occurs before this write depends on evaluation order
   --> $DIR/eval_order_dependence.rs:12:12
    |
-12 |     x += { x = 20; 2 }; //~ERROR unsequenced read
+12 |     x += { x = 20; 2 };
    |            ^^^^^^
 
 error: unsequenced read of a variable
@@ -42,13 +42,13 @@ note: whether read occurs before this write depends on evaluation order
 error: unsequenced read of a variable
   --> $DIR/eval_order_dependence.rs:23:9
    |
-23 |         x += { x = 20; 2 }; //~ERROR unsequenced read
+23 |         x += { x = 20; 2 };
    |         ^
    |
 note: whether read occurs before this write depends on evaluation order
   --> $DIR/eval_order_dependence.rs:23:16
    |
-23 |         x += { x = 20; 2 }; //~ERROR unsequenced read
+23 |         x += { x = 20; 2 };
    |                ^^^^^^
 
 error: aborting due to 4 previous errors
index 20803c8d0e858c01f068d5a6664c759e9bb28ff5..922f9fba6a86722f523e351036e322c1bd7fae71 100644 (file)
@@ -5,22 +5,22 @@
 #![allow(missing_docs_in_private_items)]
 
 fn main() {
-    let _: Vec<_> = vec![5; 6].into_iter() //~ERROR called `filter(p).map(q)` on an `Iterator`
+    let _: Vec<_> = vec![5; 6].into_iter()
                               .filter(|&x| x == 0)
                               .map(|x| x * 2)
                               .collect();
 
-    let _: Vec<_> = vec![5_i8; 6].into_iter() //~ERROR called `filter(p).flat_map(q)` on an `Iterator`
+    let _: Vec<_> = vec![5_i8; 6].into_iter()
                                 .filter(|&x| x == 0)
                                 .flat_map(|x| x.checked_mul(2))
                                 .collect();
 
-    let _: Vec<_> = vec![5_i8; 6].into_iter() //~ERROR called `filter_map(p).flat_map(q)` on an `Iterator`
+    let _: Vec<_> = vec![5_i8; 6].into_iter()
                                 .filter_map(|x| x.checked_mul(2))
                                 .flat_map(|x| x.checked_mul(2))
                                 .collect();
 
-    let _: Vec<_> = vec![5_i8; 6].into_iter() //~ERROR called `filter_map(p).map(q)` on an `Iterator`
+    let _: Vec<_> = vec![5_i8; 6].into_iter()
                                 .filter_map(|x| x.checked_mul(2))
                                 .map(|x| x.checked_mul(2))
                                 .collect();
index 495e385d03c7374adaefbedbd0539ba26343cb3f..8de65e0f4c527f6106704b661ef049d47293d62c 100644 (file)
@@ -1,7 +1,7 @@
 error: called `filter(p).map(q)` on an `Iterator`. This is more succinctly expressed by calling `.filter_map(..)` instead.
   --> $DIR/filter_methods.rs:8:21
    |
-8  |       let _: Vec<_> = vec![5; 6].into_iter() //~ERROR called `filter(p).map(q)` on an `Iterator`
+8  |       let _: Vec<_> = vec![5; 6].into_iter()
    |  _____________________^ starting here...
 9  | |                               .filter(|&x| x == 0)
 10 | |                               .map(|x| x * 2)
@@ -17,7 +17,7 @@ note: lint level defined here
 error: called `filter(p).flat_map(q)` on an `Iterator`. This is more succinctly expressed by calling `.flat_map(..)` and filtering by returning an empty Iterator.
   --> $DIR/filter_methods.rs:13:21
    |
-13 |       let _: Vec<_> = vec![5_i8; 6].into_iter() //~ERROR called `filter(p).flat_map(q)` on an `Iterator`
+13 |       let _: Vec<_> = vec![5_i8; 6].into_iter()
    |  _____________________^ starting here...
 14 | |                                 .filter(|&x| x == 0)
 15 | |                                 .flat_map(|x| x.checked_mul(2))
@@ -28,7 +28,7 @@ error: called `filter(p).flat_map(q)` on an `Iterator`. This is more succinctly
 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.
   --> $DIR/filter_methods.rs:18:21
    |
-18 |       let _: Vec<_> = vec![5_i8; 6].into_iter() //~ERROR called `filter_map(p).flat_map(q)` on an `Iterator`
+18 |       let _: Vec<_> = vec![5_i8; 6].into_iter()
    |  _____________________^ starting here...
 19 | |                                 .filter_map(|x| x.checked_mul(2))
 20 | |                                 .flat_map(|x| x.checked_mul(2))
@@ -39,7 +39,7 @@ error: called `filter_map(p).flat_map(q)` on an `Iterator`. This is more succinc
 error: called `filter_map(p).map(q)` on an `Iterator`. This is more succinctly expressed by only calling `.filter_map(..)` instead.
   --> $DIR/filter_methods.rs:23:21
    |
-23 |       let _: Vec<_> = vec![5_i8; 6].into_iter() //~ERROR called `filter_map(p).map(q)` on an `Iterator`
+23 |       let _: Vec<_> = vec![5_i8; 6].into_iter()
    |  _____________________^ starting here...
 24 | |                                 .filter_map(|x| x.checked_mul(2))
 25 | |                                 .map(|x| x.checked_mul(2))
index 314cc721425507dd3ebf3d01c578f93073c51d5c..de897caca08ee46832ca45fe06929e8470755135 100644 (file)
@@ -41,46 +41,46 @@ fn main() {
     ZERO + ZERO != 1.0; //no error, comparison with zero is ok
 
     ONE == 1f32;
-    //~^ ERROR strict comparison of f32 or f64
-    //~| HELP within some error
-    //~| SUGGESTION (ONE - 1f32).abs() < error
+
+
+
     ONE == 1.0 + 0.0;
-    //~^ ERROR strict comparison of f32 or f64
-    //~| HELP within some error
-    //~| SUGGESTION (ONE - (1.0 + 0.0)).abs() < error
+
+
+
 
     ONE + ONE == ZERO + ONE + ONE;
-    //~^ ERROR strict comparison of f32 or f64
-    //~| HELP within some error
-    //~| SUGGESTION (ONE + ONE - (ZERO + ONE + ONE)).abs() < error
+
+
+
 
     ONE != 2.0;
-    //~^ ERROR strict comparison of f32 or f64
-    //~| HELP within some error
-    //~| SUGGESTION (ONE - 2.0).abs() < error
+
+
+
     ONE != 0.0; // no error, comparison with zero is ok
     twice(ONE) != ONE;
-    //~^ ERROR strict comparison of f32 or f64
-    //~| HELP within some error
-    //~| SUGGESTION (twice(ONE) - ONE).abs() < error
+
+
+
     ONE as f64 != 2.0;
-    //~^ ERROR strict comparison of f32 or f64
-    //~| HELP within some error
-    //~| SUGGESTION (ONE as f64 - 2.0).abs() < error
+
+
+
     ONE as f64 != 0.0; // no error, comparison with zero is ok
 
     let x : f64 = 1.0;
 
     x == 1.0;
-    //~^ ERROR strict comparison of f32 or f64
-    //~| HELP within some error
-    //~| SUGGESTION (x - 1.0).abs() < error
+
+
+
     x != 0f64; // no error, comparison with zero is ok
 
     twice(x) != twice(ONE as f64);
-    //~^ ERROR strict comparison of f32 or f64
-    //~| HELP within some error
-    //~| SUGGESTION (twice(x) - twice(ONE as f64)).abs() < error
+
+
+
 
 
     x < 0.0; // no errors, lower or greater comparisons need no fuzzyness
index 09b0431c65669d55381d67b6418073c136ec43b4..42599f85154113044d442159e1536bec0a7912f3 100644 (file)
@@ -16,43 +16,43 @@ fn for_loop_over_option_and_result() {
     // check FOR_LOOP_OVER_OPTION lint
 
     for x in option {
-        //~^ ERROR for loop over `option`, which is an `Option`.
-        //~| HELP consider replacing `for x in option` with `if let Some(x) = option`
+
+
         println!("{}", x);
     }
 
     // check FOR_LOOP_OVER_RESULT lint
 
     for x in result {
-        //~^ ERROR for loop over `result`, which is a `Result`.
-        //~| HELP consider replacing `for x in result` with `if let Ok(x) = result`
+
+
         println!("{}", x);
     }
 
     for x in option.ok_or("x not found") {
-        //~^ ERROR for loop over `option.ok_or("x not found")`, which is a `Result`.
-        //~| HELP consider replacing `for x in option.ok_or("x not found")` with `if let Ok(x) = option.ok_or("x not found")`
+
+
         println!("{}", x);
     }
 
     // make sure LOOP_OVER_NEXT lint takes precedence when next() is the last call in the chain
 
     for x in v.iter().next() {
-        //~^ ERROR you are iterating over `Iterator::next()` which is an Option
+
         println!("{}", x);
     }
 
     // make sure we lint when next() is not the last call in the chain
 
     for x in v.iter().next().and(Some(0)) {
-        //~^ ERROR for loop over `v.iter().next().and(Some(0))`, which is an `Option`
-        //~| HELP consider replacing `for x in v.iter().next().and(Some(0))` with `if let Some(x) = v.iter().next().and(Some(0))`
+
+
         println!("{}", x);
     }
 
     for x in v.iter().next().ok_or("x not found") {
-        //~^ ERROR for loop over `v.iter().next().ok_or("x not found")`, which is a `Result`
-        //~| 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")`
+
+
         println!("{}", x);
     }
 
@@ -97,47 +97,47 @@ fn main() {
     let mut vec = vec![1, 2, 3, 4];
     let vec2 = vec![1, 2, 3, 4];
     for i in 0..vec.len() {
-        //~^ ERROR `i` is only used to index `vec`
-        //~| HELP consider
-        //~| HELP consider
-        //~| SUGGESTION for <item> in &vec {
+
+
+
+
         println!("{}", vec[i]);
     }
 
     for i in 0..vec.len() {
-        //~^ WARNING unused variable
+
         let i = 42; // make a different `i`
         println!("{}", vec[i]); // ok, not the `i` of the for-loop
     }
 
     for i in 0..vec.len() { let _ = vec[i]; }
-    //~^ ERROR `i` is only used to index `vec`
-    //~| HELP consider
-    //~| HELP consider
-    //~| SUGGESTION for <item> in &vec { let _ = vec[i]; }
+
+
+
+
 
     // ICE #746
     for j in 0..4 {
-        //~^ ERROR `j` is only used to index `STATIC`
-        //~| HELP consider
-        //~| HELP consider
-        //~| SUGGESTION for <item> in STATIC.iter().take(4) {
+
+
+
+
         println!("{:?}", STATIC[j]);
     }
 
     for j in 0..4 {
-        //~^ ERROR `j` is only used to index `CONST`
-        //~| HELP consider
-        //~| HELP consider
-        //~| SUGGESTION for <item> in CONST.iter().take(4) {
+
+
+
+
         println!("{:?}", CONST[j]);
     }
 
     for i in 0..vec.len() {
-        //~^ ERROR `i` is used to index `vec`
-        //~| HELP consider
-        //~| HELP consider
-        //~| SUGGESTION for (i, <item>) in vec.iter().enumerate() {
+
+
+
+
         println!("{} {}", vec[i], i);
     }
     for i in 0..vec.len() {      // not an error, indexing more than one variable
@@ -145,90 +145,90 @@ fn main() {
     }
 
     for i in 0..vec.len() {
-        //~^ ERROR `i` is only used to index `vec2`
-        //~| HELP consider
-        //~| HELP consider
-        //~| SUGGESTION for <item> in vec2.iter().take(vec.len()) {
+
+
+
+
         println!("{}", vec2[i]);
     }
 
     for i in 5..vec.len() {
-        //~^ ERROR `i` is only used to index `vec`
-        //~| HELP consider
-        //~| HELP consider
-        //~| SUGGESTION for <item> in vec.iter().skip(5) {
+
+
+
+
         println!("{}", vec[i]);
     }
 
     for i in 0..MAX_LEN {
-        //~^ ERROR `i` is only used to index `vec`
-        //~| HELP consider
-        //~| HELP consider
-        //~| SUGGESTION for <item> in vec.iter().take(MAX_LEN) {
+
+
+
+
         println!("{}", vec[i]);
     }
 
     for i in 0...MAX_LEN {
-        //~^ ERROR `i` is only used to index `vec`
-        //~| HELP consider
-        //~| HELP consider
-        //~| SUGGESTION for <item> in vec.iter().take(MAX_LEN + 1) {
+
+
+
+
         println!("{}", vec[i]);
     }
 
     for i in 5..10 {
-        //~^ ERROR `i` is only used to index `vec`
-        //~| HELP consider
-        //~| HELP consider
-        //~| SUGGESTION for <item> in vec.iter().take(10).skip(5) {
+
+
+
+
         println!("{}", vec[i]);
     }
 
     for i in 5...10 {
-        //~^ ERROR `i` is only used to index `vec`
-        //~| HELP consider
-        //~| HELP consider
-        //~| SUGGESTION for <item> in vec.iter().take(10 + 1).skip(5) {
+
+
+
+
         println!("{}", vec[i]);
     }
 
     for i in 5..vec.len() {
-        //~^ ERROR `i` is used to index `vec`
-        //~| HELP consider
-        //~| HELP consider
-        //~| SUGGESTION for (i, <item>) in vec.iter().enumerate().skip(5) {
+
+
+
+
         println!("{} {}", vec[i], i);
     }
 
     for i in 5..10 {
-        //~^ ERROR `i` is used to index `vec`
-        //~| HELP consider
-        //~| HELP consider
-        //~| SUGGESTION for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
+
+
+
+
         println!("{} {}", vec[i], i);
     }
 
     for i in 10..0 {
-        //~^ERROR this range is empty so this for loop will never run
-        //~|HELP consider
-        //~|SUGGESTION (0..10).rev()
+
+
+
         println!("{}", i);
     }
 
     for i in 10...0 {
-        //~^ERROR this range is empty so this for loop will never run
-        //~|HELP consider
-        //~|SUGGESTION (0...10).rev()
+
+
+
         println!("{}", i);
     }
 
-    for i in MAX_LEN..0 { //~ERROR this range is empty so this for loop will never run
-        //~|HELP consider
-        //~|SUGGESTION (0..MAX_LEN).rev()
+    for i in MAX_LEN..0 {
+
+
         println!("{}", i);
     }
 
-    for i in 5..5 { //~ERROR this range is empty so this for loop will never run
+    for i in 5..5 {
         println!("{}", i);
     }
 
@@ -250,20 +250,20 @@ fn main() {
 
     // testing that the empty range lint folds constants
     for i in 10..5+4 {
-    //~^ ERROR this range is empty so this for loop will never run
-    //~| HELP if you are attempting to iterate over this range in reverse
-    //~| SUGGESTION for i in (5+4..10).rev() {
+
+
+
         println!("{}", i);
     }
 
     for i in (5+2)..(3-1) {
-    //~^ ERROR this range is empty so this for loop will never run
-    //~| HELP if you are attempting to iterate over this range in reverse
-    //~| SUGGESTION for i in ((3-1)..(5+2)).rev() {
+
+
+
         println!("{}", i);
     }
 
-    for i in (5+2)..(8-1) { //~ERROR this range is empty so this for loop will never run
+    for i in (5+2)..(8-1) {
         println!("{}", i);
     }
 
@@ -287,98 +287,98 @@ fn main() {
     }
 
     for _v in vec.iter() { }
-    //~^ ERROR it is more idiomatic to loop over `&vec`
-    //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION for _v in &vec {
+
+
+
 
     for _v in vec.iter_mut() { }
-    //~^ ERROR it is more idiomatic to loop over `&mut vec`
-    //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION for _v in &mut vec {
+
+
+
 
     let out_vec = vec![1,2,3];
     for _v in out_vec.into_iter() { }
-    //~^ ERROR it is more idiomatic to loop over `out_vec` instead of `out_vec.into_iter()`
-    //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION for _v in out_vec {
+
+
+
 
     for _v in &vec { } // these are fine
     for _v in &mut vec { } // these are fine
 
     for _v in [1, 2, 3].iter() { }
-    //~^ ERROR it is more idiomatic to loop over `&[
-    //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION for _v in &[1, 2, 3] {
+
+
+
 
     for _v in (&mut [1, 2, 3]).iter() { } // no error
 
     for _v in [0; 32].iter() {}
-    //~^ ERROR it is more idiomatic to loop over `&[
-    //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION for _v in &[0; 32] {
+
+
+
 
     for _v in [0; 33].iter() {} // no error
 
     let ll: LinkedList<()> = LinkedList::new();
     for _v in ll.iter() { }
-    //~^ ERROR it is more idiomatic to loop over `&ll`
-    //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION for _v in &ll {
+
+
+
 
     let vd: VecDeque<()> = VecDeque::new();
     for _v in vd.iter() { }
-    //~^ ERROR it is more idiomatic to loop over `&vd`
-    //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION for _v in &vd {
+
+
+
 
     let bh: BinaryHeap<()> = BinaryHeap::new();
     for _v in bh.iter() { }
-    //~^ ERROR it is more idiomatic to loop over `&bh`
-    //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION for _v in &bh {
+
+
+
 
     let hm: HashMap<(), ()> = HashMap::new();
     for _v in hm.iter() { }
-    //~^ ERROR it is more idiomatic to loop over `&hm`
-    //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION for _v in &hm {
+
+
+
 
     let bt: BTreeMap<(), ()> = BTreeMap::new();
     for _v in bt.iter() { }
-    //~^ ERROR it is more idiomatic to loop over `&bt`
-    //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION for _v in &bt {
+
+
+
 
     let hs: HashSet<()> = HashSet::new();
     for _v in hs.iter() { }
-    //~^ ERROR it is more idiomatic to loop over `&hs`
-    //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION for _v in &hs {
+
+
+
 
     let bs: BTreeSet<()> = BTreeSet::new();
     for _v in bs.iter() { }
-    //~^ ERROR it is more idiomatic to loop over `&bs`
-    //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION for _v in &bs {
 
 
-    for _v in vec.iter().next() { } //~ERROR you are iterating over `Iterator::next()`
+
+
+
+    for _v in vec.iter().next() { }
 
     let u = Unrelated(vec![]);
     for _v in u.next() { } // no error
     for _v in u.iter() { } // no error
 
     let mut out = vec![];
-    vec.iter().map(|x| out.push(x)).collect::<Vec<_>>(); //~ERROR you are collect()ing an iterator
+    vec.iter().map(|x| out.push(x)).collect::<Vec<_>>();
     let _y = vec.iter().map(|x| out.push(x)).collect::<Vec<_>>(); // this is fine
 
     // Loop with explicit counter variable
     let mut _index = 0;
-    for _v in &vec { _index += 1 } //~ERROR the variable `_index` is used as a loop counter
+    for _v in &vec { _index += 1 }
 
     let mut _index = 1;
     _index = 0;
-    for _v in &vec { _index += 1 } //~ERROR the variable `_index` is used as a loop counter
+    for _v in &vec { _index += 1 }
 
     // Potential false positives
     let mut _index = 0;
@@ -439,19 +439,19 @@ fn main() {
 
     let m : HashMap<u64, u64> = HashMap::new();
     for (_, v) in &m {
-        //~^ you seem to want to iterate on a map's values
-        //~| HELP use the corresponding method
-        //~| HELP use the corresponding method
-        //~| SUGGESTION for v in m.values() {
+
+
+
+
         let _v = v;
     }
 
     let m : Rc<HashMap<u64, u64>> = Rc::new(HashMap::new());
     for (_, v) in &*m {
-        //~^ you seem to want to iterate on a map's values
-        //~| HELP use the corresponding method
-        //~| HELP use the corresponding method
-        //~| SUGGESTION for v in (*m).values() {
+
+
+
+
         let _v = v;
         // Here the `*` is not actually necesarry, but the test tests that we don't suggest
         // `in *m.values()` as we used to
@@ -459,29 +459,29 @@ fn main() {
 
     let mut m : HashMap<u64, u64> = HashMap::new();
     for (_, v) in &mut m {
-        //~^ you seem to want to iterate on a map's values
-        //~| HELP use the corresponding method
-        //~| HELP use the corresponding method
-        //~| SUGGESTION for v in m.values_mut()
+
+
+
+
         let _v = v;
     }
 
     let m: &mut HashMap<u64, u64> = &mut HashMap::new();
     for (_, v) in &mut *m {
-        //~^ you seem to want to iterate on a map's values
-        //~| HELP use the corresponding method
-        //~| HELP use the corresponding method
-        //~| SUGGESTION for v in (*m).values_mut()
+
+
+
+
         let _v = v;
     }
 
     let m : HashMap<u64, u64> = HashMap::new();
     let rm = &m;
     for (k, _value) in rm {
-        //~^ you seem to want to iterate on a map's keys
-        //~| HELP use the corresponding method
-        //~| HELP use the corresponding method
-        //~| SUGGESTION for k in rm.keys() {
+
+
+
+
         let _k = k;
     }
 
index 2e73a343817613489b484609a9ffbdc4f01a1841..2e9e5d1fe376074ade823c159fb38b1fd432192a 100644 (file)
@@ -40,7 +40,7 @@ error: you are iterating over `Iterator::next()` which is an Option; this will c
    |
 40 |       for x in v.iter().next() {
    |  _____^ starting here...
-41 | |         //~^ ERROR you are iterating over `Iterator::next()` which is an Option
+41 | |
 42 | |         println!("{}", x);
 43 | |     }
    | |_____^ ...ending here
@@ -75,10 +75,10 @@ error: the loop variable `i` is only used to index `vec`.
     |
 99  |       for i in 0..vec.len() {
     |  _____^ starting here...
-100 | |         //~^ ERROR `i` is only used to index `vec`
-101 | |         //~| HELP consider
-102 | |         //~| HELP consider
-103 | |         //~| SUGGESTION for <item> in &vec {
+100 | |
+101 | |
+102 | |
+103 | |
 104 | |         println!("{}", vec[i]);
 105 | |     }
     | |_____^ ...ending here
@@ -113,10 +113,10 @@ error: the loop variable `j` is only used to index `STATIC`.
     |
 120 |       for j in 0..4 {
     |  _____^ starting here...
-121 | |         //~^ ERROR `j` is only used to index `STATIC`
-122 | |         //~| HELP consider
-123 | |         //~| HELP consider
-124 | |         //~| SUGGESTION for <item> in STATIC.iter().take(4) {
+121 | |
+122 | |
+123 | |
+124 | |
 125 | |         println!("{:?}", STATIC[j]);
 126 | |     }
     | |_____^ ...ending here
@@ -129,10 +129,10 @@ error: the loop variable `j` is only used to index `CONST`.
     |
 128 |       for j in 0..4 {
     |  _____^ starting here...
-129 | |         //~^ ERROR `j` is only used to index `CONST`
-130 | |         //~| HELP consider
-131 | |         //~| HELP consider
-132 | |         //~| SUGGESTION for <item> in CONST.iter().take(4) {
+129 | |
+130 | |
+131 | |
+132 | |
 133 | |         println!("{:?}", CONST[j]);
 134 | |     }
     | |_____^ ...ending here
@@ -145,10 +145,10 @@ error: the loop variable `i` is used to index `vec`
     |
 136 |       for i in 0..vec.len() {
     |  _____^ starting here...
-137 | |         //~^ ERROR `i` is used to index `vec`
-138 | |         //~| HELP consider
-139 | |         //~| HELP consider
-140 | |         //~| SUGGESTION for (i, <item>) in vec.iter().enumerate() {
+137 | |
+138 | |
+139 | |
+140 | |
 141 | |         println!("{} {}", vec[i], i);
 142 | |     }
     | |_____^ ...ending here
@@ -161,10 +161,10 @@ error: the loop variable `i` is only used to index `vec2`.
     |
 147 |       for i in 0..vec.len() {
     |  _____^ starting here...
-148 | |         //~^ ERROR `i` is only used to index `vec2`
-149 | |         //~| HELP consider
-150 | |         //~| HELP consider
-151 | |         //~| SUGGESTION for <item> in vec2.iter().take(vec.len()) {
+148 | |
+149 | |
+150 | |
+151 | |
 152 | |         println!("{}", vec2[i]);
 153 | |     }
     | |_____^ ...ending here
@@ -177,10 +177,10 @@ error: the loop variable `i` is only used to index `vec`.
     |
 155 |       for i in 5..vec.len() {
     |  _____^ starting here...
-156 | |         //~^ ERROR `i` is only used to index `vec`
-157 | |         //~| HELP consider
-158 | |         //~| HELP consider
-159 | |         //~| SUGGESTION for <item> in vec.iter().skip(5) {
+156 | |
+157 | |
+158 | |
+159 | |
 160 | |         println!("{}", vec[i]);
 161 | |     }
     | |_____^ ...ending here
@@ -193,10 +193,10 @@ error: the loop variable `i` is only used to index `vec`.
     |
 163 |       for i in 0..MAX_LEN {
     |  _____^ starting here...
-164 | |         //~^ ERROR `i` is only used to index `vec`
-165 | |         //~| HELP consider
-166 | |         //~| HELP consider
-167 | |         //~| SUGGESTION for <item> in vec.iter().take(MAX_LEN) {
+164 | |
+165 | |
+166 | |
+167 | |
 168 | |         println!("{}", vec[i]);
 169 | |     }
     | |_____^ ...ending here
@@ -209,10 +209,10 @@ error: the loop variable `i` is only used to index `vec`.
     |
 171 |       for i in 0...MAX_LEN {
     |  _____^ starting here...
-172 | |         //~^ ERROR `i` is only used to index `vec`
-173 | |         //~| HELP consider
-174 | |         //~| HELP consider
-175 | |         //~| SUGGESTION for <item> in vec.iter().take(MAX_LEN + 1) {
+172 | |
+173 | |
+174 | |
+175 | |
 176 | |         println!("{}", vec[i]);
 177 | |     }
     | |_____^ ...ending here
@@ -225,10 +225,10 @@ error: the loop variable `i` is only used to index `vec`.
     |
 179 |       for i in 5..10 {
     |  _____^ starting here...
-180 | |         //~^ ERROR `i` is only used to index `vec`
-181 | |         //~| HELP consider
-182 | |         //~| HELP consider
-183 | |         //~| SUGGESTION for <item> in vec.iter().take(10).skip(5) {
+180 | |
+181 | |
+182 | |
+183 | |
 184 | |         println!("{}", vec[i]);
 185 | |     }
     | |_____^ ...ending here
@@ -241,10 +241,10 @@ error: the loop variable `i` is only used to index `vec`.
     |
 187 |       for i in 5...10 {
     |  _____^ starting here...
-188 | |         //~^ ERROR `i` is only used to index `vec`
-189 | |         //~| HELP consider
-190 | |         //~| HELP consider
-191 | |         //~| SUGGESTION for <item> in vec.iter().take(10 + 1).skip(5) {
+188 | |
+189 | |
+190 | |
+191 | |
 192 | |         println!("{}", vec[i]);
 193 | |     }
     | |_____^ ...ending here
@@ -257,10 +257,10 @@ error: the loop variable `i` is used to index `vec`
     |
 195 |       for i in 5..vec.len() {
     |  _____^ starting here...
-196 | |         //~^ ERROR `i` is used to index `vec`
-197 | |         //~| HELP consider
-198 | |         //~| HELP consider
-199 | |         //~| SUGGESTION for (i, <item>) in vec.iter().enumerate().skip(5) {
+196 | |
+197 | |
+198 | |
+199 | |
 200 | |         println!("{} {}", vec[i], i);
 201 | |     }
     | |_____^ ...ending here
@@ -273,10 +273,10 @@ error: the loop variable `i` is used to index `vec`
     |
 203 |       for i in 5..10 {
     |  _____^ starting here...
-204 | |         //~^ ERROR `i` is used to index `vec`
-205 | |         //~| HELP consider
-206 | |         //~| HELP consider
-207 | |         //~| SUGGESTION for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
+204 | |
+205 | |
+206 | |
+207 | |
 208 | |         println!("{} {}", vec[i], i);
 209 | |     }
     | |_____^ ...ending here
@@ -289,9 +289,9 @@ error: this range is empty so this for loop will never run
     |
 211 |       for i in 10..0 {
     |  _____^ starting here...
-212 | |         //~^ERROR this range is empty so this for loop will never run
-213 | |         //~|HELP consider
-214 | |         //~|SUGGESTION (0..10).rev()
+212 | |
+213 | |
+214 | |
 215 | |         println!("{}", i);
 216 | |     }
     | |_____^ ...ending here
@@ -309,9 +309,9 @@ error: this range is empty so this for loop will never run
     |
 218 |       for i in 10...0 {
     |  _____^ starting here...
-219 | |         //~^ERROR this range is empty so this for loop will never run
-220 | |         //~|HELP consider
-221 | |         //~|SUGGESTION (0...10).rev()
+219 | |
+220 | |
+221 | |
 222 | |         println!("{}", i);
 223 | |     }
     | |_____^ ...ending here
@@ -322,21 +322,21 @@ help: consider using the following if you are attempting to iterate over this ra
 error: this range is empty so this for loop will never run
    --> $DIR/for_loop.rs:225:5
     |
-225 |       for i in MAX_LEN..0 { //~ERROR this range is empty so this for loop will never run
+225 |       for i in MAX_LEN..0 {
     |  _____^ starting here...
-226 | |         //~|HELP consider
-227 | |         //~|SUGGESTION (0..MAX_LEN).rev()
+226 | |
+227 | |
 228 | |         println!("{}", i);
 229 | |     }
     | |_____^ ...ending here
     |
 help: consider using the following if you are attempting to iterate over this range in reverse
-    |     for i in (0..MAX_LEN).rev() { //~ERROR this range is empty so this for loop will never run
+    |     for i in (0..MAX_LEN).rev() {
 
 error: this range is empty so this for loop will never run
    --> $DIR/for_loop.rs:231:5
     |
-231 |       for i in 5..5 { //~ERROR this range is empty so this for loop will never run
+231 |       for i in 5..5 {
     |  _____^ starting here...
 232 | |         println!("{}", i);
 233 | |     }
@@ -347,9 +347,9 @@ error: this range is empty so this for loop will never run
     |
 252 |       for i in 10..5+4 {
     |  _____^ starting here...
-253 | |     //~^ ERROR this range is empty so this for loop will never run
-254 | |     //~| HELP if you are attempting to iterate over this range in reverse
-255 | |     //~| SUGGESTION for i in (5+4..10).rev() {
+253 | |
+254 | |
+255 | |
 256 | |         println!("{}", i);
 257 | |     }
     | |_____^ ...ending here
@@ -362,9 +362,9 @@ error: this range is empty so this for loop will never run
     |
 259 |       for i in (5+2)..(3-1) {
     |  _____^ starting here...
-260 | |     //~^ ERROR this range is empty so this for loop will never run
-261 | |     //~| HELP if you are attempting to iterate over this range in reverse
-262 | |     //~| SUGGESTION for i in ((3-1)..(5+2)).rev() {
+260 | |
+261 | |
+262 | |
 263 | |         println!("{}", i);
 264 | |     }
     | |_____^ ...ending here
@@ -375,7 +375,7 @@ help: consider using the following if you are attempting to iterate over this ra
 error: this range is empty so this for loop will never run
    --> $DIR/for_loop.rs:266:5
     |
-266 |       for i in (5+2)..(8-1) { //~ERROR this range is empty so this for loop will never run
+266 |       for i in (5+2)..(8-1) {
     |  _____^ starting here...
 267 | |         println!("{}", i);
 268 | |     }
@@ -502,7 +502,7 @@ help: to write this more concisely, try looping over
 error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
    --> $DIR/for_loop.rs:365:5
     |
-365 |     for _v in vec.iter().next() { } //~ERROR you are iterating over `Iterator::next()`
+365 |     for _v in vec.iter().next() { }
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
 note: lint level defined here
@@ -514,7 +514,7 @@ note: lint level defined here
 error: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator
    --> $DIR/for_loop.rs:372:5
     |
-372 |     vec.iter().map(|x| out.push(x)).collect::<Vec<_>>(); //~ERROR you are collect()ing an iterator
+372 |     vec.iter().map(|x| out.push(x)).collect::<Vec<_>>();
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
 note: lint level defined here
@@ -526,7 +526,7 @@ note: lint level defined here
 error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
    --> $DIR/for_loop.rs:377:5
     |
-377 |     for _v in &vec { _index += 1 } //~ERROR the variable `_index` is used as a loop counter
+377 |     for _v in &vec { _index += 1 }
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
 note: lint level defined here
@@ -538,7 +538,7 @@ note: lint level defined here
 error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
    --> $DIR/for_loop.rs:381:5
     |
-381 |     for _v in &vec { _index += 1 } //~ERROR the variable `_index` is used as a loop counter
+381 |     for _v in &vec { _index += 1 }
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: you seem to want to iterate on a map's values
@@ -546,10 +546,10 @@ error: you seem to want to iterate on a map's values
     |
 441 |       for (_, v) in &m {
     |  _____^ starting here...
-442 | |         //~^ you seem to want to iterate on a map's values
-443 | |         //~| HELP use the corresponding method
-444 | |         //~| HELP use the corresponding method
-445 | |         //~| SUGGESTION for v in m.values() {
+442 | |
+443 | |
+444 | |
+445 | |
 446 | |         let _v = v;
 447 | |     }
     | |_____^ ...ending here
@@ -567,10 +567,10 @@ error: you seem to want to iterate on a map's values
     |
 450 |       for (_, v) in &*m {
     |  _____^ starting here...
-451 | |         //~^ you seem to want to iterate on a map's values
-452 | |         //~| HELP use the corresponding method
-453 | |         //~| HELP use the corresponding method
-454 | |         //~| SUGGESTION for v in (*m).values() {
+451 | |
+452 | |
+453 | |
+454 | |
 455 | |         let _v = v;
 456 | |         // Here the `*` is not actually necesarry, but the test tests that we don't suggest
 457 | |         // `in *m.values()` as we used to
@@ -585,10 +585,10 @@ error: you seem to want to iterate on a map's values
     |
 461 |       for (_, v) in &mut m {
     |  _____^ starting here...
-462 | |         //~^ you seem to want to iterate on a map's values
-463 | |         //~| HELP use the corresponding method
-464 | |         //~| HELP use the corresponding method
-465 | |         //~| SUGGESTION for v in m.values_mut()
+462 | |
+463 | |
+464 | |
+465 | |
 466 | |         let _v = v;
 467 | |     }
     | |_____^ ...ending here
@@ -601,10 +601,10 @@ error: you seem to want to iterate on a map's values
     |
 470 |       for (_, v) in &mut *m {
     |  _____^ starting here...
-471 | |         //~^ you seem to want to iterate on a map's values
-472 | |         //~| HELP use the corresponding method
-473 | |         //~| HELP use the corresponding method
-474 | |         //~| SUGGESTION for v in (*m).values_mut()
+471 | |
+472 | |
+473 | |
+474 | |
 475 | |         let _v = v;
 476 | |     }
     | |_____^ ...ending here
@@ -617,10 +617,10 @@ error: you seem to want to iterate on a map's keys
     |
 480 |       for (k, _value) in rm {
     |  _____^ starting here...
-481 | |         //~^ you seem to want to iterate on a map's keys
-482 | |         //~| HELP use the corresponding method
-483 | |         //~| HELP use the corresponding method
-484 | |         //~| SUGGESTION for k in rm.keys() {
+481 | |
+482 | |
+483 | |
+484 | |
 485 | |         let _k = k;
 486 | |     }
     | |_____^ ...ending here
index 4fff131f6e7598665ee09cb63e3d15a645101ae3..67561dca87d048ce66d3cd152656524504da44a1 100644 (file)
@@ -3,16 +3,16 @@
 #![deny(useless_format)]
 
 fn main() {
-    format!("foo"); //~ERROR useless use of `format!`
+    format!("foo");
 
-    format!("{}", "foo"); //~ERROR useless use of `format!`
+    format!("{}", "foo");
     format!("{:?}", "foo"); // we only want to warn about `{}`
     format!("{:+}", "foo"); // we only want to warn about `{}`
     format!("foo {}", "bar");
     format!("{} bar", "foo");
 
     let arg: String = "".to_owned();
-    format!("{}", arg); //~ERROR useless use of `format!`
+    format!("{}", arg);
     format!("{:?}", arg); // we only want to warn about `{}`
     format!("{:+}", arg); // we only want to warn about `{}`
     format!("foo {}", arg);
index a913ef24b2502cda060b2a061e4691ee9b175a03..51e0c5b6d63349a2efc5916b8ce981cb67f9c6fa 100644 (file)
@@ -1,7 +1,7 @@
 error: useless use of `format!`
  --> $DIR/format.rs:6:5
   |
-6 |     format!("foo"); //~ERROR useless use of `format!`
+6 |     format!("foo");
   |     ^^^^^^^^^^^^^^^
   |
 note: lint level defined here
@@ -13,13 +13,13 @@ note: lint level defined here
 error: useless use of `format!`
  --> $DIR/format.rs:8:5
   |
-8 |     format!("{}", "foo"); //~ERROR useless use of `format!`
+8 |     format!("{}", "foo");
   |     ^^^^^^^^^^^^^^^^^^^^^
 
 error: useless use of `format!`
   --> $DIR/format.rs:15:5
    |
-15 |     format!("{}", arg); //~ERROR useless use of `format!`
+15 |     format!("{}", arg);
    |     ^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 3 previous errors
index 6c6671b0aa40ef186e09a6f125e3fb888c39667d..8d3c1d938e55da8de6f879f74b02992ee23f2f32 100644 (file)
@@ -13,8 +13,8 @@ fn main() {
     // weird `else if` formatting:
     if foo() {
     } if foo() {
-    //~^ ERROR this looks like an `else if` but the `else` is missing
-    //~| NOTE add the missing `else` or
+
+
     }
 
     let _ = { // if as the last expression
@@ -22,8 +22,8 @@ fn main() {
 
         if foo() {
         } if foo() {
-        //~^ ERROR this looks like an `else if` but the `else` is missing
-        //~| NOTE add the missing `else` or
+
+
         }
         else {
         }
@@ -32,8 +32,8 @@ fn main() {
     let _ = { // if in the middle of a block
         if foo() {
         } if foo() {
-        //~^ ERROR this looks like an `else if` but the `else` is missing
-        //~| NOTE add the missing `else` or
+
+
         }
         else {
         }
@@ -43,15 +43,15 @@ fn main() {
 
     if foo() {
     } else
-    //~^ ERROR this is an `else if` but the formatting might hide it
-    //~| NOTE remove the `else` or
+
+
     if foo() { // the span of the above error should continue here
     }
 
     if foo() {
     }
-    //~^ ERROR this is an `else if` but the formatting might hide it
-    //~| NOTE remove the `else` or
+
+
     else
     if foo() { // the span of the above error should continue here
     }
@@ -81,16 +81,16 @@ fn main() {
     // weird op_eq formatting:
     let mut a = 42;
     a =- 35;
-    //~^ ERROR this looks like you are trying to use `.. -= ..`, but you really are doing `.. = (- ..)`
-    //~| NOTE to remove this lint, use either `-=` or `= -`
+
+
     a =* &191;
-    //~^ ERROR this looks like you are trying to use `.. *= ..`, but you really are doing `.. = (* ..)`
-    //~| NOTE to remove this lint, use either `*=` or `= *`
+
+
 
     let mut b = true;
     b =! false;
-    //~^ ERROR this looks like you are trying to use `.. != ..`, but you really are doing `.. = (! ..)`
-    //~| NOTE to remove this lint, use either `!=` or `= !`
+
+
 
     // those are ok:
     a = -35;
@@ -100,14 +100,14 @@ fn main() {
     // possible missing comma in an array
     let _ = &[
         -1, -2, -3 // <= no coma here
-        //~^ ERROR possibly missing a comma here
-        //~| NOTE to remove this lint, add a comma or write the expr in a single line
+
+
         -4, -5, -6
     ];
     let _ = &[
         -1, -2, -3 // <= no coma here
-        //~^ ERROR possibly missing a comma here
-        //~| NOTE to remove this lint, add a comma or write the expr in a single line
+
+
         *4, -5, -6
     ];
 
index 46ff2a45f48bc4bef0e92174c83c98133f5101e4..68260410fa990108c25334d7bcdfa4511d388b11 100644 (file)
@@ -35,8 +35,8 @@ error: this is an `else if` but the formatting might hide it
    |
 45 |       } else
    |  ______^ starting here...
-46 | |     //~^ ERROR this is an `else if` but the formatting might hide it
-47 | |     //~| NOTE remove the `else` or
+46 | |
+47 | |
 48 | |     if foo() { // the span of the above error should continue here
    | |____^ ...ending here
    |
@@ -48,8 +48,8 @@ error: this is an `else if` but the formatting might hide it
    |
 52 |       }
    |  ______^ starting here...
-53 | |     //~^ ERROR this is an `else if` but the formatting might hide it
-54 | |     //~| NOTE remove the `else` or
+53 | |
+54 | |
 55 | |     else
 56 | |     if foo() { // the span of the above error should continue here
    | |____^ ...ending here
index 60a074df0f5b2016b743760a68ad868b4c429645..bb09be575fdca5e680490b0ec00bd898a5556b22 100644 (file)
@@ -9,7 +9,7 @@
 fn good(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool) {}
 
 fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {
-    //~^ ERROR: this function has too many arguments (8/7)
+
 }
 
 // don't lint extern fns
@@ -18,7 +18,7 @@ fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _
 pub trait Foo {
     fn good(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool);
     fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ());
-    //~^ ERROR: this function has too many arguments (8/7)
+
 
     fn ptr(p: *const u8);
 }
@@ -28,7 +28,7 @@ pub trait Foo {
 impl Bar {
     fn good_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool) {}
     fn bad_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {}
-    //~^ ERROR: this function has too many arguments (8/7)
+
 }
 
 // ok, we don’t want to warn implementations
@@ -38,11 +38,11 @@ fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _
 
     fn ptr(p: *const u8) {
         println!("{}", unsafe { *p });
-        //~^ ERROR: this public function dereferences a raw pointer but is not marked `unsafe`
+
         println!("{:?}", unsafe { p.as_ref() });
-        //~^ ERROR: this public function dereferences a raw pointer but is not marked `unsafe`
+
         unsafe { std::ptr::read(p) };
-        //~^ ERROR: this public function dereferences a raw pointer but is not marked `unsafe`
+
     }
 }
 
@@ -54,11 +54,11 @@ fn private(p: *const u8) {
 
 pub fn public(p: *const u8) {
     println!("{}", unsafe { *p });
-    //~^ ERROR: this public function dereferences a raw pointer but is not marked `unsafe`
+
     println!("{:?}", unsafe { p.as_ref() });
-    //~^ ERROR: this public function dereferences a raw pointer but is not marked `unsafe`
+
     unsafe { std::ptr::read(p) };
-    //~^ ERROR: this public function dereferences a raw pointer but is not marked `unsafe`
+
 }
 
 impl Bar {
@@ -68,11 +68,11 @@ fn private(self, p: *const u8) {
 
     pub fn public(self, p: *const u8) {
         println!("{}", unsafe { *p });
-        //~^ ERROR: this public function dereferences a raw pointer but is not marked `unsafe`
+
         println!("{:?}", unsafe { p.as_ref() });
-        //~^ ERROR: this public function dereferences a raw pointer but is not marked `unsafe`
+
         unsafe { std::ptr::read(p) };
-        //~^ ERROR: this public function dereferences a raw pointer but is not marked `unsafe`
+
     }
 
     pub fn public_ok(self, p: *const u8) {
index a66ea4b8899432741126c43df5010210bd536f2e..4a21f9466c995611dc7bb275fcd73e9efbb42564 100644 (file)
@@ -3,7 +3,7 @@ error: this function has too many arguments (8/7)
    |
 11 |   fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {
    |  _^ starting here...
-12 | |     //~^ ERROR: this function has too many arguments (8/7)
+12 | |
 13 | | }
    | |_^ ...ending here
    |
index 6a0b5e927cf7897ec48b47bce99eaab2236b4c2d..ea68ec3e1abc06121f97a32b93c498310958f0c3 100644 (file)
 fn main() {
     let x = 0;
 
-    x + 0;        //~ERROR the operation is ineffective
-    x + (1 - 1);  //~ERROR the operation is ineffective
+    x + 0;
+    x + (1 - 1);
     x + 1;
-    0 + x;        //~ERROR the operation is ineffective
+    0 + x;
     1 + x;
     x - ZERO;     //no error, as we skip lookups (for now)
-    x | (0);      //~ERROR the operation is ineffective
+    x | (0);
     ((ZERO)) | x; //no error, as we skip lookups (for now)
 
-    x * 1;        //~ERROR the operation is ineffective
-    1 * x;        //~ERROR the operation is ineffective
+    x * 1;
+    1 * x;
     x / ONE;      //no error, as we skip lookups (for now)
 
     x / 2;        //no false positive
 
     x & NEG_ONE;  //no error, as we skip lookups (for now)
-    -1 & x;       //~ERROR the operation is ineffective
+    -1 & x;
 }
index 7590a99effe9de10b221dc0c3a36cc10edfaa14c..ab455ad15855f933c0a9676b2b5f12d15c2e2291 100644 (file)
@@ -1,7 +1,7 @@
 error: the operation is ineffective. Consider reducing it to `x`
   --> $DIR/identity_op.rs:13:5
    |
-13 |     x + 0;        //~ERROR the operation is ineffective
+13 |     x + 0;
    |     ^^^^^
    |
 note: lint level defined here
@@ -13,37 +13,37 @@ note: lint level defined here
 error: the operation is ineffective. Consider reducing it to `x`
   --> $DIR/identity_op.rs:14:5
    |
-14 |     x + (1 - 1);  //~ERROR the operation is ineffective
+14 |     x + (1 - 1);
    |     ^^^^^^^^^^^
 
 error: the operation is ineffective. Consider reducing it to `x`
   --> $DIR/identity_op.rs:16:5
    |
-16 |     0 + x;        //~ERROR the operation is ineffective
+16 |     0 + x;
    |     ^^^^^
 
 error: the operation is ineffective. Consider reducing it to `x`
   --> $DIR/identity_op.rs:19:5
    |
-19 |     x | (0);      //~ERROR the operation is ineffective
+19 |     x | (0);
    |     ^^^^^^^
 
 error: the operation is ineffective. Consider reducing it to `x`
   --> $DIR/identity_op.rs:22:5
    |
-22 |     x * 1;        //~ERROR the operation is ineffective
+22 |     x * 1;
    |     ^^^^^
 
 error: the operation is ineffective. Consider reducing it to `x`
   --> $DIR/identity_op.rs:23:5
    |
-23 |     1 * x;        //~ERROR the operation is ineffective
+23 |     1 * x;
    |     ^^^^^
 
 error: the operation is ineffective. Consider reducing it to `x`
   --> $DIR/identity_op.rs:29:5
    |
-29 |     -1 & x;       //~ERROR the operation is ineffective
+29 |     -1 & x;
    |     ^^^^^^
 
 error: aborting due to 7 previous errors
index 24a3864b0133326fe55365f7a37193a2686f506e..c48518304e2a3ee912cc88be8ce2f0836e053331 100644 (file)
@@ -7,26 +7,26 @@
 
 fn main() {
     if let Ok(_) = Ok::<i32, i32>(42) {}
-    //~^ERROR redundant pattern matching, consider using `is_ok()`
-    //~| HELP try this
-    //~| SUGGESTION if Ok::<i32, i32>(42).is_ok() {
+
+
+
 
     if let Err(_) = Err::<i32, i32>(42) {
-    //~^ERROR redundant pattern matching, consider using `is_err()`
-    //~| HELP try this
-    //~| SUGGESTION if Err::<i32, i32>(42).is_err() {
+
+
+
     }
 
     if let None = None::<()> {
-    //~^ERROR redundant pattern matching, consider using `is_none()`
-    //~| HELP try this
-    //~| SUGGESTION if None::<()>.is_none() {
+
+
+
     }
 
     if let Some(_) = Some(42) {
-    //~^ERROR redundant pattern matching, consider using `is_some()`
-    //~| HELP try this
-    //~| SUGGESTION if Some(42).is_some() {
+
+
+
     }
 
     if Ok::<i32, i32>(42).is_ok() {
index a72699adafd862080bdaf295a89387b66aee696d..5cdc6ce8678c20f4544bf6e06ab9b4208cb2d1c2 100644 (file)
@@ -6,12 +6,12 @@
 fn bla() -> bool { unimplemented!() }
 
 fn main() {
-    if !bla() { //~ ERROR: Unnecessary boolean `not` operation
+    if !bla() {
         println!("Bugs");
     } else {
         println!("Bunny");
     }
-    if 4 != 5 { //~ ERROR: Unnecessary `!=` operation
+    if 4 != 5 {
         println!("Bugs");
     } else {
         println!("Bunny");
index f31be63dd4cd2248ec22783480ca840012f387be..ecdd7254d70b8ff21a888df22ab8020e967eace7 100644 (file)
@@ -1,7 +1,7 @@
 error: Unnecessary boolean `not` operation
   --> $DIR/if_not_else.rs:9:5
    |
-9  |       if !bla() { //~ ERROR: Unnecessary boolean `not` operation
+9  |       if !bla() {
    |  _____^ starting here...
 10 | |         println!("Bugs");
 11 | |     } else {
@@ -19,7 +19,7 @@ note: lint level defined here
 error: Unnecessary `!=` operation
   --> $DIR/if_not_else.rs:14:5
    |
-14 |       if 4 != 5 { //~ ERROR: Unnecessary `!=` operation
+14 |       if 4 != 5 {
    |  _____^ starting here...
 15 | |         println!("Bugs");
 16 | |     } else {
index 9635f3afede968a3eeee3d3f000123d2b1232e92..952cf1e4361c7c37cc4052b983c0424ffcce9c87 100644 (file)
@@ -7,22 +7,22 @@ fn main() {
     let zero: u32 = 0;
     let u8_max: u8 = 255;
 
-    (u8_max as u32) > 300; //~ERROR because of the numeric bounds on `u8_max` prior to casting, this expression is always false
+    (u8_max as u32) > 300;
     (u8_max as u32) > 20;
 
-    (zero as i32) < -5; //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always false
+    (zero as i32) < -5;
     (zero as i32) < 10;
 
-    -5 < (zero as i32); //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always true
-    0 <= (zero as i32); //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always true
+    -5 < (zero as i32);
+    0 <= (zero as i32);
     0 < (zero as i32);
 
-    -5 > (zero as i32); //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always false
-    -5 >= (u8_max as i32); //~ERROR because of the numeric bounds on `u8_max` prior to casting, this expression is always false
-    1337 == (u8_max as i32); //~ERROR because of the numeric bounds on `u8_max` prior to casting, this expression is always false
+    -5 > (zero as i32);
+    -5 >= (u8_max as i32);
+    1337 == (u8_max as i32);
 
-    -5 == (zero as i32); //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always false
-    -5 != (u8_max as i32); //~ERROR because of the numeric bounds on `u8_max` prior to casting, this expression is always true
+    -5 == (zero as i32);
+    -5 != (u8_max as i32);
 
     // Those are Ok:
     42 == (u8_max as i32);
index 1fd96e4de42a38b1585a6793032f55bab027ce3f..e7eda752f38801c1417edd5999c89e4dbe906dc5 100644 (file)
@@ -1,7 +1,7 @@
 error: because of the numeric bounds on `u8_max` prior to casting, this expression is always false
   --> $DIR/invalid_upcast_comparisons.rs:10:5
    |
-10 |     (u8_max as u32) > 300; //~ERROR because of the numeric bounds on `u8_max` prior to casting, this expression is always false
+10 |     (u8_max as u32) > 300;
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,49 +13,49 @@ note: lint level defined here
 error: because of the numeric bounds on `zero` prior to casting, this expression is always false
   --> $DIR/invalid_upcast_comparisons.rs:13:5
    |
-13 |     (zero as i32) < -5; //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always false
+13 |     (zero as i32) < -5;
    |     ^^^^^^^^^^^^^^^^^^
 
 error: because of the numeric bounds on `zero` prior to casting, this expression is always true
   --> $DIR/invalid_upcast_comparisons.rs:16:5
    |
-16 |     -5 < (zero as i32); //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always true
+16 |     -5 < (zero as i32);
    |     ^^^^^^^^^^^^^^^^^^
 
 error: because of the numeric bounds on `zero` prior to casting, this expression is always true
   --> $DIR/invalid_upcast_comparisons.rs:17:5
    |
-17 |     0 <= (zero as i32); //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always true
+17 |     0 <= (zero as i32);
    |     ^^^^^^^^^^^^^^^^^^
 
 error: because of the numeric bounds on `zero` prior to casting, this expression is always false
   --> $DIR/invalid_upcast_comparisons.rs:20:5
    |
-20 |     -5 > (zero as i32); //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always false
+20 |     -5 > (zero as i32);
    |     ^^^^^^^^^^^^^^^^^^
 
 error: because of the numeric bounds on `u8_max` prior to casting, this expression is always false
   --> $DIR/invalid_upcast_comparisons.rs:21:5
    |
-21 |     -5 >= (u8_max as i32); //~ERROR because of the numeric bounds on `u8_max` prior to casting, this expression is always false
+21 |     -5 >= (u8_max as i32);
    |     ^^^^^^^^^^^^^^^^^^^^^
 
 error: because of the numeric bounds on `u8_max` prior to casting, this expression is always false
   --> $DIR/invalid_upcast_comparisons.rs:22:5
    |
-22 |     1337 == (u8_max as i32); //~ERROR because of the numeric bounds on `u8_max` prior to casting, this expression is always false
+22 |     1337 == (u8_max as i32);
    |     ^^^^^^^^^^^^^^^^^^^^^^^
 
 error: because of the numeric bounds on `zero` prior to casting, this expression is always false
   --> $DIR/invalid_upcast_comparisons.rs:24:5
    |
-24 |     -5 == (zero as i32); //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always false
+24 |     -5 == (zero as i32);
    |     ^^^^^^^^^^^^^^^^^^^
 
 error: because of the numeric bounds on `u8_max` prior to casting, this expression is always true
   --> $DIR/invalid_upcast_comparisons.rs:25:5
    |
-25 |     -5 != (u8_max as i32); //~ERROR because of the numeric bounds on `u8_max` prior to casting, this expression is always true
+25 |     -5 != (u8_max as i32);
    |     ^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 9 previous errors
index 4be89176fc7d1df080d45264a6981d9fc433e146..09b509673dc363884baced7c1a6eef118e18e633 100644 (file)
@@ -9,11 +9,11 @@ fn ok() {
 
 fn last() {
     foo();
-    fn foo() { println!("foo"); } //~ ERROR adding items after statements is confusing
+    fn foo() { println!("foo"); }
 }
 
 fn main() {
     foo();
-    fn foo() { println!("foo"); } //~ ERROR adding items after statements is confusing
+    fn foo() { println!("foo"); }
     foo();
 }
index be3455c2a71d84aa95ea2e54ff5d2dc628afdd43..318db240ca2b390429dac024efc2564d7387f0c8 100644 (file)
@@ -1,7 +1,7 @@
 error: adding items after statements is confusing, since items exist from the start of the scope
   --> $DIR/item_after_statement.rs:12:5
    |
-12 |     fn foo() { println!("foo"); } //~ ERROR adding items after statements is confusing
+12 |     fn foo() { println!("foo"); }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: adding items after statements is confusing, since items exist from the start of the scope
   --> $DIR/item_after_statement.rs:17:5
    |
-17 |     fn foo() { println!("foo"); } //~ ERROR adding items after statements is confusing
+17 |     fn foo() { println!("foo"); }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index 8d289a3283246977168a4feb71dc08b133b10996..5bbcb93910b9e8c6a9a70c45e4f3d1abec1ffaab 100644 (file)
@@ -7,19 +7,19 @@
 
 enum LargeEnum {
     A(i32),
-    B([i32; 8000]), //~ ERROR large enum variant found
-    //~^ HELP consider boxing the large fields to reduce the total size of the enum
-    //~| SUGGESTION Box<[i32; 8000]>
+    B([i32; 8000]),
+
+
 }
 
 enum GenericEnum<T> {
     A(i32),
-    B([i32; 8000]), //~ ERROR large enum variant found
-    //~^ HELP consider boxing the large fields to reduce the total size of the enum
-    //~| SUGGESTION Box<[i32; 8000]>
+    B([i32; 8000]),
+
+
     C([T; 8000]),
-    D(T, [i32; 8000]), //~ ERROR large enum variant found
-    //~^ HELP consider boxing the large fields to reduce the total size of the enum
+    D(T, [i32; 8000]),
+
 }
 
 trait SomeTrait {
@@ -32,19 +32,19 @@ enum LargeEnumGeneric<A: SomeTrait> {
 
 enum AnotherLargeEnum {
     VariantOk(i32, u32),
-    ContainingLargeEnum(LargeEnum), //~ ERROR large enum variant found
-    //~^ HELP consider boxing the large fields to reduce the total size of the enum
-    //~| SUGGESTION Box<LargeEnum>
-    ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]), //~ ERROR large enum variant found
-    //~^ HELP consider boxing the large fields to reduce the total size of the enum
+    ContainingLargeEnum(LargeEnum),
+
+
+    ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
+
     VoidVariant,
     StructLikeLittle { x: i32, y: i32 },
-    StructLikeLarge { x: [i32; 8000], y: i32 }, //~ ERROR large enum variant found
-    //~^ HELP consider boxing the large fields to reduce the total size of the enum
-    StructLikeLarge2 { //~ ERROR large enum variant found
+    StructLikeLarge { x: [i32; 8000], y: i32 },
+
+    StructLikeLarge2 {
         x:
-        [i32; 8000] //~ SUGGESTION Box<[i32; 8000]>
-        //~^ HELP consider boxing the large fields to reduce the total size of the enum
+        [i32; 8000]
+
     },
 }
 
index 8b7b39902608f5ed4504c017bb30f3c40f0da8f8..77155b6ab5fedeca6bdecd6628d55e318249ddd1 100644 (file)
@@ -1,7 +1,7 @@
 error: large enum variant found
   --> $DIR/large_enum_variant.rs:10:5
    |
-10 |     B([i32; 8000]), //~ ERROR large enum variant found
+10 |     B([i32; 8000]),
    |     ^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -10,75 +10,75 @@ note: lint level defined here
 6  | #![deny(large_enum_variant)]
    |         ^^^^^^^^^^^^^^^^^^
 help: consider boxing the large fields to reduce the total size of the enum
-   |     B(Box<[i32; 8000]>), //~ ERROR large enum variant found
+   |     B(Box<[i32; 8000]>),
 
 error: large enum variant found
   --> $DIR/large_enum_variant.rs:17:5
    |
-17 |     B([i32; 8000]), //~ ERROR large enum variant found
+17 |     B([i32; 8000]),
    |     ^^^^^^^^^^^^^^
    |
 help: consider boxing the large fields to reduce the total size of the enum
-   |     B(Box<[i32; 8000]>), //~ ERROR large enum variant found
+   |     B(Box<[i32; 8000]>),
 
 error: large enum variant found
   --> $DIR/large_enum_variant.rs:21:5
    |
-21 |     D(T, [i32; 8000]), //~ ERROR large enum variant found
+21 |     D(T, [i32; 8000]),
    |     ^^^^^^^^^^^^^^^^^
    |
 help: consider boxing the large fields to reduce the total size of the enum
   --> $DIR/large_enum_variant.rs:21:5
    |
-21 |     D(T, [i32; 8000]), //~ ERROR large enum variant found
+21 |     D(T, [i32; 8000]),
    |     ^^^^^^^^^^^^^^^^^
 
 error: large enum variant found
   --> $DIR/large_enum_variant.rs:35:5
    |
-35 |     ContainingLargeEnum(LargeEnum), //~ ERROR large enum variant found
+35 |     ContainingLargeEnum(LargeEnum),
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: consider boxing the large fields to reduce the total size of the enum
-   |     ContainingLargeEnum(Box<LargeEnum>), //~ ERROR large enum variant found
+   |     ContainingLargeEnum(Box<LargeEnum>),
 
 error: large enum variant found
   --> $DIR/large_enum_variant.rs:38:5
    |
-38 |     ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]), //~ ERROR large enum variant found
+38 |     ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: consider boxing the large fields to reduce the total size of the enum
   --> $DIR/large_enum_variant.rs:38:5
    |
-38 |     ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]), //~ ERROR large enum variant found
+38 |     ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: large enum variant found
   --> $DIR/large_enum_variant.rs:42:5
    |
-42 |     StructLikeLarge { x: [i32; 8000], y: i32 }, //~ ERROR large enum variant found
+42 |     StructLikeLarge { x: [i32; 8000], y: i32 },
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: consider boxing the large fields to reduce the total size of the enum
   --> $DIR/large_enum_variant.rs:42:5
    |
-42 |     StructLikeLarge { x: [i32; 8000], y: i32 }, //~ ERROR large enum variant found
+42 |     StructLikeLarge { x: [i32; 8000], y: i32 },
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: large enum variant found
   --> $DIR/large_enum_variant.rs:44:5
    |
-44 |       StructLikeLarge2 { //~ ERROR large enum variant found
+44 |       StructLikeLarge2 {
    |  _____^ starting here...
 45 | |         x:
-46 | |         [i32; 8000] //~ SUGGESTION Box<[i32; 8000]>
-47 | |         //~^ HELP consider boxing the large fields to reduce the total size of the enum
+46 | |         [i32; 8000]
+47 | |
 48 | |     },
    | |_____^ ...ending here
    |
 help: consider boxing the large fields to reduce the total size of the enum
-   |         Box<[i32; 8000]> //~ SUGGESTION Box<[i32; 8000]>
+   |         Box<[i32; 8000]>
 
 error: aborting due to 7 previous errors
 
index b640c6db3a3ceb4cdfece7f834d26308021b33fb..a310eeef3846df90b8f2ed4490b872b800ab74f0 100644 (file)
@@ -7,7 +7,7 @@
 pub struct PubOne;
 
 impl PubOne {
-    pub fn len(self: &Self) -> isize { //~ERROR item `PubOne` has a public `len` method but no corresponding `is_empty`
+    pub fn len(self: &Self) -> isize {
         1
     }
 }
@@ -29,7 +29,7 @@ fn len(self: &Self) -> isize { // no error, len is private, see #1085
 }
 
 pub trait PubTraitsToo {
-    fn len(self: &Self) -> isize; //~ERROR trait `PubTraitsToo` has a `len` method but no `is_empty`
+    fn len(self: &Self) -> isize;
 }
 
 impl PubTraitsToo for One {
@@ -63,7 +63,7 @@ fn is_empty(self: &Self) -> bool {
 pub struct HasIsEmpty;
 
 impl HasIsEmpty {
-    pub fn len(self: &Self) -> isize { //~ERROR item `HasIsEmpty` has a public `len` method but a private `is_empty`
+    pub fn len(self: &Self) -> isize {
         1
     }
 
@@ -92,7 +92,7 @@ fn is_empty(self: &Self) -> bool {
 pub struct HasWrongIsEmpty;
 
 impl HasWrongIsEmpty {
-    pub fn len(self: &Self) -> isize { //~ERROR item `HasWrongIsEmpty` has a public `len` method but no corresponding `is_empty`
+    pub fn len(self: &Self) -> isize {
         1
     }
 
@@ -104,16 +104,16 @@ pub fn is_empty(self: &Self, x : u32) -> bool {
 fn main() {
     let x = [1, 2];
     if x.len() == 0 {
-        //~^ERROR length comparison to zero
-        //~|HELP consider using `is_empty`
-        //~|SUGGESTION x.is_empty()
+
+
+
         println!("This should not happen!");
     }
 
     if "".len() == 0 {
-        //~^ERROR length comparison to zero
-        //~|HELP consider using `is_empty`
-        //~|SUGGESTION "".is_empty()
+
+
+
     }
 
     let y = One;
@@ -128,30 +128,30 @@ fn main() {
 
     let has_is_empty = HasIsEmpty;
     if has_is_empty.len() == 0 {
-        //~^ERROR length comparison to zero
-        //~|HELP consider using `is_empty`
-        //~|SUGGESTION has_is_empty.is_empty()
+
+
+
         println!("Or this!");
     }
     if has_is_empty.len() != 0 {
-        //~^ERROR length comparison to zero
-        //~|HELP consider using `is_empty`
-        //~|SUGGESTION !has_is_empty.is_empty()
+
+
+
         println!("Or this!");
     }
     if has_is_empty.len() > 0 {
-        //~^ERROR length comparison to zero
-        //~|HELP consider using `is_empty`
-        //~|SUGGESTION !has_is_empty.is_empty()
+
+
+
         println!("Or this!");
     }
     assert!(!has_is_empty.is_empty());
 
     let with_is_empty: &WithIsEmpty = &Wither;
     if with_is_empty.len() == 0 {
-        //~^ERROR length comparison to zero
-        //~|HELP consider using `is_empty`
-        //~|SUGGESTION with_is_empty.is_empty()
+
+
+
         println!("Or this!");
     }
     assert!(!with_is_empty.is_empty());
index 48ee0a7ffd00c383e5c468b8f118f968e3a036a3..5aaaecf55cb7352048e7ac3ed74feb2ba562630a 100644 (file)
@@ -1,7 +1,7 @@
 error: item `PubOne` has a public `len` method but no corresponding `is_empty` method
   --> $DIR/len_zero.rs:10:5
    |
-10 |       pub fn len(self: &Self) -> isize { //~ERROR item `PubOne` has a public `len` method but no corresponding `is_empty`
+10 |       pub fn len(self: &Self) -> isize {
    |  _____^ starting here...
 11 | |         1
 12 | |     }
@@ -16,13 +16,13 @@ note: lint level defined here
 error: trait `PubTraitsToo` has a `len` method but no `is_empty` method
   --> $DIR/len_zero.rs:32:5
    |
-32 |     fn len(self: &Self) -> isize; //~ERROR trait `PubTraitsToo` has a `len` method but no `is_empty`
+32 |     fn len(self: &Self) -> isize;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: item `HasIsEmpty` has a public `len` method but a private `is_empty` method
   --> $DIR/len_zero.rs:66:5
    |
-66 |       pub fn len(self: &Self) -> isize { //~ERROR item `HasIsEmpty` has a public `len` method but a private `is_empty`
+66 |       pub fn len(self: &Self) -> isize {
    |  _____^ starting here...
 67 | |         1
 68 | |     }
@@ -31,7 +31,7 @@ error: item `HasIsEmpty` has a public `len` method but a private `is_empty` meth
 error: item `HasWrongIsEmpty` has a public `len` method but no corresponding `is_empty` method
   --> $DIR/len_zero.rs:95:5
    |
-95 |       pub fn len(self: &Self) -> isize { //~ERROR item `HasWrongIsEmpty` has a public `len` method but no corresponding `is_empty`
+95 |       pub fn len(self: &Self) -> isize {
    |  _____^ starting here...
 96 | |         1
 97 | |     }
index b49e5a2612239bb08cb7eb609c7af2b8d54e186b..9e221cc5bc23b8fa82b686f1771b94b2e0f5fb86 100644 (file)
@@ -55,17 +55,17 @@ fn main() {
     issue985_alt();
 
     let mut foo = 0;
-    //~^ ERROR `if _ { .. } else { .. }` is an expression
-    //~| HELP more idiomatic
-    //~| SUGGESTION let <mut> foo = if f() { 42 } else { 0 };
+
+
+
     if f() {
         foo = 42;
     }
 
     let mut bar = 0;
-    //~^ ERROR `if _ { .. } else { .. }` is an expression
-    //~| HELP more idiomatic
-    //~| SUGGESTION let <mut> bar = if f() { ..; 42 } else { ..; 0 };
+
+
+
     if f() {
         f();
         bar = 42;
@@ -75,9 +75,9 @@ fn main() {
     }
 
     let quz;
-    //~^ ERROR `if _ { .. } else { .. }` is an expression
-    //~| HELP more idiomatic
-    //~| SUGGESTION let quz = if f() { 42 } else { 0 };
+
+
+
 
     if f() {
         quz = 42;
@@ -109,9 +109,9 @@ fn main() {
 
     // baz needs to be mut
     let mut baz = 0;
-    //~^ ERROR `if _ { .. } else { .. }` is an expression
-    //~| HELP more idiomatic
-    //~| SUGGESTION let <mut> baz = if f() { 42 } else { 0 };
+
+
+
     if f() {
         baz = 42;
     }
index 47ca7d2af163ef50a54d6a624e270647e3aa2980..fb5ef47ce0f794652bb763827d320fa5db261208 100644 (file)
@@ -3,9 +3,9 @@ error: `if _ { .. } else { .. }` is an expression
    |
 57 |       let mut foo = 0;
    |  _____^ starting here...
-58 | |     //~^ ERROR `if _ { .. } else { .. }` is an expression
-59 | |     //~| HELP more idiomatic
-60 | |     //~| SUGGESTION let <mut> foo = if f() { 42 } else { 0 };
+58 | |
+59 | |
+60 | |
 61 | |     if f() {
 62 | |         foo = 42;
 63 | |     }
@@ -44,9 +44,9 @@ error: `if _ { .. } else { .. }` is an expression
     |
 111 |       let mut baz = 0;
     |  _____^ starting here...
-112 | |     //~^ ERROR `if _ { .. } else { .. }` is an expression
-113 | |     //~| HELP more idiomatic
-114 | |     //~| SUGGESTION let <mut> baz = if f() { 42 } else { 0 };
+112 | |
+113 | |
+114 | |
 115 | |     if f() {
 116 | |         baz = 42;
 117 | |     }
index 477786813dbaf19dfda8d2a8a877d355f931deca..de0bb9b3cc1c400b680ebeb482cabd8b2f3dabbf 100644 (file)
@@ -6,14 +6,14 @@
 
 fn test() -> i32 {
     let _y = 0; // no warning
-    let x = 5;   //~NOTE this expression can be directly returned
-    x            //~ERROR returning the result of a let binding
+    let x = 5;
+    x
 }
 
 fn test_inner() -> i32 {
     if true {
-        let x = 5;   //~NOTE this expression can be directly returned
-        x            //~ERROR returning the result of a let binding
+        let x = 5;
+        x
     } else {
         0
     }
index 13197e5412c088a3d1792f14cdf364f2a6c1d301..8b5cfa6f31d0e70df6d2337c98566f17bc50e156 100644 (file)
@@ -1,7 +1,7 @@
 error: returning the result of a let binding from a block. Consider returning the expression directly.
   --> $DIR/let_return.rs:10:5
    |
-10 |     x            //~ERROR returning the result of a let binding
+10 |     x
    |     ^
    |
 note: lint level defined here
@@ -12,19 +12,19 @@ note: lint level defined here
 note: this expression can be directly returned
   --> $DIR/let_return.rs:9:13
    |
-9  |     let x = 5;   //~NOTE this expression can be directly returned
+9  |     let x = 5;
    |             ^
 
 error: returning the result of a let binding from a block. Consider returning the expression directly.
   --> $DIR/let_return.rs:16:9
    |
-16 |         x            //~ERROR returning the result of a let binding
+16 |         x
    |         ^
    |
 note: this expression can be directly returned
   --> $DIR/let_return.rs:15:17
    |
-15 |         let x = 5;   //~NOTE this expression can be directly returned
+15 |         let x = 5;
    |                 ^
 
 error: aborting due to 2 previous errors
index a0143406e52d8e9eb78e25602a6702f299472de7..fe541f3054c184f2978cf7f311f7a1df0f94853c 100644 (file)
@@ -11,11 +11,11 @@ macro_rules! let_and_return {
 }
 
 fn main() {
-    let _x = println!("x");  //~ERROR this let-binding has unit value
+    let _x = println!("x");
     let _y = 1;   // this is fine
     let _z = ((), 1);  // this as well
     if true {
-        let _a = ();  //~ERROR this let-binding has unit value
+        let _a = ();
     }
 
     let_and_return!(()) // should be fine
index 863b9dc59ebb5cec49ae297a8f1eefbcdd631444..abeeb3b3981b0d04acf99bfb3de4f375616104d0 100644 (file)
@@ -1,7 +1,7 @@
 error: this let-binding has unit value. Consider omitting `let _x =`
   --> $DIR/let_unit.rs:14:5
    |
-14 |     let _x = println!("x");  //~ERROR this let-binding has unit value
+14 |     let _x = println!("x");
    |     ^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: this let-binding has unit value. Consider omitting `let _a =`
   --> $DIR/let_unit.rs:18:9
    |
-18 |         let _a = ();  //~ERROR this let-binding has unit value
+18 |         let _a = ();
    |         ^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index 408b6762df69002047e484cc824e83e0a98d5ab9..ade0deeea2caa5dbbbda4be17e786a55f11ed6db 100644 (file)
@@ -5,10 +5,10 @@
 #![allow(dead_code)]
 
 fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) { }
-//~^ERROR explicit lifetimes given
+
 
 fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) { }
-//~^ERROR explicit lifetimes given
+
 
 fn same_lifetime_on_input<'a>(_x: &'a u8, _y: &'a u8) { } // no error, same lifetime on two params
 
@@ -17,7 +17,7 @@ fn only_static_on_input(_x: &u8, _y: &u8, _z: &'static u8) { } // no error, stat
 fn mut_and_static_input(_x: &mut u8, _y: &'static str) { }
 
 fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 { x }
-//~^ERROR explicit lifetimes given
+
 
 fn multiple_in_and_out_1<'a>(x: &'a u8, _y: &'a u8) -> &'a u8 { x } // no error, multiple input refs
 
@@ -30,18 +30,18 @@ fn deep_reference_1<'a, 'b>(x: &'a u8, _y: &'b u8) -> Result<&'a u8, ()> { Ok(x)
 fn deep_reference_2<'a>(x: Result<&'a u8, &'a u8>) -> &'a u8 { x.unwrap() } // no error, two input refs
 
 fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> { Ok(x) }
-//~^ERROR explicit lifetimes given
+
 
 // where clause, but without lifetimes
 fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> where T: Copy { Ok(x) }
-//~^ERROR explicit lifetimes given
+
 
 type Ref<'r> = &'r u8;
 
 fn lifetime_param_1<'a>(_x: Ref<'a>, _y: &'a u8) { } // no error, same lifetime on two params
 
 fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) { }
-//~^ERROR explicit lifetimes given
+
 
 fn lifetime_param_3<'a, 'b: 'a>(_x: Ref<'a>, _y: &'b u8) { } // no error, bounded lifetime
 
@@ -55,7 +55,7 @@ fn fn_bound<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
     where F: Fn(Lt<'a, I>) -> Lt<'a, I>  // no error, fn bound references 'a
 { unreachable!() }
 
-fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>  //~ERROR explicit lifetimes given
+fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
     where for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>
 { unreachable!() }
 
@@ -65,12 +65,12 @@ struct X {
 
 impl X {
     fn self_and_out<'s>(&'s self) -> &'s u8 { &self.x }
-    //~^ERROR explicit lifetimes given
+
 
     fn self_and_in_out<'s, 't>(&'s self, _x: &'t u8) -> &'s u8 { &self.x } // no error, multiple input refs
 
     fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) { }
-    //~^ERROR explicit lifetimes given
+
 
     fn self_and_same_in<'s>(&'s self, _x: &'s u8) { } // no error, same lifetimes on two params
 }
@@ -86,7 +86,7 @@ fn already_elided<'a>(_: &u8, _: &'a u8) -> &'a u8 {
     unimplemented!()
 }
 
-fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { unimplemented!() } //~ERROR explicit lifetimes given
+fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { unimplemented!() }
 
 // no warning, two input lifetimes (named on the reference, anonymous on Foo)
 fn struct_with_lt2<'a>(_foo: &'a Foo) -> &'a str { unimplemented!() }
@@ -106,11 +106,11 @@ fn trait_obj_elided<'a>(_arg: &'a WithLifetime) -> &'a str { unimplemented!() }
 
 // this should warn because there is no lifetime on Drop, so this would be
 // unambiguous if we elided the lifetime
-fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str { unimplemented!() } //~ERROR explicit lifetimes given
+fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str { unimplemented!() }
 
 type FooAlias<'a> = Foo<'a>;
 
-fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { unimplemented!() } //~ERROR explicit lifetimes given
+fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { unimplemented!() }
 
 // no warning, two input lifetimes (named on the reference, anonymous on Foo)
 fn alias_with_lt2<'a>(_foo: &'a FooAlias) -> &'a str { unimplemented!() }
@@ -121,11 +121,11 @@ fn alias_with_lt3<'a>(_foo: &FooAlias<'a> ) -> &'a str { unimplemented!() }
 // no warning, two input lifetimes
 fn alias_with_lt4<'a, 'b>(_foo: &'a FooAlias<'b> ) -> &'a str { unimplemented!() }
 
-fn named_input_elided_output<'a>(_arg: &'a str) -> &str { unimplemented!() } //~ERROR explicit lifetimes given
+fn named_input_elided_output<'a>(_arg: &'a str) -> &str { unimplemented!() }
 
 fn elided_input_named_output<'a>(_arg: &str) -> &'a str { unimplemented!() }
 
-fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { unimplemented!() } //~ERROR explicit lifetimes given
+fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { unimplemented!() }
 fn trait_bound<'a, T: WithLifetime<'a>>(_: &'a u8, _: T) { unimplemented!() }
 
 fn main() {
index 0d5f75c8930ab03cd15a07eb4b5bdf594143dcea..6d213ad45f243a91d4089253caced6bbcd2dfd6e 100644 (file)
@@ -43,7 +43,7 @@ error: explicit lifetimes given in parameter types where they could be elided
 error: explicit lifetimes given in parameter types where they could be elided
   --> $DIR/lifetimes.rs:58:1
    |
-58 |   fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>  //~ERROR explicit lifetimes given
+58 |   fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
    |  _^ starting here...
 59 | |     where for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>
 60 | | { unreachable!() }
@@ -64,31 +64,31 @@ error: explicit lifetimes given in parameter types where they could be elided
 error: explicit lifetimes given in parameter types where they could be elided
   --> $DIR/lifetimes.rs:89:1
    |
-89 | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { unimplemented!() } //~ERROR explicit lifetimes given
+89 | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { unimplemented!() }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided
    --> $DIR/lifetimes.rs:109:1
     |
-109 | fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str { unimplemented!() } //~ERROR explicit lifetimes given
+109 | fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str { unimplemented!() }
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided
    --> $DIR/lifetimes.rs:113:1
     |
-113 | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { unimplemented!() } //~ERROR explicit lifetimes given
+113 | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { unimplemented!() }
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided
    --> $DIR/lifetimes.rs:124:1
     |
-124 | fn named_input_elided_output<'a>(_arg: &'a str) -> &str { unimplemented!() } //~ERROR explicit lifetimes given
+124 | fn named_input_elided_output<'a>(_arg: &'a str) -> &str { unimplemented!() }
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided
    --> $DIR/lifetimes.rs:128:1
     |
-128 | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { unimplemented!() } //~ERROR explicit lifetimes given
+128 | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { unimplemented!() }
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 14 previous errors
index 980ae5cb7a11f0242411cc617da31b90ba47dcb2..5b65a5c3a26da34ea6b564f6a9e15af93d127eea 100644 (file)
@@ -10,7 +10,7 @@
 
 declare_lint! { GOOD_LINT, Warn, "good lint" }
 declare_lint! { MISSING_LINT, Warn, "missing lint" }
-//~^ ERROR: the lint `MISSING_LINT` is not added to any `LintPass`
+
 
 pub struct Pass;
 
index 6c8a27c2ed4a2d85347479ae774dc9d9bcb43ba4..e4cee81d53f0c2ee890a135df9b3d5f5f22b1637 100644 (file)
@@ -11,27 +11,27 @@ fn main() {
     let ok4 = 0xab_cd_i32;
     let ok5 = 0xAB_CD_u32;
     let ok5 = 0xAB_CD_isize;
-    let fail1 = 0xabCD;       //~ERROR inconsistent casing in hexadecimal literal
-    let fail2 = 0xabCD_u32;   //~ERROR inconsistent casing in hexadecimal literal
-    let fail2 = 0xabCD_isize; //~ERROR inconsistent casing in hexadecimal literal
+    let fail1 = 0xabCD;
+    let fail2 = 0xabCD_u32;
+    let fail2 = 0xabCD_isize;
 
     let ok6 = 1234_i32;
     let ok7 = 1234_f32;
     let ok8 = 1234_isize;
-    let fail3 = 1234i32;      //~ERROR integer type suffix should be separated
-    let fail4 = 1234u32;      //~ERROR integer type suffix should be separated
-    let fail5 = 1234isize;    //~ERROR integer type suffix should be separated
-    let fail6 = 1234usize;    //~ERROR integer type suffix should be separated
-    let fail7 = 1.5f32;       //~ERROR float type suffix should be separated
+    let fail3 = 1234i32;
+    let fail4 = 1234u32;
+    let fail5 = 1234isize;
+    let fail6 = 1234usize;
+    let fail7 = 1.5f32;
 
     let ok9 = 0;
     let ok10 = 0_i64;
     let fail8 = 0123;
-    //~^ERROR decimal constant
-    //~|HELP remove the `0`
-    //~|SUGGESTION = 123;
-    //~|HELP use `0o`
-    //~|SUGGESTION = 0o123;
+
+
+
+
+
 
     let ok11 = 0o123;
     let ok12 = 0b101010;
index 2806e688c824103354d1dbd16c793fc28448e893..b9a0fc041811204ededf3e122720b22ae834b671 100644 (file)
@@ -1,7 +1,7 @@
 error: inconsistent casing in hexadecimal literal
   --> $DIR/literals.rs:14:17
    |
-14 |     let fail1 = 0xabCD;       //~ERROR inconsistent casing in hexadecimal literal
+14 |     let fail1 = 0xabCD;
    |                 ^^^^^^
    |
 note: lint level defined here
@@ -13,19 +13,19 @@ note: lint level defined here
 error: inconsistent casing in hexadecimal literal
   --> $DIR/literals.rs:15:17
    |
-15 |     let fail2 = 0xabCD_u32;   //~ERROR inconsistent casing in hexadecimal literal
+15 |     let fail2 = 0xabCD_u32;
    |                 ^^^^^^^^^^
 
 error: inconsistent casing in hexadecimal literal
   --> $DIR/literals.rs:16:17
    |
-16 |     let fail2 = 0xabCD_isize; //~ERROR inconsistent casing in hexadecimal literal
+16 |     let fail2 = 0xabCD_isize;
    |                 ^^^^^^^^^^^^
 
 error: integer type suffix should be separated by an underscore
   --> $DIR/literals.rs:21:17
    |
-21 |     let fail3 = 1234i32;      //~ERROR integer type suffix should be separated
+21 |     let fail3 = 1234i32;
    |                 ^^^^^^^
    |
 note: lint level defined here
@@ -37,25 +37,25 @@ note: lint level defined here
 error: integer type suffix should be separated by an underscore
   --> $DIR/literals.rs:22:17
    |
-22 |     let fail4 = 1234u32;      //~ERROR integer type suffix should be separated
+22 |     let fail4 = 1234u32;
    |                 ^^^^^^^
 
 error: integer type suffix should be separated by an underscore
   --> $DIR/literals.rs:23:17
    |
-23 |     let fail5 = 1234isize;    //~ERROR integer type suffix should be separated
+23 |     let fail5 = 1234isize;
    |                 ^^^^^^^^^
 
 error: integer type suffix should be separated by an underscore
   --> $DIR/literals.rs:24:17
    |
-24 |     let fail6 = 1234usize;    //~ERROR integer type suffix should be separated
+24 |     let fail6 = 1234usize;
    |                 ^^^^^^^^^
 
 error: float type suffix should be separated by an underscore
   --> $DIR/literals.rs:25:17
    |
-25 |     let fail7 = 1.5f32;       //~ERROR float type suffix should be separated
+25 |     let fail7 = 1.5f32;
    |                 ^^^^^^
 
 error: this is a decimal constant
index b4f97ae8e6e435178747891decee7cdd05c4b37f..f62d73532dd13a8fec8298ef797d8903690a911a 100644 (file)
@@ -9,30 +9,30 @@
 
 fn map_clone_iter() {
     let x = [1,2,3];
-    x.iter().map(|y| y.clone()); //~ ERROR you seem to be using .map()
-                                 //~^ HELP try
-    x.iter().map(|&y| y); //~ ERROR you seem to be using .map()
-                          //~^ HELP try
-    x.iter().map(|y| *y); //~ ERROR you seem to be using .map()
-                          //~^ HELP try
-    x.iter().map(|y| { y.clone() }); //~ ERROR you seem to be using .map()
-                                 //~^ HELP try
-    x.iter().map(|&y| { y }); //~ ERROR you seem to be using .map()
-                          //~^ HELP try
-    x.iter().map(|y| { *y }); //~ ERROR you seem to be using .map()
-                          //~^ HELP try
-    x.iter().map(Clone::clone); //~ ERROR you seem to be using .map()
-                                //~^ HELP try
+    x.iter().map(|y| y.clone());
+
+    x.iter().map(|&y| y);
+
+    x.iter().map(|y| *y);
+
+    x.iter().map(|y| { y.clone() });
+
+    x.iter().map(|&y| { y });
+
+    x.iter().map(|y| { *y });
+
+    x.iter().map(Clone::clone);
+
 }
 
 fn map_clone_option() {
     let x = Some(4);
-    x.as_ref().map(|y| y.clone()); //~ ERROR you seem to be using .map()
-                                   //~^ HELP try
-    x.as_ref().map(|&y| y); //~ ERROR you seem to be using .map()
-                            //~^ HELP try
-    x.as_ref().map(|y| *y); //~ ERROR you seem to be using .map()
-                            //~^ HELP try
+    x.as_ref().map(|y| y.clone());
+
+    x.as_ref().map(|&y| y);
+
+    x.as_ref().map(|y| *y);
+
 }
 
 fn not_linted_option() {
@@ -87,8 +87,8 @@ fn deref(&self) -> &i32 { &NINE }
 
 fn map_clone_deref() {
     let x = Some(UnusualDeref);
-    let _: Option<UnusualDeref> = x.as_ref().map(|y| *y); //~ ERROR you seem to be using .map()
-                                                          //~^ HELP try
+    let _: Option<UnusualDeref> = x.as_ref().map(|y| *y);
+
 
     // Not linted: using deref conversion
     let _: Option<i32> = x.map(|y| *y);
index aa44340dca697be3165e0fa0186e3dfc692cb2e3..0a8a659d720611064917072b78f0174174ad337c 100644 (file)
@@ -1,7 +1,7 @@
 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
   --> $DIR/map_clone.rs:12:5
    |
-12 |     x.iter().map(|y| y.clone()); //~ ERROR you seem to be using .map()
+12 |     x.iter().map(|y| y.clone());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -15,7 +15,7 @@ note: lint level defined here
 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
   --> $DIR/map_clone.rs:14:5
    |
-14 |     x.iter().map(|&y| y); //~ ERROR you seem to be using .map()
+14 |     x.iter().map(|&y| y);
    |     ^^^^^^^^^^^^^^^^^^^^
    |
    = help: try
@@ -24,7 +24,7 @@ error: you seem to be using .map() to clone the contents of an iterator, conside
 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
   --> $DIR/map_clone.rs:16:5
    |
-16 |     x.iter().map(|y| *y); //~ ERROR you seem to be using .map()
+16 |     x.iter().map(|y| *y);
    |     ^^^^^^^^^^^^^^^^^^^^
    |
    = help: try
@@ -33,7 +33,7 @@ error: you seem to be using .map() to clone the contents of an iterator, conside
 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
   --> $DIR/map_clone.rs:18:5
    |
-18 |     x.iter().map(|y| { y.clone() }); //~ ERROR you seem to be using .map()
+18 |     x.iter().map(|y| { y.clone() });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: try
@@ -42,7 +42,7 @@ error: you seem to be using .map() to clone the contents of an iterator, conside
 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
   --> $DIR/map_clone.rs:20:5
    |
-20 |     x.iter().map(|&y| { y }); //~ ERROR you seem to be using .map()
+20 |     x.iter().map(|&y| { y });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: try
@@ -51,7 +51,7 @@ error: you seem to be using .map() to clone the contents of an iterator, conside
 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
   --> $DIR/map_clone.rs:22:5
    |
-22 |     x.iter().map(|y| { *y }); //~ ERROR you seem to be using .map()
+22 |     x.iter().map(|y| { *y });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: try
@@ -60,7 +60,7 @@ error: you seem to be using .map() to clone the contents of an iterator, conside
 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
   --> $DIR/map_clone.rs:24:5
    |
-24 |     x.iter().map(Clone::clone); //~ ERROR you seem to be using .map()
+24 |     x.iter().map(Clone::clone);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: try
@@ -69,7 +69,7 @@ error: you seem to be using .map() to clone the contents of an iterator, conside
 error: you seem to be using .map() to clone the contents of an Option, consider using `.cloned()`
   --> $DIR/map_clone.rs:30:5
    |
-30 |     x.as_ref().map(|y| y.clone()); //~ ERROR you seem to be using .map()
+30 |     x.as_ref().map(|y| y.clone());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: try
@@ -78,7 +78,7 @@ error: you seem to be using .map() to clone the contents of an Option, consider
 error: you seem to be using .map() to clone the contents of an Option, consider using `.cloned()`
   --> $DIR/map_clone.rs:32:5
    |
-32 |     x.as_ref().map(|&y| y); //~ ERROR you seem to be using .map()
+32 |     x.as_ref().map(|&y| y);
    |     ^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: try
@@ -87,7 +87,7 @@ error: you seem to be using .map() to clone the contents of an Option, consider
 error: you seem to be using .map() to clone the contents of an Option, consider using `.cloned()`
   --> $DIR/map_clone.rs:34:5
    |
-34 |     x.as_ref().map(|y| *y); //~ ERROR you seem to be using .map()
+34 |     x.as_ref().map(|y| *y);
    |     ^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: try
@@ -96,7 +96,7 @@ error: you seem to be using .map() to clone the contents of an Option, consider
 error: you seem to be using .map() to clone the contents of an Option, consider using `.cloned()`
   --> $DIR/map_clone.rs:90:35
    |
-90 |     let _: Option<UnusualDeref> = x.as_ref().map(|y| *y); //~ ERROR you seem to be using .map()
+90 |     let _: Option<UnusualDeref> = x.as_ref().map(|y| *y);
    |                                   ^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: try
index 6cfb45e1f7e65b64f9535dd2da3f9b3fd17fb29c..00faed26818ae62760a7a829ceee5fb6fe95d324 100644 (file)
@@ -24,9 +24,9 @@ fn dummy() {
 
 fn unwrap_addr() -> Option<&'static ExprNode> {
     match ExprNode::Butterflies {
-        //~^ ERROR you seem to be trying to use match
-        //~| HELP try
-        //~| SUGGESTION if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else { let x = 5; None }
+
+
+
         ExprNode::ExprAddrOf => Some(&NODE),
         _ => { let x = 5; None },
     }
@@ -36,18 +36,18 @@ fn single_match(){
     let x = Some(1u8);
 
     match x {
-        //~^ ERROR you seem to be trying to use match
-        //~| HELP try
-        //~| SUGGESTION if let Some(y) = x { println!("{:?}", y); };
+
+
+
         Some(y) => { println!("{:?}", y); }
         _ => ()
     };
 
     let z = (1u8,1u8);
     match z {
-        //~^ ERROR you seem to be trying to use match
-        //~| HELP try
-        //~| SUGGESTION if let (2...3, 7...9) = z { dummy() };
+
+
+
         (2...3, 7...9) => dummy(),
         _ => {}
     };
@@ -70,17 +70,17 @@ fn single_match_know_enum() {
     let y : Result<_, i8> = Ok(1i8);
 
     match x {
-        //~^ ERROR you seem to be trying to use match
-        //~| HELP try
-        //~| SUGGESTION if let Some(y) = x { dummy() };
+
+
+
         Some(y) => dummy(),
         None => ()
     };
 
     match y {
-        //~^ ERROR you seem to be trying to use match
-        //~| HELP try
-        //~| SUGGESTION if let Ok(y) = y { dummy() };
+
+
+
         Ok(y) => dummy(),
         Err(..) => ()
     };
@@ -88,9 +88,9 @@ fn single_match_know_enum() {
     let c = Cow::Borrowed("");
 
     match c {
-        //~^ ERROR you seem to be trying to use match
-        //~| HELP try
-        //~| SUGGESTION if let Cow::Borrowed(..) = c { dummy() };
+
+
+
         Cow::Borrowed(..) => dummy(),
         Cow::Owned(..) => (),
     };
@@ -112,51 +112,51 @@ fn match_bool() {
     let test: bool = true;
 
     match test {
-    //~^ ERROR you seem to be trying to match on a boolean expression
-    //~| HELP consider
-    //~| SUGGESTION if test { 0 } else { 42 };
+
+
+
         true => 0,
         false => 42,
     };
 
     let option = 1;
     match option == 1 {
-    //~^ ERROR you seem to be trying to match on a boolean expression
-    //~| HELP consider
-    //~| SUGGESTION if option == 1 { 1 } else { 0 };
+
+
+
         true => 1,
         false => 0,
     };
 
     match test {
-    //~^ ERROR you seem to be trying to match on a boolean expression
-    //~| HELP consider
-    //~| SUGGESTION if !test { println!("Noooo!"); };
+
+
+
         true => (),
         false => { println!("Noooo!"); }
     };
 
     match test {
-    //~^ ERROR you seem to be trying to match on a boolean expression
-    //~| HELP consider
-    //~| SUGGESTION if !test { println!("Noooo!"); };
+
+
+
         false => { println!("Noooo!"); }
         _ => (),
     };
 
     match test && test {
-    //~^ ERROR you seem to be trying to match on a boolean expression
-    //~| HELP consider
-    //~| SUGGESTION if !(test && test) { println!("Noooo!"); };
-    //~| ERROR equal expressions as operands
+
+
+
+
         false => { println!("Noooo!"); }
         _ => (),
     };
 
     match test {
-    //~^ ERROR you seem to be trying to match on a boolean expression
-    //~| HELP consider
-    //~| SUGGESTION if test { println!("Yes!"); } else { println!("Noooo!"); };
+
+
+
         false => { println!("Noooo!"); }
         true => { println!("Yes!"); }
     };
@@ -173,9 +173,9 @@ fn ref_pats() {
     {
         let v = &Some(0);
         match v {
-            //~^ERROR add `&` to all patterns
-            //~|HELP instead of
-            //~|SUGGESTION match *v { .. }
+
+
+
             &Some(v) => println!("{:?}", v),
             &None => println!("none"),
         }
@@ -186,18 +186,18 @@ fn ref_pats() {
     }
     let tup =& (1, 2);
     match tup {
-        //~^ERROR add `&` to all patterns
-        //~|HELP instead of
-        //~|SUGGESTION match *tup { .. }
+
+
+
         &(v, 1) => println!("{}", v),
         _ => println!("none"),
     }
     // special case: using & both in expr and pats
     let w = Some(0);
     match &w {
-        //~^ERROR add `&` to both
-        //~|HELP try
-        //~|SUGGESTION match w { .. }
+
+
+
         &Some(v) => println!("{:?}", v),
         &None => println!("none"),
     }
@@ -209,17 +209,17 @@ fn ref_pats() {
 
     let a = &Some(0);
     if let &None = a {
-        //~^ERROR add `&` to all patterns
-        //~|HELP instead of
-        //~|SUGGESTION if let .. = *a { .. }
+
+
+
         println!("none");
     }
 
     let b = Some(0);
     if let &None = &b {
-        //~^ERROR add `&` to both
-        //~|HELP try
-        //~|SUGGESTION if let .. = b { .. }
+
+
+
         println!("none");
     }
 }
@@ -228,27 +228,27 @@ fn overlapping() {
     const FOO : u64 = 2;
 
     match 42 {
-        0 ... 10 => println!("0 ... 10"), //~ERROR: some ranges overlap
-        0 ... 11 => println!("0 ... 11"), //~NOTE overlaps with this
+        0 ... 10 => println!("0 ... 10"),
+        0 ... 11 => println!("0 ... 11"),
         _ => (),
     }
 
     match 42 {
-        0 ... 5 => println!("0 ... 5"), //~ERROR: some ranges overlap
+        0 ... 5 => println!("0 ... 5"),
         6 ... 7 => println!("6 ... 7"),
-        FOO ... 11 => println!("0 ... 11"), //~NOTE overlaps with this
+        FOO ... 11 => println!("0 ... 11"),
         _ => (),
     }
 
     match 42 {
-        2 => println!("2"), //~NOTE overlaps with this
-        0 ... 5 => println!("0 ... 5"), //~ERROR: some ranges overlap
+        2 => println!("2"),
+        0 ... 5 => println!("0 ... 5"),
         _ => (),
     }
 
     match 42 {
-        2 => println!("2"), //~NOTE overlaps with this
-        0 ... 2 => println!("0 ... 2"), //~ERROR: some ranges overlap
+        2 => println!("2"),
+        0 ... 2 => println!("0 ... 2"),
         _ => (),
     }
 
@@ -271,8 +271,8 @@ fn overlapping() {
     }
 
     match 42 {
-        0 .. 11 => println!("0 .. 11"), //~ERROR: some ranges overlap
-        0 ... 11 => println!("0 ... 11"), //~NOTE overlaps with this
+        0 .. 11 => println!("0 .. 11"),
+        0 ... 11 => println!("0 ... 11"),
         _ => (),
     }
 
index d24bb6cb1fff41723206cc9d78bac0fd6fa2c022..bc254cb0bcb3dd06adafa0230ab4481bfe2d20e7 100644 (file)
@@ -3,9 +3,9 @@ error: you seem to be trying to use match for destructuring a single pattern. Co
    |
 26 |       match ExprNode::Butterflies {
    |  _____^ starting here...
-27 | |         //~^ ERROR you seem to be trying to use match
-28 | |         //~| HELP try
-29 | |         //~| SUGGESTION if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else { let x = 5; None }
+27 | |
+28 | |
+29 | |
 30 | |         ExprNode::ExprAddrOf => Some(&NODE),
 31 | |         _ => { let x = 5; None },
 32 | |     }
@@ -24,9 +24,9 @@ error: you seem to be trying to use match for destructuring a single pattern. Co
    |
 38 |       match x {
    |  _____^ starting here...
-39 | |         //~^ ERROR you seem to be trying to use match
-40 | |         //~| HELP try
-41 | |         //~| SUGGESTION if let Some(y) = x { println!("{:?}", y); };
+39 | |
+40 | |
+41 | |
 42 | |         Some(y) => { println!("{:?}", y); }
 43 | |         _ => ()
 44 | |     };
@@ -46,9 +46,9 @@ error: you seem to be trying to use match for destructuring a single pattern. Co
    |
 47 |       match z {
    |  _____^ starting here...
-48 | |         //~^ ERROR you seem to be trying to use match
-49 | |         //~| HELP try
-50 | |         //~| SUGGESTION if let (2...3, 7...9) = z { dummy() };
+48 | |
+49 | |
+50 | |
 51 | |         (2...3, 7...9) => dummy(),
 52 | |         _ => {}
 53 | |     };
@@ -63,9 +63,9 @@ error: you seem to be trying to use match for destructuring a single pattern. Co
    |
 72 |       match x {
    |  _____^ starting here...
-73 | |         //~^ ERROR you seem to be trying to use match
-74 | |         //~| HELP try
-75 | |         //~| SUGGESTION if let Some(y) = x { dummy() };
+73 | |
+74 | |
+75 | |
 76 | |         Some(y) => dummy(),
 77 | |         None => ()
 78 | |     };
@@ -80,9 +80,9 @@ error: you seem to be trying to use match for destructuring a single pattern. Co
    |
 80 |       match y {
    |  _____^ starting here...
-81 | |         //~^ ERROR you seem to be trying to use match
-82 | |         //~| HELP try
-83 | |         //~| SUGGESTION if let Ok(y) = y { dummy() };
+81 | |
+82 | |
+83 | |
 84 | |         Ok(y) => dummy(),
 85 | |         Err(..) => ()
 86 | |     };
@@ -97,9 +97,9 @@ error: you seem to be trying to use match for destructuring a single pattern. Co
    |
 90 |       match c {
    |  _____^ starting here...
-91 | |         //~^ ERROR you seem to be trying to use match
-92 | |         //~| HELP try
-93 | |         //~| SUGGESTION if let Cow::Borrowed(..) = c { dummy() };
+91 | |
+92 | |
+93 | |
 94 | |         Cow::Borrowed(..) => dummy(),
 95 | |         Cow::Owned(..) => (),
 96 | |     };
@@ -114,9 +114,9 @@ error: you seem to be trying to match on a boolean expression
     |
 114 |       match test {
     |  _____^ starting here...
-115 | |     //~^ ERROR you seem to be trying to match on a boolean expression
-116 | |     //~| HELP consider
-117 | |     //~| SUGGESTION if test { 0 } else { 42 };
+115 | |
+116 | |
+117 | |
 118 | |         true => 0,
 119 | |         false => 42,
 120 | |     };
@@ -136,9 +136,9 @@ error: you seem to be trying to match on a boolean expression
     |
 123 |       match option == 1 {
     |  _____^ starting here...
-124 | |     //~^ ERROR you seem to be trying to match on a boolean expression
-125 | |     //~| HELP consider
-126 | |     //~| SUGGESTION if option == 1 { 1 } else { 0 };
+124 | |
+125 | |
+126 | |
 127 | |         true => 1,
 128 | |         false => 0,
 129 | |     };
@@ -153,9 +153,9 @@ error: you seem to be trying to match on a boolean expression
     |
 131 |       match test {
     |  _____^ starting here...
-132 | |     //~^ ERROR you seem to be trying to match on a boolean expression
-133 | |     //~| HELP consider
-134 | |     //~| SUGGESTION if !test { println!("Noooo!"); };
+132 | |
+133 | |
+134 | |
 135 | |         true => (),
 136 | |         false => { println!("Noooo!"); }
 137 | |     };
@@ -170,9 +170,9 @@ error: you seem to be trying to match on a boolean expression
     |
 139 |       match test {
     |  _____^ starting here...
-140 | |     //~^ ERROR you seem to be trying to match on a boolean expression
-141 | |     //~| HELP consider
-142 | |     //~| SUGGESTION if !test { println!("Noooo!"); };
+140 | |
+141 | |
+142 | |
 143 | |         false => { println!("Noooo!"); }
 144 | |         _ => (),
 145 | |     };
@@ -187,10 +187,10 @@ error: you seem to be trying to match on a boolean expression
     |
 147 |       match test && test {
     |  _____^ starting here...
-148 | |     //~^ ERROR you seem to be trying to match on a boolean expression
-149 | |     //~| HELP consider
-150 | |     //~| SUGGESTION if !(test && test) { println!("Noooo!"); };
-151 | |     //~| ERROR equal expressions as operands
+148 | |
+149 | |
+150 | |
+151 | |
 152 | |         false => { println!("Noooo!"); }
 153 | |         _ => (),
 154 | |     };
@@ -218,9 +218,9 @@ error: you seem to be trying to match on a boolean expression
     |
 156 |       match test {
     |  _____^ starting here...
-157 | |     //~^ ERROR you seem to be trying to match on a boolean expression
-158 | |     //~| HELP consider
-159 | |     //~| SUGGESTION if test { println!("Yes!"); } else { println!("Noooo!"); };
+157 | |
+158 | |
+159 | |
 160 | |         false => { println!("Noooo!"); }
 161 | |         true => { println!("Yes!"); }
 162 | |     };
@@ -235,9 +235,9 @@ error: you don't need to add `&` to all patterns
     |
 175 |           match v {
     |  _________^ starting here...
-176 | |             //~^ERROR add `&` to all patterns
-177 | |             //~|HELP instead of
-178 | |             //~|SUGGESTION match *v { .. }
+176 | |
+177 | |
+178 | |
 179 | |             &Some(v) => println!("{:?}", v),
 180 | |             &None => println!("none"),
 181 | |         }
@@ -257,9 +257,9 @@ error: you don't need to add `&` to all patterns
     |
 188 |       match tup {
     |  _____^ starting here...
-189 | |         //~^ERROR add `&` to all patterns
-190 | |         //~|HELP instead of
-191 | |         //~|SUGGESTION match *tup { .. }
+189 | |
+190 | |
+191 | |
 192 | |         &(v, 1) => println!("{}", v),
 193 | |         _ => println!("none"),
 194 | |     }
@@ -274,9 +274,9 @@ error: you don't need to add `&` to both the expression and the patterns
     |
 197 |       match &w {
     |  _____^ starting here...
-198 | |         //~^ERROR add `&` to both
-199 | |         //~|HELP try
-200 | |         //~|SUGGESTION match w { .. }
+198 | |
+199 | |
+200 | |
 201 | |         &Some(v) => println!("{:?}", v),
 202 | |         &None => println!("none"),
 203 | |     }
@@ -291,9 +291,9 @@ error: you don't need to add `&` to all patterns
     |
 211 |       if let &None = a {
     |  _____^ starting here...
-212 | |         //~^ERROR add `&` to all patterns
-213 | |         //~|HELP instead of
-214 | |         //~|SUGGESTION if let .. = *a { .. }
+212 | |
+213 | |
+214 | |
 215 | |         println!("none");
 216 | |     }
     | |_____^ ...ending here
@@ -307,9 +307,9 @@ error: you don't need to add `&` to both the expression and the patterns
     |
 219 |       if let &None = &b {
     |  _____^ starting here...
-220 | |         //~^ERROR add `&` to both
-221 | |         //~|HELP try
-222 | |         //~|SUGGESTION if let .. = b { .. }
+220 | |
+221 | |
+222 | |
 223 | |         println!("none");
 224 | |     }
     | |_____^ ...ending here
@@ -321,7 +321,7 @@ help: try
 error: some ranges overlap
    --> $DIR/matches.rs:231:9
     |
-231 |         0 ... 10 => println!("0 ... 10"), //~ERROR: some ranges overlap
+231 |         0 ... 10 => println!("0 ... 10"),
     |         ^^^^^^^^
     |
     = note: #[deny(match_overlapping_arm)] implied by #[deny(clippy)]
@@ -333,59 +333,59 @@ note: lint level defined here
 note: overlaps with this
    --> $DIR/matches.rs:232:9
     |
-232 |         0 ... 11 => println!("0 ... 11"), //~NOTE overlaps with this
+232 |         0 ... 11 => println!("0 ... 11"),
     |         ^^^^^^^^
 
 error: some ranges overlap
    --> $DIR/matches.rs:237:9
     |
-237 |         0 ... 5 => println!("0 ... 5"), //~ERROR: some ranges overlap
+237 |         0 ... 5 => println!("0 ... 5"),
     |         ^^^^^^^
     |
     = note: #[deny(match_overlapping_arm)] implied by #[deny(clippy)]
 note: overlaps with this
    --> $DIR/matches.rs:239:9
     |
-239 |         FOO ... 11 => println!("0 ... 11"), //~NOTE overlaps with this
+239 |         FOO ... 11 => println!("0 ... 11"),
     |         ^^^^^^^^^^
 
 error: some ranges overlap
    --> $DIR/matches.rs:245:9
     |
-245 |         0 ... 5 => println!("0 ... 5"), //~ERROR: some ranges overlap
+245 |         0 ... 5 => println!("0 ... 5"),
     |         ^^^^^^^
     |
     = note: #[deny(match_overlapping_arm)] implied by #[deny(clippy)]
 note: overlaps with this
    --> $DIR/matches.rs:244:9
     |
-244 |         2 => println!("2"), //~NOTE overlaps with this
+244 |         2 => println!("2"),
     |         ^
 
 error: some ranges overlap
    --> $DIR/matches.rs:251:9
     |
-251 |         0 ... 2 => println!("0 ... 2"), //~ERROR: some ranges overlap
+251 |         0 ... 2 => println!("0 ... 2"),
     |         ^^^^^^^
     |
     = note: #[deny(match_overlapping_arm)] implied by #[deny(clippy)]
 note: overlaps with this
    --> $DIR/matches.rs:250:9
     |
-250 |         2 => println!("2"), //~NOTE overlaps with this
+250 |         2 => println!("2"),
     |         ^
 
 error: some ranges overlap
    --> $DIR/matches.rs:274:9
     |
-274 |         0 .. 11 => println!("0 .. 11"), //~ERROR: some ranges overlap
+274 |         0 .. 11 => println!("0 .. 11"),
     |         ^^^^^^^
     |
     = note: #[deny(match_overlapping_arm)] implied by #[deny(clippy)]
 note: overlaps with this
    --> $DIR/matches.rs:275:9
     |
-275 |         0 ... 11 => println!("0 ... 11"), //~NOTE overlaps with this
+275 |         0 ... 11 => println!("0 ... 11"),
     |         ^^^^^^^^
 
 error: aborting due to 23 previous errors
index c8cebcb2a42dca72b1ebffc7b359672434fd958e..9832bd992c1c11bf5651726c48d25b9a820cf1d4 100644 (file)
@@ -14,15 +14,15 @@ fn main() {
 
     let six: Arc<i32> = Arc::new(6);
     memstuff::forget(six);
-    //~^ ERROR usage of mem::forget on Drop type
+
 
     let seven: Rc<i32> = Rc::new(7);
     std::mem::forget(seven);
-    //~^ ERROR usage of mem::forget on Drop type
+
 
     let eight: Vec<i32> = vec![8];
     forgetSomething(eight);
-    //~^ ERROR usage of mem::forget on Drop type
+
 
     std::mem::forget(7);
 }
index 43a4386886d9f8b0353694aee1d8216aa5f7a57c..da37ac8f566af7d18c0b773d6292e95143a95657 100644 (file)
 struct T;
 
 impl T {
-    fn add(self, other: T) -> T { self } //~ERROR defining a method called `add`
-    fn drop(&mut self) { } //~ERROR defining a method called `drop`
+    fn add(self, other: T) -> T { self }
+    fn drop(&mut self) { }
 
     fn sub(&self, other: T) -> &T { self } // no error, self is a ref
     fn div(self) -> T { self } // no error, different #arguments
     fn rem(self, other: T) { } // no error, wrong return type
 
     fn into_u32(self) -> u32 { 0 } // fine
-    fn into_u16(&self) -> u16 { 0 } //~ERROR methods called `into_*` usually take self by value
+    fn into_u16(&self) -> u16 { 0 }
 
-    fn to_something(self) -> u32 { 0 } //~ERROR methods called `to_*` usually take self by reference
+    fn to_something(self) -> u32 { 0 }
 
     fn new(self) {}
-    //~^ ERROR methods called `new` usually take no self
-    //~| ERROR methods called `new` usually return `Self`
+
+
 }
 
 struct Lt<'a> {
@@ -96,15 +96,15 @@ fn option_methods() {
 
     // Check OPTION_MAP_UNWRAP_OR
     // single line case
-    let _ = opt.map(|x| x + 1) //~  ERROR called `map(f).unwrap_or(a)`
-                               //~| NOTE replace `map(|x| x + 1).unwrap_or(0)`
+    let _ = opt.map(|x| x + 1)
+
                .unwrap_or(0); // should lint even though this call is on a separate line
     // multi line cases
-    let _ = opt.map(|x| { //~ ERROR called `map(f).unwrap_or(a)`
+    let _ = opt.map(|x| {
                         x + 1
                     }
               ).unwrap_or(0);
-    let _ = opt.map(|x| x + 1) //~ ERROR called `map(f).unwrap_or(a)`
+    let _ = opt.map(|x| x + 1)
                .unwrap_or({
                     0
                 });
@@ -113,15 +113,15 @@ fn option_methods() {
 
     // Check OPTION_MAP_UNWRAP_OR_ELSE
     // single line case
-    let _ = opt.map(|x| x + 1) //~  ERROR called `map(f).unwrap_or_else(g)`
-                               //~| NOTE replace `map(|x| x + 1).unwrap_or_else(|| 0)`
+    let _ = opt.map(|x| x + 1)
+
                .unwrap_or_else(|| 0); // should lint even though this call is on a separate line
     // multi line cases
-    let _ = opt.map(|x| { //~ ERROR called `map(f).unwrap_or_else(g)`
+    let _ = opt.map(|x| {
                         x + 1
                     }
               ).unwrap_or_else(|| 0);
-    let _ = opt.map(|x| x + 1) //~ ERROR called `map(f).unwrap_or_else(g)`
+    let _ = opt.map(|x| x + 1)
                .unwrap_or_else(||
                     0
                 );
@@ -194,11 +194,11 @@ fn filter_next() {
 
     // check single-line case
     let _ = v.iter().filter(|&x| *x < 0).next();
-    //~^ ERROR called `filter(p).next()` on an `Iterator`.
-    //~| NOTE replace `filter(|&x| *x < 0).next()`
+
+
 
     // check multi-line case
-    let _ = v.iter().filter(|&x| { //~ERROR called `filter(p).next()` on an `Iterator`.
+    let _ = v.iter().filter(|&x| {
                                 *x < 0
                             }
                    ).next();
@@ -214,33 +214,33 @@ fn search_is_some() {
 
     // check `find().is_some()`, single-line
     let _ = v.iter().find(|&x| *x < 0).is_some();
-    //~^ ERROR called `is_some()` after searching
-    //~| NOTE replace `find(|&x| *x < 0).is_some()`
+
+
 
     // check `find().is_some()`, multi-line
-    let _ = v.iter().find(|&x| { //~ERROR called `is_some()` after searching
+    let _ = v.iter().find(|&x| {
                               *x < 0
                           }
                    ).is_some();
 
     // check `position().is_some()`, single-line
     let _ = v.iter().position(|&x| x < 0).is_some();
-    //~^ ERROR called `is_some()` after searching
-    //~| NOTE replace `position(|&x| x < 0).is_some()`
+
+
 
     // check `position().is_some()`, multi-line
-    let _ = v.iter().position(|&x| { //~ERROR called `is_some()` after searching
+    let _ = v.iter().position(|&x| {
                                   x < 0
                               }
                    ).is_some();
 
     // check `rposition().is_some()`, single-line
     let _ = v.iter().rposition(|&x| x < 0).is_some();
-    //~^ ERROR called `is_some()` after searching
-    //~| NOTE replace `rposition(|&x| x < 0).is_some()`
+
+
 
     // check `rposition().is_some()`, multi-line
-    let _ = v.iter().rposition(|&x| { //~ERROR called `is_some()` after searching
+    let _ = v.iter().rposition(|&x| {
                                    x < 0
                                }
                    ).is_some();
@@ -276,75 +276,75 @@ const fn make_const(i: i32) -> i32 { i }
 
     let with_constructor = Some(vec![1]);
     with_constructor.unwrap_or(make());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_constructor.unwrap_or_else(make)
+
+
+
 
     let with_new = Some(vec![1]);
     with_new.unwrap_or(Vec::new());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_new.unwrap_or_default();
+
+
+
 
     let with_const_args = Some(vec![1]);
     with_const_args.unwrap_or(Vec::with_capacity(12));
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_const_args.unwrap_or_else(|| Vec::with_capacity(12));
+
+
+
 
     let with_err : Result<_, ()> = Ok(vec![1]);
     with_err.unwrap_or(make());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_err.unwrap_or_else(|_| make());
+
+
+
 
     let with_err_args : Result<_, ()> = Ok(vec![1]);
     with_err_args.unwrap_or(Vec::with_capacity(12));
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_err_args.unwrap_or_else(|_| Vec::with_capacity(12));
+
+
+
 
     let with_default_trait = Some(1);
     with_default_trait.unwrap_or(Default::default());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_default_trait.unwrap_or_default();
+
+
+
 
     let with_default_type = Some(1);
     with_default_type.unwrap_or(u64::default());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION with_default_type.unwrap_or_default();
+
+
+
 
     let with_vec = Some(vec![1]);
     with_vec.unwrap_or(vec![]);
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
+
+
     // FIXME #944: ~|SUGGESTION with_vec.unwrap_or_else(|| vec![]);
 
     let without_default = Some(Foo);
     without_default.unwrap_or(Foo::new());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION without_default.unwrap_or_else(Foo::new);
+
+
+
 
     let mut map = HashMap::<u64, String>::new();
     map.entry(42).or_insert(String::new());
-    //~^ERROR use of `or_insert` followed by a function call
-    //~|HELP try this
-    //~|SUGGESTION map.entry(42).or_insert_with(String::new);
+
+
+
 
     let mut btree = BTreeMap::<u64, String>::new();
     btree.entry(42).or_insert(String::new());
-    //~^ERROR use of `or_insert` followed by a function call
-    //~|HELP try this
-    //~|SUGGESTION btree.entry(42).or_insert_with(String::new);
+
+
+
 
     let stringy = Some(String::from(""));
     let _ = stringy.unwrap_or("".to_owned());
-    //~^ERROR use of `unwrap_or`
-    //~|HELP try this
-    //~|SUGGESTION stringy.unwrap_or_else(|| "".to_owned());
+
+
+
 }
 
 /// Checks implementation of `ITER_NTH` lint
@@ -356,27 +356,27 @@ fn iter_nth() {
     {
         // Make sure we lint `.iter()` for relevant types
         let bad_vec = some_vec.iter().nth(3);
-        //~^ERROR called `.iter().nth()` on a Vec. Calling `.get()` is both faster and more readable
+
         let bad_slice = &some_vec[..].iter().nth(3);
-        //~^ERROR called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
+
         let bad_boxed_slice = boxed_slice.iter().nth(3);
-        //~^ERROR called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
+
         let bad_vec_deque = some_vec_deque.iter().nth(3);
-        //~^ERROR called `.iter().nth()` on a VecDeque. Calling `.get()` is both faster and more readable
+
     }
 
     {
         // Make sure we lint `.iter_mut()` for relevant types
         let bad_vec = some_vec.iter_mut().nth(3);
-        //~^ERROR called `.iter_mut().nth()` on a Vec. Calling `.get_mut()` is both faster and more readable
+
     }
     {
         let bad_slice = &some_vec[..].iter_mut().nth(3);
-        //~^ERROR called `.iter_mut().nth()` on a slice. Calling `.get_mut()` is both faster and more readable
+
     }
     {
         let bad_vec_deque = some_vec_deque.iter_mut().nth(3);
-        //~^ERROR called `.iter_mut().nth()` on a VecDeque. Calling `.get_mut()` is both faster and more readable
+
     }
 
     // Make sure we don't lint for non-relevant types
@@ -390,16 +390,16 @@ fn iter_skip_next() {
     let mut some_vec = vec![0, 1, 2, 3];
 
     let _ = some_vec.iter().skip(42).next();
-    //~^ERROR called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
+
 
     let _ = some_vec.iter().cycle().skip(42).next();
-    //~^ERROR called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
+
 
     let _ = (1..10).skip(10).next();
-    //~^ERROR called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
+
 
     let _ = &some_vec[..].iter().skip(3).next();
-    //~^ERROR called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
+
 
     let foo = IteratorFalsePositives { foo : 0 };
     let _ = foo.skip(42).next();
@@ -427,50 +427,50 @@ fn get_unwrap() {
 
     { // Test `get().unwrap()`
         let _ = boxed_slice.get(1).unwrap();
-        //~^ERROR called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION boxed_slice[1]
+
+
+
         let _ = some_slice.get(0).unwrap();
-        //~^ERROR called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION some_slice[0]
+
+
+
         let _ = some_vec.get(0).unwrap();
-        //~^ERROR called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION some_vec[0]
+
+
+
         let _ = some_vecdeque.get(0).unwrap();
-        //~^ERROR called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION some_vecdeque[0]
+
+
+
         let _ = some_hashmap.get(&1).unwrap();
-        //~^ERROR called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION some_hashmap[&1]
+
+
+
         let _ = some_btreemap.get(&1).unwrap();
-        //~^ERROR called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION some_btreemap[&1]
+
+
+
 
         let _ = false_positive.get(0).unwrap();
     }
 
     { // Test `get_mut().unwrap()`
         *boxed_slice.get_mut(0).unwrap() = 1;
-        //~^ERROR called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION &mut boxed_slice[0]
+
+
+
         *some_slice.get_mut(0).unwrap() = 1;
-        //~^ERROR called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION &mut some_slice[0]
+
+
+
         *some_vec.get_mut(0).unwrap() = 1;
-        //~^ERROR called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION &mut some_vec[0]
+
+
+
         *some_vecdeque.get_mut(0).unwrap() = 1;
-        //~^ERROR called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
-        //~|HELP try this
-        //~|SUGGESTION &mut some_vecdeque[0]
+
+
+
 
         // Check false positives
         *some_hashmap.get_mut(&1).unwrap() = 'b';
@@ -485,24 +485,24 @@ fn main() {
     use std::io;
 
     let opt = Some(0);
-    let _ = opt.unwrap();  //~ERROR used unwrap() on an Option
+    let _ = opt.unwrap();
 
     let res: Result<i32, ()> = Ok(0);
-    let _ = res.unwrap();  //~ERROR used unwrap() on a Result
+    let _ = res.unwrap();
 
-    res.ok().expect("disaster!"); //~ERROR called `ok().expect()`
+    res.ok().expect("disaster!");
     // the following should not warn, since `expect` isn't implemented unless
     // the error type implements `Debug`
     let res2: Result<i32, MyError> = Ok(0);
     res2.ok().expect("oh noes!");
     let res3: Result<u32, MyErrorWithParam<u8>>= Ok(0);
-    res3.ok().expect("whoof"); //~ERROR called `ok().expect()`
+    res3.ok().expect("whoof");
     let res4: Result<u32, io::Error> = Ok(0);
-    res4.ok().expect("argh"); //~ERROR called `ok().expect()`
+    res4.ok().expect("argh");
     let res5: io::Result<u32> = Ok(0);
-    res5.ok().expect("oops"); //~ERROR called `ok().expect()`
+    res5.ok().expect("oops");
     let res6: Result<u32, &str> = Ok(0);
-    res6.ok().expect("meh"); //~ERROR called `ok().expect()`
+    res6.ok().expect("meh");
 }
 
 struct MyError(()); // doesn't implement Debug
@@ -515,14 +515,14 @@ struct MyErrorWithParam<T> {
 #[allow(unnecessary_operation)]
 fn starts_with() {
     "".chars().next() == Some(' ');
-    //~^ ERROR starts_with
-    //~| HELP like this
-    //~| SUGGESTION "".starts_with(' ')
+
+
+
 
     Some(' ') != "".chars().next();
-    //~^ ERROR starts_with
-    //~| HELP like this
-    //~| SUGGESTION !"".starts_with(' ')
+
+
+
 }
 
 fn str_extend_chars() {
@@ -532,21 +532,21 @@ fn str_extend_chars() {
 
     s.push_str(abc);
     s.extend(abc.chars());
-    //~^ERROR calling `.extend(_.chars())`
-    //~|HELP try this
-    //~|SUGGESTION s.push_str(abc)
+
+
+
 
     s.push_str("abc");
     s.extend("abc".chars());
-    //~^ERROR calling `.extend(_.chars())`
-    //~|HELP try this
-    //~|SUGGESTION s.push_str("abc")
+
+
+
 
     s.push_str(&def);
     s.extend(def.chars());
-    //~^ERROR calling `.extend(_.chars())`
-    //~|HELP try this
-    //~|SUGGESTION s.push_str(&def)
+
+
+
 
     s.extend(abc.chars().skip(1));
     s.extend("abc".chars().skip(1));
@@ -557,40 +557,40 @@ fn str_extend_chars() {
 }
 
 fn clone_on_copy() {
-    42.clone(); //~ERROR using `clone` on a `Copy` type
-                //~| HELP try removing the `clone` call
-                //~| SUGGESTION 42
+    42.clone();
+
+
     vec![1].clone(); // ok, not a Copy type
     Some(vec![1]).clone(); // ok, not a Copy type
-    (&42).clone(); //~ERROR using `clone` on a `Copy` type
-                   //~| HELP try dereferencing it
-                   //~| SUGGESTION *(&42)
+    (&42).clone();
+
+
 }
 
 fn clone_on_copy_generic<T: Copy>(t: T) {
-    t.clone(); //~ERROR using `clone` on a `Copy` type
-               //~| HELP try removing the `clone` call
-               //~| SUGGESTION t
-    Some(t).clone(); //~ERROR using `clone` on a `Copy` type
-                     //~| HELP try removing the `clone` call
-                     //~| SUGGESTION Some(t)
+    t.clone();
+
+
+    Some(t).clone();
+
+
 }
 
 fn clone_on_double_ref() {
     let x = vec![1];
     let y = &&x;
-    let z: &Vec<_> = y.clone(); //~ERROR using `clone` on a double
-                                //~| HELP try dereferencing it
-                                //~| SUGGESTION let z: &Vec<_> = (*y).clone();
+    let z: &Vec<_> = y.clone();
+
+
     println!("{:p} {:p}",*y, z);
 }
 
 fn single_char_pattern() {
     let x = "foo";
     x.split("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.split('x');
+
+
+
 
     x.split("xx");
 
@@ -612,69 +612,69 @@ fn single_char_pattern() {
     x.split("❤️");
 
     x.contains("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.contains('x');
+
+
+
     x.starts_with("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.starts_with('x');
+
+
+
     x.ends_with("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.ends_with('x');
+
+
+
     x.find("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.find('x');
+
+
+
     x.rfind("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.rfind('x');
+
+
+
     x.rsplit("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.rsplit('x');
+
+
+
     x.split_terminator("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.split_terminator('x');
+
+
+
     x.rsplit_terminator("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.rsplit_terminator('x');
+
+
+
     x.splitn(0, "x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.splitn(0, 'x');
+
+
+
     x.rsplitn(0, "x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.rsplitn(0, 'x');
+
+
+
     x.matches("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.matches('x');
+
+
+
     x.rmatches("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.rmatches('x');
+
+
+
     x.match_indices("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.match_indices('x');
+
+
+
     x.rmatch_indices("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.rmatch_indices('x');
+
+
+
     x.trim_left_matches("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.trim_left_matches('x');
+
+
+
     x.trim_right_matches("x");
-    //~^ ERROR single-character string constant used as pattern
-    //~| HELP try using a char instead:
-    //~| SUGGESTION x.trim_right_matches('x');
+
+
+
 
     let h = HashSet::<String>::new();
     h.contains("X"); // should not warn
@@ -685,7 +685,7 @@ fn temporary_cstring() {
     use std::ffi::CString;
 
     CString::new("foo").unwrap().as_ptr();
-    //~^ ERROR you are getting the inner pointer of a temporary `CString`
-    //~| NOTE that pointer will be invalid outside this expression
-    //~| HELP assign the `CString` to a variable to extend its lifetime
+
+
+
 }
index 6b3470f11dce19725c44946fe859f3dcf9f57d68..f4294d8b396b69bf237c87917a695606ba9f819e 100644 (file)
@@ -1,7 +1,7 @@
 error: defining a method called `add` on this type; consider implementing the `std::ops::Add` trait or choosing a less ambiguous name
   --> $DIR/methods.rs:18:5
    |
-18 |     fn add(self, other: T) -> T { self } //~ERROR defining a method called `add`
+18 |     fn add(self, other: T) -> T { self }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(should_implement_trait)] implied by #[deny(clippy)]
@@ -14,7 +14,7 @@ note: lint level defined here
 error: defining a method called `drop` on this type; consider implementing the `std::ops::Drop` trait or choosing a less ambiguous name
   --> $DIR/methods.rs:19:5
    |
-19 |     fn drop(&mut self) { } //~ERROR defining a method called `drop`
+19 |     fn drop(&mut self) { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(should_implement_trait)] implied by #[deny(clippy)]
@@ -22,7 +22,7 @@ error: defining a method called `drop` on this type; consider implementing the `
 error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name
   --> $DIR/methods.rs:26:17
    |
-26 |     fn into_u16(&self) -> u16 { 0 } //~ERROR methods called `into_*` usually take self by value
+26 |     fn into_u16(&self) -> u16 { 0 }
    |                 ^^^^^
    |
    = note: #[deny(wrong_self_convention)] implied by #[deny(clippy)]
@@ -35,7 +35,7 @@ note: lint level defined here
 error: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name
   --> $DIR/methods.rs:28:21
    |
-28 |     fn to_something(self) -> u32 { 0 } //~ERROR methods called `to_*` usually take self by reference
+28 |     fn to_something(self) -> u32 { 0 }
    |                     ^^^^
    |
    = note: #[deny(wrong_self_convention)] implied by #[deny(clippy)]
@@ -64,9 +64,9 @@ note: lint level defined here
 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
    --> $DIR/methods.rs:99:13
     |
-99  |       let _ = opt.map(|x| x + 1) //~  ERROR called `map(f).unwrap_or(a)`
+99  |       let _ = opt.map(|x| x + 1)
     |  _____________^ starting here...
-100 | |                                //~| NOTE replace `map(|x| x + 1).unwrap_or(0)`
+100 | |
 101 | |                .unwrap_or(0); // should lint even though this call is on a separate line
     | |____________________________^ ...ending here
     |
@@ -81,7 +81,7 @@ note: lint level defined here
 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
    --> $DIR/methods.rs:103:13
     |
-103 |       let _ = opt.map(|x| { //~ ERROR called `map(f).unwrap_or(a)`
+103 |       let _ = opt.map(|x| {
     |  _____________^ starting here...
 104 | |                         x + 1
 105 | |                     }
@@ -93,7 +93,7 @@ error: called `map(f).unwrap_or(a)` on an Option value. This can be done more di
 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
    --> $DIR/methods.rs:107:13
     |
-107 |       let _ = opt.map(|x| x + 1) //~ ERROR called `map(f).unwrap_or(a)`
+107 |       let _ = opt.map(|x| x + 1)
     |  _____________^ starting here...
 108 | |                .unwrap_or({
 109 | |                     0
@@ -105,9 +105,9 @@ error: called `map(f).unwrap_or(a)` on an Option value. This can be done more di
 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
    --> $DIR/methods.rs:116:13
     |
-116 |       let _ = opt.map(|x| x + 1) //~  ERROR called `map(f).unwrap_or_else(g)`
+116 |       let _ = opt.map(|x| x + 1)
     |  _____________^ starting here...
-117 | |                                //~| NOTE replace `map(|x| x + 1).unwrap_or_else(|| 0)`
+117 | |
 118 | |                .unwrap_or_else(|| 0); // should lint even though this call is on a separate line
     | |____________________________________^ ...ending here
     |
@@ -122,7 +122,7 @@ note: lint level defined here
 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
    --> $DIR/methods.rs:120:13
     |
-120 |       let _ = opt.map(|x| { //~ ERROR called `map(f).unwrap_or_else(g)`
+120 |       let _ = opt.map(|x| {
     |  _____________^ starting here...
 121 | |                         x + 1
 122 | |                     }
@@ -134,7 +134,7 @@ error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done mo
 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
    --> $DIR/methods.rs:124:13
     |
-124 |       let _ = opt.map(|x| x + 1) //~ ERROR called `map(f).unwrap_or_else(g)`
+124 |       let _ = opt.map(|x| x + 1)
     |  _____________^ starting here...
 125 | |                .unwrap_or_else(||
 126 | |                     0
@@ -160,7 +160,7 @@ note: lint level defined here
 error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
    --> $DIR/methods.rs:201:13
     |
-201 |       let _ = v.iter().filter(|&x| { //~ERROR called `filter(p).next()` on an `Iterator`.
+201 |       let _ = v.iter().filter(|&x| {
     |  _____________^ starting here...
 202 | |                                 *x < 0
 203 | |                             }
@@ -186,7 +186,7 @@ note: lint level defined here
 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
    --> $DIR/methods.rs:221:13
     |
-221 |       let _ = v.iter().find(|&x| { //~ERROR called `is_some()` after searching
+221 |       let _ = v.iter().find(|&x| {
     |  _____________^ starting here...
 222 | |                               *x < 0
 223 | |                           }
@@ -207,7 +207,7 @@ error: called `is_some()` after searching an `Iterator` with position. This is m
 error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
    --> $DIR/methods.rs:232:13
     |
-232 |       let _ = v.iter().position(|&x| { //~ERROR called `is_some()` after searching
+232 |       let _ = v.iter().position(|&x| {
     |  _____________^ starting here...
 233 | |                                   x < 0
 234 | |                               }
@@ -228,7 +228,7 @@ error: called `is_some()` after searching an `Iterator` with rposition. This is
 error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
    --> $DIR/methods.rs:243:13
     |
-243 |       let _ = v.iter().rposition(|&x| { //~ERROR called `is_some()` after searching
+243 |       let _ = v.iter().rposition(|&x| {
     |  _____________^ starting here...
 244 | |                                    x < 0
 245 | |                                }
@@ -568,7 +568,7 @@ help: try this
 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
    --> $DIR/methods.rs:488:13
     |
-488 |     let _ = opt.unwrap();  //~ERROR used unwrap() on an Option
+488 |     let _ = opt.unwrap();
     |             ^^^^^^^^^^^^
     |
     = note: #[deny(option_unwrap_used)] implied by #[deny(clippy_pedantic)]
@@ -581,7 +581,7 @@ note: lint level defined here
 error: used unwrap() on a Result value. If you don't want to handle the Err case gracefully, consider using expect() to provide a better panic message
    --> $DIR/methods.rs:491:13
     |
-491 |     let _ = res.unwrap();  //~ERROR used unwrap() on a Result
+491 |     let _ = res.unwrap();
     |             ^^^^^^^^^^^^
     |
     = note: #[deny(result_unwrap_used)] implied by #[deny(clippy_pedantic)]
@@ -594,7 +594,7 @@ note: lint level defined here
 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
    --> $DIR/methods.rs:493:5
     |
-493 |     res.ok().expect("disaster!"); //~ERROR called `ok().expect()`
+493 |     res.ok().expect("disaster!");
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: #[deny(ok_expect)] implied by #[deny(clippy)]
@@ -607,7 +607,7 @@ note: lint level defined here
 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
    --> $DIR/methods.rs:499:5
     |
-499 |     res3.ok().expect("whoof"); //~ERROR called `ok().expect()`
+499 |     res3.ok().expect("whoof");
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: #[deny(ok_expect)] implied by #[deny(clippy)]
@@ -615,7 +615,7 @@ error: called `ok().expect()` on a Result value. You can call `expect` directly
 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
    --> $DIR/methods.rs:501:5
     |
-501 |     res4.ok().expect("argh"); //~ERROR called `ok().expect()`
+501 |     res4.ok().expect("argh");
     |     ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: #[deny(ok_expect)] implied by #[deny(clippy)]
@@ -623,7 +623,7 @@ error: called `ok().expect()` on a Result value. You can call `expect` directly
 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
    --> $DIR/methods.rs:503:5
     |
-503 |     res5.ok().expect("oops"); //~ERROR called `ok().expect()`
+503 |     res5.ok().expect("oops");
     |     ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: #[deny(ok_expect)] implied by #[deny(clippy)]
@@ -631,7 +631,7 @@ error: called `ok().expect()` on a Result value. You can call `expect` directly
 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
    --> $DIR/methods.rs:505:5
     |
-505 |     res6.ok().expect("meh"); //~ERROR called `ok().expect()`
+505 |     res6.ok().expect("meh");
     |     ^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: #[deny(ok_expect)] implied by #[deny(clippy)]
@@ -699,7 +699,7 @@ help: try this
 error: using `clone` on a `Copy` type
    --> $DIR/methods.rs:560:5
     |
-560 |     42.clone(); //~ERROR using `clone` on a `Copy` type
+560 |     42.clone();
     |     ^^^^^^^^^^
     |
     = note: #[deny(clone_on_copy)] implied by #[deny(clippy)]
@@ -709,42 +709,42 @@ note: lint level defined here
 5   | #![deny(clippy, clippy_pedantic)]
     |         ^^^^^^
 help: try removing the `clone` call
-    |     42; //~ERROR using `clone` on a `Copy` type
+    |     42;
 
 error: using `clone` on a `Copy` type
    --> $DIR/methods.rs:565:5
     |
-565 |     (&42).clone(); //~ERROR using `clone` on a `Copy` type
+565 |     (&42).clone();
     |     ^^^^^^^^^^^^^
     |
     = note: #[deny(clone_on_copy)] implied by #[deny(clippy)]
 help: try dereferencing it
-    |     *(&42); //~ERROR using `clone` on a `Copy` type
+    |     *(&42);
 
 error: using `clone` on a `Copy` type
    --> $DIR/methods.rs:571:5
     |
-571 |     t.clone(); //~ERROR using `clone` on a `Copy` type
+571 |     t.clone();
     |     ^^^^^^^^^
     |
     = note: #[deny(clone_on_copy)] implied by #[deny(clippy)]
 help: try removing the `clone` call
-    |     t; //~ERROR using `clone` on a `Copy` type
+    |     t;
 
 error: using `clone` on a `Copy` type
    --> $DIR/methods.rs:574:5
     |
-574 |     Some(t).clone(); //~ERROR using `clone` on a `Copy` type
+574 |     Some(t).clone();
     |     ^^^^^^^^^^^^^^^
     |
     = note: #[deny(clone_on_copy)] implied by #[deny(clippy)]
 help: try removing the `clone` call
-    |     Some(t); //~ERROR using `clone` on a `Copy` type
+    |     Some(t);
 
 error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
    --> $DIR/methods.rs:582:22
     |
-582 |     let z: &Vec<_> = y.clone(); //~ERROR using `clone` on a double
+582 |     let z: &Vec<_> = y.clone();
     |                      ^^^^^^^^^
     |
     = note: #[deny(clone_double_ref)] implied by #[deny(clippy)]
@@ -754,7 +754,7 @@ note: lint level defined here
 5   | #![deny(clippy, clippy_pedantic)]
     |         ^^^^^^
 help: try dereferencing it
-    |     let z: &Vec<_> = (*y).clone(); //~ERROR using `clone` on a double
+    |     let z: &Vec<_> = (*y).clone();
 
 error: single-character string constant used as pattern
    --> $DIR/methods.rs:590:13
index 9a6794afebf1bf9931e647c8522859ba649b60fa..d74e52732633b079854165b7c5b7b8fcbc7e1b7f 100644 (file)
 fn main() {
     let x;
     x = 2usize;
-    min(1, max(3, x)); //~ERROR this min/max combination leads to constant result
-    min(max(3, x), 1); //~ERROR this min/max combination leads to constant result
-    max(min(x, 1), 3); //~ERROR this min/max combination leads to constant result
-    max(3, min(x, 1)); //~ERROR this min/max combination leads to constant result
+    min(1, max(3, x));
+    min(max(3, x), 1);
+    max(min(x, 1), 3);
+    max(3, min(x, 1));
 
-    my_max(3, my_min(x, 1)); //~ERROR this min/max combination leads to constant result
+    my_max(3, my_min(x, 1));
 
     min(3, max(1, x)); // ok, could be 1, 2 or 3 depending on x
 
@@ -26,8 +26,8 @@ fn main() {
     let s;
     s = "Hello";
 
-    min("Apple", max("Zoo", s)); //~ERROR this min/max combination leads to constant result
-    max(min(s, "Apple"), "Zoo"); //~ERROR this min/max combination leads to constant result
+    min("Apple", max("Zoo", s));
+    max(min(s, "Apple"), "Zoo");
 
     max("Apple", min(s, "Zoo")); // ok
 }
index 3cb562e26df9998604fc63d9588f19af0f751ac1..1170373ab9855dd4c6470158448eb3e402107047 100644 (file)
@@ -1,7 +1,7 @@
 error: this min/max combination leads to constant result
   --> $DIR/min_max.rs:15:5
    |
-15 |     min(1, max(3, x)); //~ERROR this min/max combination leads to constant result
+15 |     min(1, max(3, x));
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(min_max)] implied by #[deny(clippy)]
@@ -14,7 +14,7 @@ note: lint level defined here
 error: this min/max combination leads to constant result
   --> $DIR/min_max.rs:16:5
    |
-16 |     min(max(3, x), 1); //~ERROR this min/max combination leads to constant result
+16 |     min(max(3, x), 1);
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(min_max)] implied by #[deny(clippy)]
@@ -22,7 +22,7 @@ error: this min/max combination leads to constant result
 error: this min/max combination leads to constant result
   --> $DIR/min_max.rs:17:5
    |
-17 |     max(min(x, 1), 3); //~ERROR this min/max combination leads to constant result
+17 |     max(min(x, 1), 3);
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(min_max)] implied by #[deny(clippy)]
@@ -30,7 +30,7 @@ error: this min/max combination leads to constant result
 error: this min/max combination leads to constant result
   --> $DIR/min_max.rs:18:5
    |
-18 |     max(3, min(x, 1)); //~ERROR this min/max combination leads to constant result
+18 |     max(3, min(x, 1));
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(min_max)] implied by #[deny(clippy)]
@@ -38,7 +38,7 @@ error: this min/max combination leads to constant result
 error: this min/max combination leads to constant result
   --> $DIR/min_max.rs:20:5
    |
-20 |     my_max(3, my_min(x, 1)); //~ERROR this min/max combination leads to constant result
+20 |     my_max(3, my_min(x, 1));
    |     ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(min_max)] implied by #[deny(clippy)]
@@ -46,7 +46,7 @@ error: this min/max combination leads to constant result
 error: this min/max combination leads to constant result
   --> $DIR/min_max.rs:29:5
    |
-29 |     min("Apple", max("Zoo", s)); //~ERROR this min/max combination leads to constant result
+29 |     min("Apple", max("Zoo", s));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(min_max)] implied by #[deny(clippy)]
@@ -54,7 +54,7 @@ error: this min/max combination leads to constant result
 error: this min/max combination leads to constant result
   --> $DIR/min_max.rs:30:5
    |
-30 |     max(min(s, "Apple"), "Zoo"); //~ERROR this min/max combination leads to constant result
+30 |     max(min(s, "Apple"), "Zoo");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(min_max)] implied by #[deny(clippy)]
index acd86f18ea3d5cb6b1b8213c6807485eda755655..cd69ef1b08eca1a47ed747c8ba9e8d7e5a0e9386 100644 (file)
 //! Some garbage docs for the crate here
 #![doc="More garbage"]
 
-type Typedef = String; //~ ERROR: missing documentation for a type alias
-pub type PubTypedef = String; //~ ERROR: missing documentation for a type alias
+type Typedef = String;
+pub type PubTypedef = String;
 
-struct Foo { //~ ERROR: missing documentation for a struct
-    a: isize, //~ ERROR: missing documentation for a struct field
-    b: isize, //~ ERROR: missing documentation for a struct field
+struct Foo {
+    a: isize,
+    b: isize,
 }
 
-pub struct PubFoo { //~ ERROR: missing documentation for a struct
-    pub a: isize,      //~ ERROR: missing documentation for a struct field
-    b: isize, //~ ERROR: missing documentation for a struct field
+pub struct PubFoo {
+    pub a: isize,
+    b: isize,
 }
 
 #[allow(missing_docs_in_private_items)]
@@ -42,13 +42,13 @@ pub struct PubFoo2 {
     pub c: isize,
 }
 
-mod module_no_dox {} //~ ERROR: missing documentation for a module
-pub mod pub_module_no_dox {} //~ ERROR: missing documentation for a module
+mod module_no_dox {}
+pub mod pub_module_no_dox {}
 
 /// dox
 pub fn foo() {}
-pub fn foo2() {} //~ ERROR: missing documentation for a function
-fn foo3() {} //~ ERROR: missing documentation for a function
+pub fn foo2() {}
+fn foo3() {}
 #[allow(missing_docs_in_private_items)] pub fn foo4() {}
 
 /// dox
@@ -65,9 +65,9 @@ trait B {
     fn foo_with_impl(&self) {}
 }
 
-pub trait C { //~ ERROR: missing documentation for a trait
-    fn foo(&self); //~ ERROR: missing documentation for a trait method
-    fn foo_with_impl(&self) {} //~ ERROR: missing documentation for a trait method
+pub trait C {
+    fn foo(&self);
+    fn foo_with_impl(&self) {}
 }
 
 #[allow(missing_docs_in_private_items)]
@@ -77,8 +77,8 @@ fn dummy(&self) { }
 
 /// dox
 pub trait E {
-    type AssociatedType; //~ ERROR: missing documentation for an associated type
-    type AssociatedTypeDef = Self; //~ ERROR: missing documentation for an associated type
+    type AssociatedType;
+    type AssociatedTypeDef = Self;
 
     /// dox
     type DocumentedType;
@@ -89,15 +89,15 @@ fn dummy(&self) {}
 }
 
 impl Foo {
-    pub fn foo() {} //~ ERROR: missing documentation for a method
-    fn bar() {} //~ ERROR: missing documentation for a method
+    pub fn foo() {}
+    fn bar() {}
 }
 
 impl PubFoo {
-    pub fn foo() {} //~ ERROR: missing documentation for a method
+    pub fn foo() {}
     /// dox
     pub fn foo1() {}
-    fn foo2() {} //~ ERROR: missing documentation for a method
+    fn foo2() {}
     #[allow(missing_docs_in_private_items)] pub fn foo3() {}
 }
 
@@ -123,17 +123,17 @@ pub fn baz() {}
     }
 }
 
-enum Baz { //~ ERROR: missing documentation for an enum
-    BazA { //~ ERROR: missing documentation for a variant
-        a: isize, //~ ERROR: missing documentation for a struct field
-        b: isize //~ ERROR: missing documentation for a struct field
+enum Baz {
+    BazA {
+        a: isize,
+        b: isize
     },
-    BarB //~ ERROR: missing documentation for a variant
+    BarB
 }
 
-pub enum PubBaz { //~ ERROR: missing documentation for an enum
-    PubBazA { //~ ERROR: missing documentation for a variant
-        a: isize, //~ ERROR: missing documentation for a struct field
+pub enum PubBaz {
+    PubBazA {
+        a: isize,
     },
 }
 
@@ -157,38 +157,38 @@ pub enum PubBaz3 {
 pub fn baz() {}
 
 
-const FOO: u32 = 0; //~ ERROR: missing documentation for a const
+const FOO: u32 = 0;
 /// dox
 pub const FOO1: u32 = 0;
 #[allow(missing_docs_in_private_items)]
 pub const FOO2: u32 = 0;
 #[doc(hidden)]
 pub const FOO3: u32 = 0;
-pub const FOO4: u32 = 0; //~ ERROR: missing documentation for a const
+pub const FOO4: u32 = 0;
 
 
-static BAR: u32 = 0; //~ ERROR: missing documentation for a static
+static BAR: u32 = 0;
 /// dox
 pub static BAR1: u32 = 0;
 #[allow(missing_docs_in_private_items)]
 pub static BAR2: u32 = 0;
 #[doc(hidden)]
 pub static BAR3: u32 = 0;
-pub static BAR4: u32 = 0; //~ ERROR: missing documentation for a static
+pub static BAR4: u32 = 0;
 
 
-mod internal_impl { //~ ERROR: missing documentation for a module
+mod internal_impl {
     /// dox
     pub fn documented() {}
-    pub fn undocumented1() {} //~ ERROR: missing documentation for a function
-    pub fn undocumented2() {} //~ ERROR: missing documentation for a function
-    fn undocumented3() {} //~ ERROR: missing documentation for a function
+    pub fn undocumented1() {}
+    pub fn undocumented2() {}
+    fn undocumented3() {}
     /// dox
     pub mod globbed {
         /// dox
         pub fn also_documented() {}
-        pub fn also_undocumented1() {} //~ ERROR: missing documentation for a function
-        fn also_undocumented2() {} //~ ERROR: missing documentation for a function
+        pub fn also_undocumented1() {}
+        fn also_undocumented2() {}
     }
 }
 /// dox
@@ -199,4 +199,4 @@ pub mod public_interface {
     pub use internal_impl::globbed::*;
 }
 
-fn main() {} //~ ERROR: missing documentation for a function
+fn main() {}
index b81f46eaa1dbdf1becd2784a248c8e46b898ddfc..6e3a146ee2d34a106f0c6d2ac9dcaf85938f1466 100644 (file)
@@ -1,7 +1,7 @@
 error: missing documentation for a type alias
   --> $DIR/missing-doc.rs:26:1
    |
-26 | type Typedef = String; //~ ERROR: missing documentation for a type alias
+26 | type Typedef = String;
    | ^^^^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,183 +13,183 @@ note: lint level defined here
 error: missing documentation for a type alias
   --> $DIR/missing-doc.rs:27:1
    |
-27 | pub type PubTypedef = String; //~ ERROR: missing documentation for a type alias
+27 | pub type PubTypedef = String;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a struct
   --> $DIR/missing-doc.rs:29:1
    |
-29 |   struct Foo { //~ ERROR: missing documentation for a struct
+29 |   struct Foo {
    |  _^ starting here...
-30 | |     a: isize, //~ ERROR: missing documentation for a struct field
-31 | |     b: isize, //~ ERROR: missing documentation for a struct field
+30 | |     a: isize,
+31 | |     b: isize,
 32 | | }
    | |_^ ...ending here
 
 error: missing documentation for a struct field
   --> $DIR/missing-doc.rs:30:5
    |
-30 |     a: isize, //~ ERROR: missing documentation for a struct field
+30 |     a: isize,
    |     ^^^^^^^^
 
 error: missing documentation for a struct field
   --> $DIR/missing-doc.rs:31:5
    |
-31 |     b: isize, //~ ERROR: missing documentation for a struct field
+31 |     b: isize,
    |     ^^^^^^^^
 
 error: missing documentation for a struct
   --> $DIR/missing-doc.rs:34:1
    |
-34 |   pub struct PubFoo { //~ ERROR: missing documentation for a struct
+34 |   pub struct PubFoo {
    |  _^ starting here...
-35 | |     pub a: isize,      //~ ERROR: missing documentation for a struct field
-36 | |     b: isize, //~ ERROR: missing documentation for a struct field
+35 | |     pub a: isize,
+36 | |     b: isize,
 37 | | }
    | |_^ ...ending here
 
 error: missing documentation for a struct field
   --> $DIR/missing-doc.rs:35:5
    |
-35 |     pub a: isize,      //~ ERROR: missing documentation for a struct field
+35 |     pub a: isize,
    |     ^^^^^^^^^^^^
 
 error: missing documentation for a struct field
   --> $DIR/missing-doc.rs:36:5
    |
-36 |     b: isize, //~ ERROR: missing documentation for a struct field
+36 |     b: isize,
    |     ^^^^^^^^
 
 error: missing documentation for a module
   --> $DIR/missing-doc.rs:45:1
    |
-45 | mod module_no_dox {} //~ ERROR: missing documentation for a module
+45 | mod module_no_dox {}
    | ^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a module
   --> $DIR/missing-doc.rs:46:1
    |
-46 | pub mod pub_module_no_dox {} //~ ERROR: missing documentation for a module
+46 | pub mod pub_module_no_dox {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a function
   --> $DIR/missing-doc.rs:50:1
    |
-50 | pub fn foo2() {} //~ ERROR: missing documentation for a function
+50 | pub fn foo2() {}
    | ^^^^^^^^^^^^^^^^
 
 error: missing documentation for a function
   --> $DIR/missing-doc.rs:51:1
    |
-51 | fn foo3() {} //~ ERROR: missing documentation for a function
+51 | fn foo3() {}
    | ^^^^^^^^^^^^
 
 error: missing documentation for a trait
   --> $DIR/missing-doc.rs:68:1
    |
-68 |   pub trait C { //~ ERROR: missing documentation for a trait
+68 |   pub trait C {
    |  _^ starting here...
-69 | |     fn foo(&self); //~ ERROR: missing documentation for a trait method
-70 | |     fn foo_with_impl(&self) {} //~ ERROR: missing documentation for a trait method
+69 | |     fn foo(&self);
+70 | |     fn foo_with_impl(&self) {}
 71 | | }
    | |_^ ...ending here
 
 error: missing documentation for a trait method
   --> $DIR/missing-doc.rs:69:5
    |
-69 |     fn foo(&self); //~ ERROR: missing documentation for a trait method
+69 |     fn foo(&self);
    |     ^^^^^^^^^^^^^^
 
 error: missing documentation for a trait method
   --> $DIR/missing-doc.rs:70:5
    |
-70 |     fn foo_with_impl(&self) {} //~ ERROR: missing documentation for a trait method
+70 |     fn foo_with_impl(&self) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for an associated type
   --> $DIR/missing-doc.rs:80:5
    |
-80 |     type AssociatedType; //~ ERROR: missing documentation for an associated type
+80 |     type AssociatedType;
    |     ^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for an associated type
   --> $DIR/missing-doc.rs:81:5
    |
-81 |     type AssociatedTypeDef = Self; //~ ERROR: missing documentation for an associated type
+81 |     type AssociatedTypeDef = Self;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a method
   --> $DIR/missing-doc.rs:92:5
    |
-92 |     pub fn foo() {} //~ ERROR: missing documentation for a method
+92 |     pub fn foo() {}
    |     ^^^^^^^^^^^^^^^
 
 error: missing documentation for a method
   --> $DIR/missing-doc.rs:93:5
    |
-93 |     fn bar() {} //~ ERROR: missing documentation for a method
+93 |     fn bar() {}
    |     ^^^^^^^^^^^
 
 error: missing documentation for a method
   --> $DIR/missing-doc.rs:97:5
    |
-97 |     pub fn foo() {} //~ ERROR: missing documentation for a method
+97 |     pub fn foo() {}
    |     ^^^^^^^^^^^^^^^
 
 error: missing documentation for a method
    --> $DIR/missing-doc.rs:100:5
     |
-100 |     fn foo2() {} //~ ERROR: missing documentation for a method
+100 |     fn foo2() {}
     |     ^^^^^^^^^^^^
 
 error: missing documentation for an enum
    --> $DIR/missing-doc.rs:126:1
     |
-126 |   enum Baz { //~ ERROR: missing documentation for an enum
+126 |   enum Baz {
     |  _^ starting here...
-127 | |     BazA { //~ ERROR: missing documentation for a variant
-128 | |         a: isize, //~ ERROR: missing documentation for a struct field
-129 | |         b: isize //~ ERROR: missing documentation for a struct field
+127 | |     BazA {
+128 | |         a: isize,
+129 | |         b: isize
 130 | |     },
-131 | |     BarB //~ ERROR: missing documentation for a variant
+131 | |     BarB
 132 | | }
     | |_^ ...ending here
 
 error: missing documentation for a variant
    --> $DIR/missing-doc.rs:127:5
     |
-127 |       BazA { //~ ERROR: missing documentation for a variant
+127 |       BazA {
     |  _____^ starting here...
-128 | |         a: isize, //~ ERROR: missing documentation for a struct field
-129 | |         b: isize //~ ERROR: missing documentation for a struct field
+128 | |         a: isize,
+129 | |         b: isize
 130 | |     },
     | |_____^ ...ending here
 
 error: missing documentation for a struct field
    --> $DIR/missing-doc.rs:128:9
     |
-128 |         a: isize, //~ ERROR: missing documentation for a struct field
+128 |         a: isize,
     |         ^^^^^^^^
 
 error: missing documentation for a struct field
    --> $DIR/missing-doc.rs:129:9
     |
-129 |         b: isize //~ ERROR: missing documentation for a struct field
+129 |         b: isize
     |         ^^^^^^^^
 
 error: missing documentation for a variant
    --> $DIR/missing-doc.rs:131:5
     |
-131 |     BarB //~ ERROR: missing documentation for a variant
+131 |     BarB
     |     ^^^^
 
 error: missing documentation for an enum
    --> $DIR/missing-doc.rs:134:1
     |
-134 |   pub enum PubBaz { //~ ERROR: missing documentation for an enum
+134 |   pub enum PubBaz {
     |  _^ starting here...
-135 | |     PubBazA { //~ ERROR: missing documentation for a variant
-136 | |         a: isize, //~ ERROR: missing documentation for a struct field
+135 | |     PubBazA {
+136 | |         a: isize,
 137 | |     },
 138 | | }
     | |_^ ...ending here
@@ -197,82 +197,82 @@ error: missing documentation for an enum
 error: missing documentation for a variant
    --> $DIR/missing-doc.rs:135:5
     |
-135 |       PubBazA { //~ ERROR: missing documentation for a variant
+135 |       PubBazA {
     |  _____^ starting here...
-136 | |         a: isize, //~ ERROR: missing documentation for a struct field
+136 | |         a: isize,
 137 | |     },
     | |_____^ ...ending here
 
 error: missing documentation for a struct field
    --> $DIR/missing-doc.rs:136:9
     |
-136 |         a: isize, //~ ERROR: missing documentation for a struct field
+136 |         a: isize,
     |         ^^^^^^^^
 
 error: missing documentation for a constant
    --> $DIR/missing-doc.rs:160:1
     |
-160 | const FOO: u32 = 0; //~ ERROR: missing documentation for a const
+160 | const FOO: u32 = 0;
     | ^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a constant
    --> $DIR/missing-doc.rs:167:1
     |
-167 | pub const FOO4: u32 = 0; //~ ERROR: missing documentation for a const
+167 | pub const FOO4: u32 = 0;
     | ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a static
    --> $DIR/missing-doc.rs:170:1
     |
-170 | static BAR: u32 = 0; //~ ERROR: missing documentation for a static
+170 | static BAR: u32 = 0;
     | ^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a static
    --> $DIR/missing-doc.rs:177:1
     |
-177 | pub static BAR4: u32 = 0; //~ ERROR: missing documentation for a static
+177 | pub static BAR4: u32 = 0;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a module
    --> $DIR/missing-doc.rs:180:1
     |
-180 | mod internal_impl { //~ ERROR: missing documentation for a module
+180 | mod internal_impl {
     | ^
 
 error: missing documentation for a function
    --> $DIR/missing-doc.rs:183:5
     |
-183 |     pub fn undocumented1() {} //~ ERROR: missing documentation for a function
+183 |     pub fn undocumented1() {}
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a function
    --> $DIR/missing-doc.rs:184:5
     |
-184 |     pub fn undocumented2() {} //~ ERROR: missing documentation for a function
+184 |     pub fn undocumented2() {}
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a function
    --> $DIR/missing-doc.rs:185:5
     |
-185 |     fn undocumented3() {} //~ ERROR: missing documentation for a function
+185 |     fn undocumented3() {}
     |     ^^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a function
    --> $DIR/missing-doc.rs:190:9
     |
-190 |         pub fn also_undocumented1() {} //~ ERROR: missing documentation for a function
+190 |         pub fn also_undocumented1() {}
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a function
    --> $DIR/missing-doc.rs:191:9
     |
-191 |         fn also_undocumented2() {} //~ ERROR: missing documentation for a function
+191 |         fn also_undocumented2() {}
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: missing documentation for a function
    --> $DIR/missing-doc.rs:202:1
     |
-202 | fn main() {} //~ ERROR: missing documentation for a function
+202 | fn main() {}
     | ^^^^^^^^^^^^
 
 error: aborting due to 40 previous errors
index 861ed504c86ead1d1e22ac6dcba43964df7154d0..f102057c1dafb5ebe7ea0b5b7ee49a161e4a50b8 100644 (file)
@@ -4,12 +4,12 @@
 
 mod foo {
     mod bar {
-        mod bar { //~ ERROR module has the same name as its containing module
+        mod bar {
             mod foo {}
         }
         mod foo {}
     }
-    mod foo { //~ ERROR module has the same name as its containing module
+    mod foo {
         mod bar {}
     }
 }
index de0ff78eb40687131f8908d307a183a45ae42952..b61b8557ac01b6f7bd04d9d8778460253e6af979 100644 (file)
@@ -1,7 +1,7 @@
 error: module has the same name as its containing module
  --> $DIR/module_inception.rs:7:9
   |
-7 |           mod bar { //~ ERROR module has the same name as its containing module
+7 |           mod bar {
   |  _________^ starting here...
 8 | |             mod foo {}
 9 | |         }
@@ -16,7 +16,7 @@ note: lint level defined here
 error: module has the same name as its containing module
   --> $DIR/module_inception.rs:12:5
    |
-12 |       mod foo { //~ ERROR module has the same name as its containing module
+12 |       mod foo {
    |  _____^ starting here...
 13 | |         mod bar {}
 14 | |     }
index 496c1c60d5f11f87bd0bbf482770dc67635addf6..d9ab7492eadc92577384a99b780adc38550969d7 100644 (file)
@@ -4,6 +4,6 @@
 #![allow(no_effect, unnecessary_operation)]
 
 fn main() {
-    10 % 1; //~ERROR any number modulo 1 will be 0
+    10 % 1;
     10 % 2;
 }
index c938afb0dc30f69010a3c7a42a40e864c909247b..2e5aef675743574afc0435f8cf9e1c6498a0130d 100644 (file)
@@ -1,7 +1,7 @@
 error: any number modulo 1 will be 0
  --> $DIR/modulo_one.rs:7:5
   |
-7 |     10 % 1; //~ERROR any number modulo 1 will be 0
+7 |     10 % 1;
   |     ^^^^^^
   |
 note: lint level defined here
index edcc6906f082827a702f9583479e40198ef92bfc..457a79152efd539ec4c08a581fa1860f470d21e0 100644 (file)
@@ -7,7 +7,7 @@
 //#![plugin(regex_macros)]
 //extern crate regex;
 
-fn fun(x : &mut &mut u32) -> bool { //~ERROR generally you want to avoid `&mut &mut
+fn fun(x : &mut &mut u32) -> bool {
     **x > 0
 }
 
@@ -17,37 +17,37 @@ fn less_fun(x : *mut *mut u32) {
 
 macro_rules! mut_ptr {
     ($p:expr) => { &mut $p }
-    //~^ ERROR generally you want to avoid `&mut &mut
+
 }
 
 #[allow(unused_mut, unused_variables)]
 fn main() {
-    let mut x = &mut &mut 1u32; //~ERROR generally you want to avoid `&mut &mut
+    let mut x = &mut &mut 1u32;
     {
-        let mut y = &mut x; //~ERROR this expression mutably borrows a mutable reference
+        let mut y = &mut x;
     }
 
     if fun(x) {
         let y : &mut &mut u32 = &mut &mut 2;
-        //~^ ERROR generally you want to avoid `&mut &mut
-        //~| ERROR generally you want to avoid `&mut &mut
-        //~| ERROR generally you want to avoid `&mut &mut
+
+
+
         **y + **x;
     }
 
     if fun(x) {
         let y : &mut &mut &mut u32 = &mut &mut &mut 2;
-        //~^ ERROR generally you want to avoid `&mut &mut
-        //~| ERROR generally you want to avoid `&mut &mut
-        //~| ERROR generally you want to avoid `&mut &mut
-        //~| ERROR generally you want to avoid `&mut &mut
-        //~| ERROR generally you want to avoid `&mut &mut
-        //~| ERROR generally you want to avoid `&mut &mut
+
+
+
+
+
+
         ***y + **x;
     }
 
     let mut z = mut_ptr!(&mut 3u32);
-    //~^ NOTE in this expansion of mut_ptr!
+
 }
 
 fn issue939() {
index 55125f8d526681a47c6f9899647a9d0754b94a37..2149d3d88240c35063467c137fdd6d328f880d80 100644 (file)
@@ -1,7 +1,7 @@
 error: generally you want to avoid `&mut &mut _` if possible
   --> $DIR/mut_mut.rs:10:12
    |
-10 | fn fun(x : &mut &mut u32) -> bool { //~ERROR generally you want to avoid `&mut &mut
+10 | fn fun(x : &mut &mut u32) -> bool {
    |            ^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: generally you want to avoid `&mut &mut _` if possible
   --> $DIR/mut_mut.rs:25:17
    |
-25 |     let mut x = &mut &mut 1u32; //~ERROR generally you want to avoid `&mut &mut
+25 |     let mut x = &mut &mut 1u32;
    |                 ^^^^^^^^^^^^^^
 
 error: generally you want to avoid `&mut &mut _` if possible
@@ -28,7 +28,7 @@ error: generally you want to avoid `&mut &mut _` if possible
 error: this expression mutably borrows a mutable reference. Consider reborrowing
   --> $DIR/mut_mut.rs:27:21
    |
-27 |         let mut y = &mut x; //~ERROR this expression mutably borrows a mutable reference
+27 |         let mut y = &mut x;
    |                     ^^^^^^
 
 error: generally you want to avoid `&mut &mut _` if possible
index 0bb59a318b8349a91ec84f884a8df4e8b2b48fc4..a3b9a965ec4c8214b33ffbe70cd30d1b895d9521 100644 (file)
@@ -19,13 +19,13 @@ fn takes_a_mutable_reference(&self, a: &mut i32) {
 #[deny(unnecessary_mut_passed)]
 fn main() {
     // Functions
-    takes_an_immutable_reference(&mut 42); //~ERROR The function/method "takes_an_immutable_reference" doesn't need a mutable reference
+    takes_an_immutable_reference(&mut 42);
     let as_ptr: fn(&i32) = takes_an_immutable_reference;
-    as_ptr(&mut 42); //~ERROR The function/method "as_ptr" doesn't need a mutable reference
+    as_ptr(&mut 42);
 
     // Methods
     let my_struct = MyStruct;
-    my_struct.takes_an_immutable_reference(&mut 42); //~ERROR The function/method "takes_an_immutable_reference" doesn't need a mutable reference
+    my_struct.takes_an_immutable_reference(&mut 42);
 
 
     // No error
index 52e48347795238c2c5cd33b953aa676a2015c951..f4c2b60746ea7c9819ad3db788ef82c32e4a87d9 100644 (file)
@@ -1,7 +1,7 @@
 error: The function/method "takes_an_immutable_reference" doesn't need a mutable reference
   --> $DIR/mut_reference.rs:22:34
    |
-22 |     takes_an_immutable_reference(&mut 42); //~ERROR The function/method "takes_an_immutable_reference" doesn't need a mutable reference
+22 |     takes_an_immutable_reference(&mut 42);
    |                                  ^^^^^^^
    |
 note: lint level defined here
@@ -13,13 +13,13 @@ note: lint level defined here
 error: The function/method "as_ptr" doesn't need a mutable reference
   --> $DIR/mut_reference.rs:24:12
    |
-24 |     as_ptr(&mut 42); //~ERROR The function/method "as_ptr" doesn't need a mutable reference
+24 |     as_ptr(&mut 42);
    |            ^^^^^^^
 
 error: The function/method "takes_an_immutable_reference" doesn't need a mutable reference
   --> $DIR/mut_reference.rs:28:44
    |
-28 |     my_struct.takes_an_immutable_reference(&mut 42); //~ERROR The function/method "takes_an_immutable_reference" doesn't need a mutable reference
+28 |     my_struct.takes_an_immutable_reference(&mut 42);
    |                                            ^^^^^^^
 
 error: aborting due to 3 previous errors
index 20a34ba5547c3a6e5c2d7311e6796a7d273dc23c..5a5289c2cf48bf53f03a2879083e6e3c22556a94 100644 (file)
@@ -6,13 +6,13 @@
 
 fn main() {
     use std::sync::Mutex;
-    Mutex::new(true); //~ERROR Consider using an AtomicBool instead of a Mutex here.
-    Mutex::new(5usize); //~ERROR Consider using an AtomicUsize instead of a Mutex here.
-    Mutex::new(9isize); //~ERROR Consider using an AtomicIsize instead of a Mutex here.
+    Mutex::new(true);
+    Mutex::new(5usize);
+    Mutex::new(9isize);
     let mut x = 4u32;
-    Mutex::new(&x as *const u32); //~ERROR Consider using an AtomicPtr instead of a Mutex here.
-    Mutex::new(&mut x as *mut u32); //~ERROR Consider using an AtomicPtr instead of a Mutex here.
-    Mutex::new(0u32); //~ERROR Consider using an AtomicUsize instead of a Mutex here.
-    Mutex::new(0i32); //~ERROR Consider using an AtomicIsize instead of a Mutex here.
+    Mutex::new(&x as *const u32);
+    Mutex::new(&mut x as *mut u32);
+    Mutex::new(0u32);
+    Mutex::new(0i32);
     Mutex::new(0f32); // there are no float atomics, so this should not lint
 }
index 9554f42d2256ca7eb2dbe6dcd1863c615b277656..6a61c42cbe2d4a56f17486a863358b9b9f5bb16e 100644 (file)
@@ -1,7 +1,7 @@
 error: Consider using an AtomicBool instead of a Mutex here. If you just want the locking behaviour and not the internal type, consider using Mutex<()>.
  --> $DIR/mutex_atomic.rs:9:5
   |
-9 |     Mutex::new(true); //~ERROR Consider using an AtomicBool instead of a Mutex here.
+9 |     Mutex::new(true);
   |     ^^^^^^^^^^^^^^^^
   |
   = note: #[deny(mutex_atomic)] implied by #[deny(clippy)]
@@ -14,7 +14,7 @@ note: lint level defined here
 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<()>.
   --> $DIR/mutex_atomic.rs:10:5
    |
-10 |     Mutex::new(5usize); //~ERROR Consider using an AtomicUsize instead of a Mutex here.
+10 |     Mutex::new(5usize);
    |     ^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(mutex_atomic)] implied by #[deny(clippy)]
@@ -22,7 +22,7 @@ error: Consider using an AtomicUsize instead of a Mutex here. If you just want t
 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<()>.
   --> $DIR/mutex_atomic.rs:11:5
    |
-11 |     Mutex::new(9isize); //~ERROR Consider using an AtomicIsize instead of a Mutex here.
+11 |     Mutex::new(9isize);
    |     ^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(mutex_atomic)] implied by #[deny(clippy)]
@@ -30,7 +30,7 @@ error: Consider using an AtomicIsize instead of a Mutex here. If you just want t
 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<()>.
   --> $DIR/mutex_atomic.rs:13:5
    |
-13 |     Mutex::new(&x as *const u32); //~ERROR Consider using an AtomicPtr instead of a Mutex here.
+13 |     Mutex::new(&x as *const u32);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(mutex_atomic)] implied by #[deny(clippy)]
@@ -38,7 +38,7 @@ error: Consider using an AtomicPtr instead of a Mutex here. If you just want the
 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<()>.
   --> $DIR/mutex_atomic.rs:14:5
    |
-14 |     Mutex::new(&mut x as *mut u32); //~ERROR Consider using an AtomicPtr instead of a Mutex here.
+14 |     Mutex::new(&mut x as *mut u32);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(mutex_atomic)] implied by #[deny(clippy)]
@@ -46,7 +46,7 @@ error: Consider using an AtomicPtr instead of a Mutex here. If you just want the
 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<()>.
   --> $DIR/mutex_atomic.rs:15:5
    |
-15 |     Mutex::new(0u32); //~ERROR Consider using an AtomicUsize instead of a Mutex here.
+15 |     Mutex::new(0u32);
    |     ^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -58,7 +58,7 @@ note: lint level defined here
 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<()>.
   --> $DIR/mutex_atomic.rs:16:5
    |
-16 |     Mutex::new(0i32); //~ERROR Consider using an AtomicIsize instead of a Mutex here.
+16 |     Mutex::new(0i32);
    |     ^^^^^^^^^^^^^^^^
 
 error: aborting due to 7 previous errors
index fb81d44308a0e8f08e9dc9f02f99f6813bbe0609..ebbff1454822f23eb7472831bb67f704bf42f81e 100644 (file)
@@ -6,20 +6,20 @@
 fn main() {
     let x = true;
     let y = false;
-    if x { true } else { true }; //~ERROR this if-then-else expression will always return true
-    if x { false } else { false }; //~ERROR this if-then-else expression will always return false
+    if x { true } else { true };
+    if x { false } else { false };
     if x { true } else { false };
-    //~^ ERROR this if-then-else expression returns a bool literal
-    //~| HELP you can reduce it to
-    //~| SUGGESTION x
+
+
+
     if x { false } else { true };
-    //~^ ERROR this if-then-else expression returns a bool literal
-    //~| HELP you can reduce it to
-    //~| SUGGESTION !x
+
+
+
     if x && y { false } else { true };
-    //~^ ERROR this if-then-else expression returns a bool literal
-    //~| HELP you can reduce it to
-    //~| SUGGESTION !(x && y)
+
+
+
     if x { x } else { false }; // would also be questionable, but we don't catch this yet
     bool_ret(x);
     bool_ret2(x);
@@ -32,43 +32,43 @@ fn main() {
 #[allow(if_same_then_else, needless_return)]
 fn bool_ret(x: bool) -> bool {
     if x { return true } else { return true };
-    //~^ ERROR this if-then-else expression will always return true
+
 }
 
 #[allow(if_same_then_else, needless_return)]
 fn bool_ret2(x: bool) -> bool {
     if x { return false } else { return false };
-    //~^ ERROR this if-then-else expression will always return false
+
 }
 
 #[allow(needless_return)]
 fn bool_ret3(x: bool) -> bool {
     if x { return true } else { return false };
-    //~^ ERROR this if-then-else expression returns a bool literal
-    //~| HELP you can reduce it to
-    //~| SUGGESTION return x
+
+
+
 }
 
 #[allow(needless_return)]
 fn bool_ret5(x: bool, y: bool) -> bool {
     if x && y { return true } else { return false };
-    //~^ ERROR this if-then-else expression returns a bool literal
-    //~| HELP you can reduce it to
-    //~| SUGGESTION return x && y
+
+
+
 }
 
 #[allow(needless_return)]
 fn bool_ret4(x: bool) -> bool {
     if x { return false } else { return true };
-    //~^ ERROR this if-then-else expression returns a bool literal
-    //~| HELP you can reduce it to
-    //~| SUGGESTION return !x
+
+
+
 }
 
 #[allow(needless_return)]
 fn bool_ret6(x: bool, y: bool) -> bool {
     if x && y { return false } else { return true };
-    //~^ ERROR this if-then-else expression returns a bool literal
-    //~| HELP you can reduce it to
-    //~| SUGGESTION return !(x && y)
+
+
+
 }
index 0042598e1cda7f85f21f06dc576ef25cf380f5c1..930a3cba514d5e03228b80ab198bb72fa6c61093 100644 (file)
@@ -1,7 +1,7 @@
 error: this if-then-else expression will always return true
  --> $DIR/needless_bool.rs:9:5
   |
-9 |     if x { true } else { true }; //~ERROR this if-then-else expression will always return true
+9 |     if x { true } else { true };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: this if-then-else expression will always return false
   --> $DIR/needless_bool.rs:10:5
    |
-10 |     if x { false } else { false }; //~ERROR this if-then-else expression will always return false
+10 |     if x { false } else { false };
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: this if-then-else expression returns a bool literal
index 77992252e102fb33f4a4422f088f016e93d72c8b..1fc36c0be1854ba4ed84bdda7e23d139af6f0d8a 100644 (file)
@@ -10,14 +10,14 @@ fn x(y: &i32) -> i32 {
 fn main() {
     let a = 5;
     let b = x(&a);
-    let c = x(&&a); //~ ERROR: this expression borrows a reference that is immediately dereferenced by the compiler
+    let c = x(&&a);
     let s = &String::from("hi");
     let s_ident = f(&s); // should not error, because `&String` implements Copy, but `String` does not
     let g_val = g(&Vec::new()); // should not error, because `&Vec<T>` derefs to `&[T]`
     let vec = Vec::new();
     let vec_val = g(&vec); // should not error, because `&Vec<T>` derefs to `&[T]`
     h(&"foo"); // should not error, because the `&&str` is required, due to `&Trait`
-    if let Some(ref cake) = Some(&5) {} //~ ERROR: this pattern creates a reference to a reference
+    if let Some(ref cake) = Some(&5) {}
 }
 
 fn f<T:Copy>(y: &T) -> T {
@@ -39,6 +39,6 @@ fn issue_1432() {
     let mut v = Vec::<String>::new();
     let _ = v.iter_mut().filter(|&ref a| a.is_empty());
     let _ = v.iter().filter(|&ref a| a.is_empty());
-    //~^WARNING this pattern creates a reference to a reference
+
     let _ = v.iter().filter(|&a| a.is_empty());
 }
index e607185fe9b5a5dafff54e982882806ef6ce72a6..a5d549c986b5fb931ed3e9888477ffac846dec9a 100644 (file)
@@ -1,7 +1,7 @@
 error: this expression borrows a reference that is immediately dereferenced by the compiler
   --> $DIR/needless_borrow.rs:13:15
    |
-13 |     let c = x(&&a); //~ ERROR: this expression borrows a reference that is immediately dereferenced by the compiler
+13 |     let c = x(&&a);
    |               ^^^
    |
    = note: #[deny(needless_borrow)] implied by #[deny(clippy)]
@@ -14,7 +14,7 @@ note: lint level defined here
 error: this pattern creates a reference to a reference
   --> $DIR/needless_borrow.rs:20:17
    |
-20 |     if let Some(ref cake) = Some(&5) {} //~ ERROR: this pattern creates a reference to a reference
+20 |     if let Some(ref cake) = Some(&5) {}
    |                 ^^^^^^^^
    |
    = note: #[deny(needless_borrow)] implied by #[deny(clippy)]
index 442a0b925cbfbab1f47e7e6c27055adce731ba94..2751089bddadf118c2b7f527269d7a7ff02f231d 100644 (file)
@@ -9,44 +9,44 @@ fn test_end_of_fn() -> bool {
         return true;
     }
     return true;
-    //~^ ERROR unneeded return statement
-    //~| HELP remove `return` as shown
-    //~| SUGGESTION true
+
+
+
 }
 
 fn test_no_semicolon() -> bool {
     return true
-    //~^ ERROR unneeded return statement
-    //~| HELP remove `return` as shown
-    //~| SUGGESTION true
+
+
+
 }
 
 fn test_if_block() -> bool {
     if true {
         return true;
-        //~^ ERROR unneeded return statement
-        //~| HELP remove `return` as shown
-        //~| SUGGESTION true
+
+
+
     } else {
         return false;
-        //~^ ERROR unneeded return statement
-        //~| HELP remove `return` as shown
-        //~| SUGGESTION false
+
+
+
     }
 }
 
 fn test_match(x: bool) -> bool {
     match x {
         true => return false,
-        //~^ ERROR unneeded return statement
-        //~| HELP remove `return` as shown
-        //~| SUGGESTION false
+
+
+
 
         false => {
             return true;
-            //~^ ERROR unneeded return statement
-            //~| HELP remove `return` as shown
-            //~| SUGGESTION true
+
+
+
         }
     }
 }
@@ -54,14 +54,14 @@ fn test_match(x: bool) -> bool {
 fn test_closure() {
     let _ = || {
         return true;
-        //~^ ERROR unneeded return statement
-        //~| HELP remove `return` as shown
-        //~| SUGGESTION true
+
+
+
     };
     let _ = || return true;
-    //~^ ERROR unneeded return statement
-    //~| HELP remove `return` as shown
-    //~| SUGGESTION true
+
+
+
 }
 
 fn main() {
index 55cfed76d5d3ef9290d6176637b45229849e13e4..a8eb232f0602cef93a0a972b19280adf1d3de216 100644 (file)
@@ -13,5 +13,5 @@ fn main() {
     let base = S { a: 0, b: 0 };
     S { ..base }; // no error
     S { a: 1, ..base }; // no error
-    S { a: 1, b: 1, ..base }; //~ERROR struct update has no effect
+    S { a: 1, b: 1, ..base };
 }
index 630d48331cc4b7302b8d46a8154973be473436f7..ab1441508d4cca64495d0fec600d9dd5d68daf30 100644 (file)
@@ -1,7 +1,7 @@
 error: struct update has no effect, all the fields in the struct have already been specified
   --> $DIR/needless_update.rs:16:23
    |
-16 |     S { a: 1, b: 1, ..base }; //~ERROR struct update has no effect
+16 |     S { a: 1, b: 1, ..base };
    |                       ^^^^
    |
 note: lint level defined here
index 90c63c5f2632e6105bd698968b169adb8270dc6a..748a2e536098044dd37612780cdcf54655976e78 100644 (file)
@@ -28,10 +28,10 @@ fn main() {
     let x = 0;
 
     x * -1;
-    //~^ ERROR Negation by multiplying with -1
+
 
     -1 * x;
-    //~^ ERROR Negation by multiplying with -1
+
 
     -1 * -1; // should be ok
 
index 65f6805e1214eeff87abe8944cca5ce80b8ec8dd..a5673b622ba19894edaf36122adf3972a1aeae95 100644 (file)
@@ -5,23 +5,23 @@
 #![deny(new_without_default, new_without_default_derive)]
 
 pub struct Foo;
-//~^HELP try this
-//~^^SUGGESTION #[derive(Default)]
-//~^^SUGGESTION pub struct Foo
+
+
+
 
 impl Foo {
     pub fn new() -> Foo { Foo }
-    //~^ERROR: you should consider deriving a `Default` implementation for `Foo`
+
 }
 
 pub struct Bar;
-//~^HELP try this
-//~^^SUGGESTION #[derive(Default)]
-//~^^SUGGESTION pub struct Bar
+
+
+
 
 impl Bar {
     pub fn new() -> Self { Bar }
-    //~^ERROR: you should consider deriving a `Default` implementation for `Bar`
+
 }
 
 pub struct Ok;
@@ -70,13 +70,13 @@ pub struct LtKo<'a> {
 
 impl<'c> LtKo<'c> {
     pub fn new() -> LtKo<'c> { unimplemented!() }
-    //~^ERROR: you should consider adding a `Default` implementation for
-    //~^^HELP try
-    //~^^^SUGGESTION impl Default for LtKo<'c> {
-    //~^^^SUGGESTION     fn default() -> Self {
-    //~^^^SUGGESTION         Self::new()
-    //~^^^SUGGESTION     }
-    //~^^^SUGGESTION }
+
+
+
+
+
+
+
     // FIXME: that suggestion is missing lifetimes
 }
 
index 30a66a715f2000ed5d1650b77dc66a449ff1887d..3759986ae9d390d5f715f9f4b85ebb759ebaf858 100644 (file)
@@ -31,92 +31,92 @@ fn main() {
     let s = get_struct();
     let s2 = get_struct();
 
-    0; //~ERROR statement with no effect
-    s2; //~ERROR statement with no effect
-    Unit; //~ERROR statement with no effect
-    Tuple(0); //~ERROR statement with no effect
-    Struct { field: 0 }; //~ERROR statement with no effect
-    Struct { ..s }; //~ERROR statement with no effect
-    Union { a: 0 }; //~ERROR statement with no effect
-    Enum::Tuple(0); //~ERROR statement with no effect
-    Enum::Struct { field: 0 }; //~ERROR statement with no effect
-    5 + 6; //~ERROR statement with no effect
-    *&42; //~ERROR statement with no effect
-    &6; //~ERROR statement with no effect
-    (5, 6, 7); //~ERROR statement with no effect
-    box 42; //~ERROR statement with no effect
-    ..; //~ERROR statement with no effect
-    5..; //~ERROR statement with no effect
-    ..5; //~ERROR statement with no effect
-    5..6; //~ERROR statement with no effect
-    5...6; //~ERROR statement with no effect
-    [42, 55]; //~ERROR statement with no effect
-    [42, 55][1]; //~ERROR statement with no effect
-    (42, 55).1; //~ERROR statement with no effect
-    [42; 55]; //~ERROR statement with no effect
-    [42; 55][13]; //~ERROR statement with no effect
+    0;
+    s2;
+    Unit;
+    Tuple(0);
+    Struct { field: 0 };
+    Struct { ..s };
+    Union { a: 0 };
+    Enum::Tuple(0);
+    Enum::Struct { field: 0 };
+    5 + 6;
+    *&42;
+    &6;
+    (5, 6, 7);
+    box 42;
+    ..;
+    5..;
+    ..5;
+    5..6;
+    5...6;
+    [42, 55];
+    [42, 55][1];
+    (42, 55).1;
+    [42; 55];
+    [42; 55][13];
     let mut x = 0;
-    || x += 5; //~ERROR statement with no effect
+    || x += 5;
 
     // Do not warn
     get_number();
     unsafe { unsafe_fn() };
 
-    Tuple(get_number()); //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION get_number();
-    Struct { field: get_number() }; //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION get_number();
-    Struct { ..get_struct() }; //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION get_struct();
-    Enum::Tuple(get_number()); //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION get_number();
-    Enum::Struct { field: get_number() }; //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION get_number();
-    5 + get_number(); //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION 5;get_number();
-    *&get_number(); //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION get_number();
-    &get_number(); //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION get_number();
-    (5, 6, get_number()); //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION 5;6;get_number();
-    box get_number(); //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION get_number();
-    get_number()..; //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION get_number();
-    ..get_number(); //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION get_number();
-    5..get_number(); //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION 5;get_number();
-    [42, get_number()]; //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION 42;get_number();
-    [42, 55][get_number() as usize]; //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION [42, 55];get_number() as usize;
-    (42, get_number()).1; //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION 42;get_number();
-    [get_number(); 55]; //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION get_number();
-    [42; 55][get_number() as usize]; //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION [42; 55];get_number() as usize;
-    {get_number()}; //~ERROR statement can be reduced
-    //~^HELP replace it with
-    //~|SUGGESTION get_number();
+    Tuple(get_number());
+
+
+    Struct { field: get_number() };
+
+
+    Struct { ..get_struct() };
+
+
+    Enum::Tuple(get_number());
+
+
+    Enum::Struct { field: get_number() };
+
+
+    5 + get_number();
+
+
+    *&get_number();
+
+
+    &get_number();
+
+
+    (5, 6, get_number());
+
+
+    box get_number();
+
+
+    get_number()..;
+
+
+    ..get_number();
+
+
+    5..get_number();
+
+
+    [42, get_number()];
+
+
+    [42, 55][get_number() as usize];
+
+
+    (42, get_number()).1;
+
+
+    [get_number(); 55];
+
+
+    [42; 55][get_number() as usize];
+
+
+    {get_number()};
+
+
 }
index da65c5e8db81bb59c4c1361545f4be48ef8b547b..5fd1d7c425b71ba0b1425f392a7275e22a0c73b7 100644 (file)
@@ -1,7 +1,7 @@
 error: statement with no effect
   --> $DIR/no_effect.rs:34:5
    |
-34 |     0; //~ERROR statement with no effect
+34 |     0;
    |     ^^
    |
 note: lint level defined here
@@ -13,151 +13,151 @@ note: lint level defined here
 error: statement with no effect
   --> $DIR/no_effect.rs:35:5
    |
-35 |     s2; //~ERROR statement with no effect
+35 |     s2;
    |     ^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:36:5
    |
-36 |     Unit; //~ERROR statement with no effect
+36 |     Unit;
    |     ^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:37:5
    |
-37 |     Tuple(0); //~ERROR statement with no effect
+37 |     Tuple(0);
    |     ^^^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:38:5
    |
-38 |     Struct { field: 0 }; //~ERROR statement with no effect
+38 |     Struct { field: 0 };
    |     ^^^^^^^^^^^^^^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:39:5
    |
-39 |     Struct { ..s }; //~ERROR statement with no effect
+39 |     Struct { ..s };
    |     ^^^^^^^^^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:40:5
    |
-40 |     Union { a: 0 }; //~ERROR statement with no effect
+40 |     Union { a: 0 };
    |     ^^^^^^^^^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:41:5
    |
-41 |     Enum::Tuple(0); //~ERROR statement with no effect
+41 |     Enum::Tuple(0);
    |     ^^^^^^^^^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:42:5
    |
-42 |     Enum::Struct { field: 0 }; //~ERROR statement with no effect
+42 |     Enum::Struct { field: 0 };
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:43:5
    |
-43 |     5 + 6; //~ERROR statement with no effect
+43 |     5 + 6;
    |     ^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:44:5
    |
-44 |     *&42; //~ERROR statement with no effect
+44 |     *&42;
    |     ^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:45:5
    |
-45 |     &6; //~ERROR statement with no effect
+45 |     &6;
    |     ^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:46:5
    |
-46 |     (5, 6, 7); //~ERROR statement with no effect
+46 |     (5, 6, 7);
    |     ^^^^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:47:5
    |
-47 |     box 42; //~ERROR statement with no effect
+47 |     box 42;
    |     ^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:48:5
    |
-48 |     ..; //~ERROR statement with no effect
+48 |     ..;
    |     ^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:49:5
    |
-49 |     5..; //~ERROR statement with no effect
+49 |     5..;
    |     ^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:50:5
    |
-50 |     ..5; //~ERROR statement with no effect
+50 |     ..5;
    |     ^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:51:5
    |
-51 |     5..6; //~ERROR statement with no effect
+51 |     5..6;
    |     ^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:52:5
    |
-52 |     5...6; //~ERROR statement with no effect
+52 |     5...6;
    |     ^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:53:5
    |
-53 |     [42, 55]; //~ERROR statement with no effect
+53 |     [42, 55];
    |     ^^^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:54:5
    |
-54 |     [42, 55][1]; //~ERROR statement with no effect
+54 |     [42, 55][1];
    |     ^^^^^^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:55:5
    |
-55 |     (42, 55).1; //~ERROR statement with no effect
+55 |     (42, 55).1;
    |     ^^^^^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:56:5
    |
-56 |     [42; 55]; //~ERROR statement with no effect
+56 |     [42; 55];
    |     ^^^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:57:5
    |
-57 |     [42; 55][13]; //~ERROR statement with no effect
+57 |     [42; 55][13];
    |     ^^^^^^^^^^^^^
 
 error: statement with no effect
   --> $DIR/no_effect.rs:59:5
    |
-59 |     || x += 5; //~ERROR statement with no effect
+59 |     || x += 5;
    |     ^^^^^^^^^^
 
 error: statement can be reduced
   --> $DIR/no_effect.rs:65:5
    |
-65 |     Tuple(get_number()); //~ERROR statement can be reduced
+65 |     Tuple(get_number());
    |     ^^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -166,169 +166,169 @@ note: lint level defined here
 4  | #![deny(no_effect, unnecessary_operation)]
    |                    ^^^^^^^^^^^^^^^^^^^^^
 help: replace it with
-   |     get_number(); //~ERROR statement can be reduced
+   |     get_number();
 
 error: statement can be reduced
   --> $DIR/no_effect.rs:68:5
    |
-68 |     Struct { field: get_number() }; //~ERROR statement can be reduced
+68 |     Struct { field: get_number() };
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: replace it with
-   |     get_number(); //~ERROR statement can be reduced
+   |     get_number();
 
 error: statement can be reduced
   --> $DIR/no_effect.rs:71:5
    |
-71 |     Struct { ..get_struct() }; //~ERROR statement can be reduced
+71 |     Struct { ..get_struct() };
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: replace it with
-   |     get_struct(); //~ERROR statement can be reduced
+   |     get_struct();
 
 error: statement can be reduced
   --> $DIR/no_effect.rs:74:5
    |
-74 |     Enum::Tuple(get_number()); //~ERROR statement can be reduced
+74 |     Enum::Tuple(get_number());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: replace it with
-   |     get_number(); //~ERROR statement can be reduced
+   |     get_number();
 
 error: statement can be reduced
   --> $DIR/no_effect.rs:77:5
    |
-77 |     Enum::Struct { field: get_number() }; //~ERROR statement can be reduced
+77 |     Enum::Struct { field: get_number() };
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: replace it with
-   |     get_number(); //~ERROR statement can be reduced
+   |     get_number();
 
 error: statement can be reduced
   --> $DIR/no_effect.rs:80:5
    |
-80 |     5 + get_number(); //~ERROR statement can be reduced
+80 |     5 + get_number();
    |     ^^^^^^^^^^^^^^^^^
    |
 help: replace it with
-   |     5;get_number(); //~ERROR statement can be reduced
+   |     5;get_number();
 
 error: statement can be reduced
   --> $DIR/no_effect.rs:83:5
    |
-83 |     *&get_number(); //~ERROR statement can be reduced
+83 |     *&get_number();
    |     ^^^^^^^^^^^^^^^
    |
 help: replace it with
-   |     get_number(); //~ERROR statement can be reduced
+   |     get_number();
 
 error: statement can be reduced
   --> $DIR/no_effect.rs:86:5
    |
-86 |     &get_number(); //~ERROR statement can be reduced
+86 |     &get_number();
    |     ^^^^^^^^^^^^^^
    |
 help: replace it with
-   |     get_number(); //~ERROR statement can be reduced
+   |     get_number();
 
 error: statement can be reduced
   --> $DIR/no_effect.rs:89:5
    |
-89 |     (5, 6, get_number()); //~ERROR statement can be reduced
+89 |     (5, 6, get_number());
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
 help: replace it with
-   |     5;6;get_number(); //~ERROR statement can be reduced
+   |     5;6;get_number();
 
 error: statement can be reduced
   --> $DIR/no_effect.rs:92:5
    |
-92 |     box get_number(); //~ERROR statement can be reduced
+92 |     box get_number();
    |     ^^^^^^^^^^^^^^^^^
    |
 help: replace it with
-   |     get_number(); //~ERROR statement can be reduced
+   |     get_number();
 
 error: statement can be reduced
   --> $DIR/no_effect.rs:95:5
    |
-95 |     get_number()..; //~ERROR statement can be reduced
+95 |     get_number()..;
    |     ^^^^^^^^^^^^^^^
    |
 help: replace it with
-   |     get_number(); //~ERROR statement can be reduced
+   |     get_number();
 
 error: statement can be reduced
   --> $DIR/no_effect.rs:98:5
    |
-98 |     ..get_number(); //~ERROR statement can be reduced
+98 |     ..get_number();
    |     ^^^^^^^^^^^^^^^
    |
 help: replace it with
-   |     get_number(); //~ERROR statement can be reduced
+   |     get_number();
 
 error: statement can be reduced
    --> $DIR/no_effect.rs:101:5
     |
-101 |     5..get_number(); //~ERROR statement can be reduced
+101 |     5..get_number();
     |     ^^^^^^^^^^^^^^^^
     |
 help: replace it with
-    |     5;get_number(); //~ERROR statement can be reduced
+    |     5;get_number();
 
 error: statement can be reduced
    --> $DIR/no_effect.rs:104:5
     |
-104 |     [42, get_number()]; //~ERROR statement can be reduced
+104 |     [42, get_number()];
     |     ^^^^^^^^^^^^^^^^^^^
     |
 help: replace it with
-    |     42;get_number(); //~ERROR statement can be reduced
+    |     42;get_number();
 
 error: statement can be reduced
    --> $DIR/no_effect.rs:107:5
     |
-107 |     [42, 55][get_number() as usize]; //~ERROR statement can be reduced
+107 |     [42, 55][get_number() as usize];
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
 help: replace it with
-    |     [42, 55];get_number() as usize; //~ERROR statement can be reduced
+    |     [42, 55];get_number() as usize;
 
 error: statement can be reduced
    --> $DIR/no_effect.rs:110:5
     |
-110 |     (42, get_number()).1; //~ERROR statement can be reduced
+110 |     (42, get_number()).1;
     |     ^^^^^^^^^^^^^^^^^^^^^
     |
 help: replace it with
-    |     42;get_number(); //~ERROR statement can be reduced
+    |     42;get_number();
 
 error: statement can be reduced
    --> $DIR/no_effect.rs:113:5
     |
-113 |     [get_number(); 55]; //~ERROR statement can be reduced
+113 |     [get_number(); 55];
     |     ^^^^^^^^^^^^^^^^^^^
     |
 help: replace it with
-    |     get_number(); //~ERROR statement can be reduced
+    |     get_number();
 
 error: statement can be reduced
    --> $DIR/no_effect.rs:116:5
     |
-116 |     [42; 55][get_number() as usize]; //~ERROR statement can be reduced
+116 |     [42; 55][get_number() as usize];
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
 help: replace it with
-    |     [42; 55];get_number() as usize; //~ERROR statement can be reduced
+    |     [42; 55];get_number() as usize;
 
 error: statement can be reduced
    --> $DIR/no_effect.rs:119:5
     |
-119 |     {get_number()}; //~ERROR statement can be reduced
+119 |     {get_number()};
     |     ^^^^^^^^^^^^^^^
     |
 help: replace it with
-    |     get_number(); //~ERROR statement can be reduced
+    |     get_number();
 
 error: aborting due to 44 previous errors
 
index 778041f49b8c63a1b4cd2be785e1bb7947989e1e..649a5ecb812d95ab830855d55389b31d756fa6dc 100644 (file)
@@ -1,17 +1,17 @@
 #![feature(plugin)]
 #![plugin(clippy)]
 #![deny(clippy,similar_names)]
-//~^ NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
-//~| NOTE: lint level defined here
+
+
+
+
+
+
+
+
+
+
+
 #![allow(unused)]
 
 
@@ -24,12 +24,12 @@ fn main() {
     let specter: i32;
     let spectre: i32;
 
-    let apple: i32; //~ NOTE: existing binding defined here
-    //~^ NOTE: existing binding defined here
-    let bpple: i32; //~ ERROR: name is too similar
-    //~| HELP: separate the discriminating character by an underscore like: `b_pple`
-    let cpple: i32; //~ ERROR: name is too similar
-    //~| HELP: separate the discriminating character by an underscore like: `c_pple`
+    let apple: i32;
+
+    let bpple: i32;
+
+    let cpple: i32;
+
 
     let a_bar: i32;
     let b_bar: i32;
@@ -52,13 +52,13 @@ fn main() {
     let blubrhs: i32;
     let blublhs: i32;
 
-    let blubx: i32; //~ NOTE: existing binding defined here
-    let bluby: i32; //~ ERROR: name is too similar
-    //~| HELP: separate the discriminating character by an underscore like: `blub_y`
+    let blubx: i32;
+    let bluby: i32;
+
 
-    let cake: i32; //~ NOTE: existing binding defined here
+    let cake: i32;
     let cakes: i32;
-    let coke: i32; //~ ERROR: name is too similar
+    let coke: i32;
 
     match 5 {
         cheese @ 1 => {},
@@ -74,14 +74,14 @@ fn main() {
     let ipv6: i32;
     let abcd1: i32;
     let abdc2: i32;
-    let xyz1abc: i32; //~ NOTE: existing binding defined here
+    let xyz1abc: i32;
     let xyz2abc: i32;
-    let xyzeabc: i32; //~ ERROR: name is too similar
+    let xyzeabc: i32;
 
-    let parser: i32; //~ NOTE: existing binding defined here
+    let parser: i32;
     let parsed: i32;
-    let parsee: i32; //~ ERROR: name is too similar
-    //~| HELP: separate the discriminating character by an underscore like: `parse_e`
+    let parsee: i32;
+
 
     let setter: i32;
     let getter: i32;
@@ -93,8 +93,8 @@ fn main() {
 
 fn foo() {
     let Foo { apple, bpple } = unimplemented!();
-    let Foo { apple: spring, //~NOTE existing binding defined here
-        bpple: sprang } = unimplemented!(); //~ ERROR: name is too similar
+    let Foo { apple: spring,
+        bpple: sprang } = unimplemented!();
 }
 
 #[derive(Clone, Debug)]
@@ -128,19 +128,19 @@ fn bla() {
             let blar: i32;
         }
         {
-            let e: i32; //~ ERROR: 5th binding whose name is just one char
-            //~^ NOTE implied by
+            let e: i32;
+
         }
         {
-            let e: i32; //~ ERROR: 5th binding whose name is just one char
-            //~^ NOTE implied by
-            let f: i32; //~ ERROR: 6th binding whose name is just one char
-            //~^ NOTE implied by
+            let e: i32;
+
+            let f: i32;
+
         }
         match 5 {
             1 => println!(""),
-            e => panic!(), //~ ERROR: 5th binding whose name is just one char
-            //~^ NOTE implied by
+            e => panic!(),
+
         }
         match 5 {
             1 => println!(""),
index 4ddb5c84a64889a74aa322f3590ef859bd040113..c47f5a449a235046b5be395979d879077b956d7f 100644 (file)
@@ -1,7 +1,7 @@
 error: binding's name is too similar to existing binding
   --> $DIR/non_expressive_names.rs:29:9
    |
-29 |     let bpple: i32; //~ ERROR: name is too similar
+29 |     let bpple: i32;
    |         ^^^^^
    |
 note: lint level defined here
@@ -12,105 +12,105 @@ note: lint level defined here
 note: existing binding defined here
   --> $DIR/non_expressive_names.rs:27:9
    |
-27 |     let apple: i32; //~ NOTE: existing binding defined here
+27 |     let apple: i32;
    |         ^^^^^
 help: separate the discriminating character by an underscore like: `b_pple`
   --> $DIR/non_expressive_names.rs:29:9
    |
-29 |     let bpple: i32; //~ ERROR: name is too similar
+29 |     let bpple: i32;
    |         ^^^^^
 
 error: binding's name is too similar to existing binding
   --> $DIR/non_expressive_names.rs:31:9
    |
-31 |     let cpple: i32; //~ ERROR: name is too similar
+31 |     let cpple: i32;
    |         ^^^^^
    |
 note: existing binding defined here
   --> $DIR/non_expressive_names.rs:27:9
    |
-27 |     let apple: i32; //~ NOTE: existing binding defined here
+27 |     let apple: i32;
    |         ^^^^^
 help: separate the discriminating character by an underscore like: `c_pple`
   --> $DIR/non_expressive_names.rs:31:9
    |
-31 |     let cpple: i32; //~ ERROR: name is too similar
+31 |     let cpple: i32;
    |         ^^^^^
 
 error: binding's name is too similar to existing binding
   --> $DIR/non_expressive_names.rs:56:9
    |
-56 |     let bluby: i32; //~ ERROR: name is too similar
+56 |     let bluby: i32;
    |         ^^^^^
    |
 note: existing binding defined here
   --> $DIR/non_expressive_names.rs:55:9
    |
-55 |     let blubx: i32; //~ NOTE: existing binding defined here
+55 |     let blubx: i32;
    |         ^^^^^
 help: separate the discriminating character by an underscore like: `blub_y`
   --> $DIR/non_expressive_names.rs:56:9
    |
-56 |     let bluby: i32; //~ ERROR: name is too similar
+56 |     let bluby: i32;
    |         ^^^^^
 
 error: binding's name is too similar to existing binding
   --> $DIR/non_expressive_names.rs:61:9
    |
-61 |     let coke: i32; //~ ERROR: name is too similar
+61 |     let coke: i32;
    |         ^^^^
    |
 note: existing binding defined here
   --> $DIR/non_expressive_names.rs:59:9
    |
-59 |     let cake: i32; //~ NOTE: existing binding defined here
+59 |     let cake: i32;
    |         ^^^^
 
 error: binding's name is too similar to existing binding
   --> $DIR/non_expressive_names.rs:79:9
    |
-79 |     let xyzeabc: i32; //~ ERROR: name is too similar
+79 |     let xyzeabc: i32;
    |         ^^^^^^^
    |
 note: existing binding defined here
   --> $DIR/non_expressive_names.rs:77:9
    |
-77 |     let xyz1abc: i32; //~ NOTE: existing binding defined here
+77 |     let xyz1abc: i32;
    |         ^^^^^^^
 
 error: binding's name is too similar to existing binding
   --> $DIR/non_expressive_names.rs:83:9
    |
-83 |     let parsee: i32; //~ ERROR: name is too similar
+83 |     let parsee: i32;
    |         ^^^^^^
    |
 note: existing binding defined here
   --> $DIR/non_expressive_names.rs:81:9
    |
-81 |     let parser: i32; //~ NOTE: existing binding defined here
+81 |     let parser: i32;
    |         ^^^^^^
 help: separate the discriminating character by an underscore like: `parse_e`
   --> $DIR/non_expressive_names.rs:83:9
    |
-83 |     let parsee: i32; //~ ERROR: name is too similar
+83 |     let parsee: i32;
    |         ^^^^^^
 
 error: binding's name is too similar to existing binding
   --> $DIR/non_expressive_names.rs:97:16
    |
-97 |         bpple: sprang } = unimplemented!(); //~ ERROR: name is too similar
+97 |         bpple: sprang } = unimplemented!();
    |                ^^^^^^
    |
 note: existing binding defined here
   --> $DIR/non_expressive_names.rs:96:22
    |
-96 |     let Foo { apple: spring, //~NOTE existing binding defined here
+96 |     let Foo { apple: spring,
    |                      ^^^^^^
 
 error: 5th binding whose name is just one char
    --> $DIR/non_expressive_names.rs:131:17
     |
-131 |             let e: i32; //~ ERROR: 5th binding whose name is just one char
+131 |             let e: i32;
     |                 ^
     |
     = note: #[deny(many_single_char_names)] implied by #[deny(clippy)]
@@ -123,7 +123,7 @@ note: lint level defined here
 error: 5th binding whose name is just one char
    --> $DIR/non_expressive_names.rs:135:17
     |
-135 |             let e: i32; //~ ERROR: 5th binding whose name is just one char
+135 |             let e: i32;
     |                 ^
     |
     = note: #[deny(many_single_char_names)] implied by #[deny(clippy)]
@@ -131,7 +131,7 @@ error: 5th binding whose name is just one char
 error: 6th binding whose name is just one char
    --> $DIR/non_expressive_names.rs:137:17
     |
-137 |             let f: i32; //~ ERROR: 6th binding whose name is just one char
+137 |             let f: i32;
     |                 ^
     |
     = note: #[deny(many_single_char_names)] implied by #[deny(clippy)]
@@ -139,7 +139,7 @@ error: 6th binding whose name is just one char
 error: 5th binding whose name is just one char
    --> $DIR/non_expressive_names.rs:142:13
     |
-142 |             e => panic!(), //~ ERROR: 5th binding whose name is just one char
+142 |             e => panic!(),
     |             ^
     |
     = note: #[deny(many_single_char_names)] implied by #[deny(clippy)]
index 3676f473bcd0dc078be31cefdfb6b5aab38ef80f..414176f8d1081c52916e03079920c344b29549e3 100644 (file)
@@ -5,7 +5,7 @@
 
 fn str_to_int(x: &str) -> i32 {
     if let Some(y) = x.parse().ok() { 
-    //~^ERROR Matching on `Some` with `ok()` is redundant
+
         y
     } else {
         0
index e39b5855435c49447533a6f4e3ba2d45ddf27328..d3eaaddaefc8462c2cfe6295dd43ced73cc10564 100644 (file)
@@ -3,7 +3,7 @@ error: Matching on `Some` with `ok()` is redundant
    |
 7  |       if let Some(y) = x.parse().ok() { 
    |  _____^ starting here...
-8  | |     //~^ERROR Matching on `Some` with `ok()` is redundant
+8  | |
 9  | |         y
 10 | |     } else {
 11 | |         0
index 08024e37d4af8b98c456db6884f958bb44fa2c91..e1ce69af76e64ed41492702ee05893c0a2d9172c 100644 (file)
@@ -5,12 +5,12 @@
 #[allow(unused_must_use)]
 #[deny(nonsensical_open_options)]
 fn main() {
-    OpenOptions::new().read(true).truncate(true).open("foo.txt"); //~ERROR file opened with "truncate" and "read"
-    OpenOptions::new().append(true).truncate(true).open("foo.txt"); //~ERROR file opened with "append" and "truncate"
+    OpenOptions::new().read(true).truncate(true).open("foo.txt");
+    OpenOptions::new().append(true).truncate(true).open("foo.txt");
 
-    OpenOptions::new().read(true).read(false).open("foo.txt"); //~ERROR the method "read" is called more than once
-    OpenOptions::new().create(true).create(false).open("foo.txt"); //~ERROR the method "create" is called more than once
-    OpenOptions::new().write(true).write(false).open("foo.txt"); //~ERROR the method "write" is called more than once
-    OpenOptions::new().append(true).append(false).open("foo.txt"); //~ERROR the method "append" is called more than once
-    OpenOptions::new().truncate(true).truncate(false).open("foo.txt"); //~ERROR the method "truncate" is called more than once
+    OpenOptions::new().read(true).read(false).open("foo.txt");
+    OpenOptions::new().create(true).create(false).open("foo.txt");
+    OpenOptions::new().write(true).write(false).open("foo.txt");
+    OpenOptions::new().append(true).append(false).open("foo.txt");
+    OpenOptions::new().truncate(true).truncate(false).open("foo.txt");
 }
index f7d3d85edbd99b90a05969bcee80f8abd9df4dc1..0f9779c277823e88e2e29e267d6254c87e926a0d 100644 (file)
@@ -1,7 +1,7 @@
 error: file opened with "truncate" and "read"
  --> $DIR/open_options.rs:8:5
   |
-8 |     OpenOptions::new().read(true).truncate(true).open("foo.txt"); //~ERROR file opened with "truncate" and "read"
+8 |     OpenOptions::new().read(true).truncate(true).open("foo.txt");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
 note: lint level defined here
@@ -13,37 +13,37 @@ note: lint level defined here
 error: file opened with "append" and "truncate"
  --> $DIR/open_options.rs:9:5
   |
-9 |     OpenOptions::new().append(true).truncate(true).open("foo.txt"); //~ERROR file opened with "append" and "truncate"
+9 |     OpenOptions::new().append(true).truncate(true).open("foo.txt");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: the method "read" is called more than once
   --> $DIR/open_options.rs:11:5
    |
-11 |     OpenOptions::new().read(true).read(false).open("foo.txt"); //~ERROR the method "read" is called more than once
+11 |     OpenOptions::new().read(true).read(false).open("foo.txt");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: the method "create" is called more than once
   --> $DIR/open_options.rs:12:5
    |
-12 |     OpenOptions::new().create(true).create(false).open("foo.txt"); //~ERROR the method "create" is called more than once
+12 |     OpenOptions::new().create(true).create(false).open("foo.txt");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: the method "write" is called more than once
   --> $DIR/open_options.rs:13:5
    |
-13 |     OpenOptions::new().write(true).write(false).open("foo.txt"); //~ERROR the method "write" is called more than once
+13 |     OpenOptions::new().write(true).write(false).open("foo.txt");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: the method "append" is called more than once
   --> $DIR/open_options.rs:14:5
    |
-14 |     OpenOptions::new().append(true).append(false).open("foo.txt"); //~ERROR the method "append" is called more than once
+14 |     OpenOptions::new().append(true).append(false).open("foo.txt");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: the method "truncate" is called more than once
   --> $DIR/open_options.rs:15:5
    |
-15 |     OpenOptions::new().truncate(true).truncate(false).open("foo.txt"); //~ERROR the method "truncate" is called more than once
+15 |     OpenOptions::new().truncate(true).truncate(false).open("foo.txt");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 7 previous errors
index 24310eb81dae057e88f909f11748f67b3a79d970..51503003be41a652867fad3b2cae30596513aa53 100644 (file)
@@ -8,28 +8,28 @@ fn main() {
        let a: u32 = 1;
        let b: u32 = 2;
        let c: u32 = 3;
-       if a + b < a { //~ERROR You are trying to use classic C overflow conditions that will fail in Rust.
+       if a + b < a {
 
        }
-       if a > a + b { //~ERROR You are trying to use classic C overflow conditions that will fail in Rust.
+       if a > a + b {
 
        }
-       if a + b < b { //~ERROR You are trying to use classic C overflow conditions that will fail in Rust.
+       if a + b < b {
 
        }
-       if b > a + b { //~ERROR You are trying to use classic C overflow conditions that will fail in Rust.
+       if b > a + b {
 
        }
-       if a - b > b { //~ERROR You are trying to use classic C underflow conditions that will fail in Rust.
+       if a - b > b {
 
        }
-       if b < a - b { //~ERROR You are trying to use classic C underflow conditions that will fail in Rust.
+       if b < a - b {
 
        }
-       if a - b > a { //~ERROR You are trying to use classic C underflow conditions that will fail in Rust.
+       if a - b > a {
 
        }
-       if a < a - b { //~ERROR You are trying to use classic C underflow conditions that will fail in Rust.
+       if a < a - b {
 
        }
        if a + b < c {
index f3c330b168a4a8287055d541fbe7581f3227a29e..8705f3d72038705440e700febb390f927608140d 100644 (file)
@@ -1,7 +1,7 @@
 error: You are trying to use classic C overflow conditions that will fail in Rust.
   --> $DIR/overflow_check_conditional.rs:11:5
    |
-11 | \tif a + b < a { //~ERROR You are trying to use classic C overflow conditions that will fail in Rust.
+11 | \tif a + b < a {
    | \t   ^^^^^^^^^
    |
 note: lint level defined here
@@ -13,43 +13,43 @@ note: lint level defined here
 error: You are trying to use classic C overflow conditions that will fail in Rust.
   --> $DIR/overflow_check_conditional.rs:14:5
    |
-14 | \tif a > a + b { //~ERROR You are trying to use classic C overflow conditions that will fail in Rust.
+14 | \tif a > a + b {
    | \t   ^^^^^^^^^
 
 error: You are trying to use classic C overflow conditions that will fail in Rust.
   --> $DIR/overflow_check_conditional.rs:17:5
    |
-17 | \tif a + b < b { //~ERROR You are trying to use classic C overflow conditions that will fail in Rust.
+17 | \tif a + b < b {
    | \t   ^^^^^^^^^
 
 error: You are trying to use classic C overflow conditions that will fail in Rust.
   --> $DIR/overflow_check_conditional.rs:20:5
    |
-20 | \tif b > a + b { //~ERROR You are trying to use classic C overflow conditions that will fail in Rust.
+20 | \tif b > a + b {
    | \t   ^^^^^^^^^
 
 error: You are trying to use classic C underflow conditions that will fail in Rust.
   --> $DIR/overflow_check_conditional.rs:23:5
    |
-23 | \tif a - b > b { //~ERROR You are trying to use classic C underflow conditions that will fail in Rust.
+23 | \tif a - b > b {
    | \t   ^^^^^^^^^
 
 error: You are trying to use classic C underflow conditions that will fail in Rust.
   --> $DIR/overflow_check_conditional.rs:26:5
    |
-26 | \tif b < a - b { //~ERROR You are trying to use classic C underflow conditions that will fail in Rust.
+26 | \tif b < a - b {
    | \t   ^^^^^^^^^
 
 error: You are trying to use classic C underflow conditions that will fail in Rust.
   --> $DIR/overflow_check_conditional.rs:29:5
    |
-29 | \tif a - b > a { //~ERROR You are trying to use classic C underflow conditions that will fail in Rust.
+29 | \tif a - b > a {
    | \t   ^^^^^^^^^
 
 error: You are trying to use classic C underflow conditions that will fail in Rust.
   --> $DIR/overflow_check_conditional.rs:32:5
    |
-32 | \tif a < a - b { //~ERROR You are trying to use classic C underflow conditions that will fail in Rust.
+32 | \tif a < a - b {
    | \t   ^^^^^^^^^
 
 error: aborting due to 8 previous errors
index 7e535d69b698ad504120b9c13468d93f28bedc34..741c80903562aea2efffb475d36d2e20824567f4 100644 (file)
@@ -5,11 +5,11 @@
 
 fn missing() {
     if true {
-        panic!("{}"); //~ERROR: you probably are missing some parameter
+        panic!("{}");
     } else if false {
-        panic!("{:?}"); //~ERROR: you probably are missing some parameter
+        panic!("{:?}");
     } else {
-        assert!(true, "here be missing values: {}"); //~ERROR you probably are missing some parameter
+        assert!(true, "here be missing values: {}");
     }
 }
 
index 41317288c3beff936918e6edab5b43ee76a176a9..e77add7a32ae5ac3fcfb6c65989a76743f5379ec 100644 (file)
@@ -1,7 +1,7 @@
 error: you probably are missing some parameter in your format string
  --> $DIR/panic.rs:8:16
   |
-8 |         panic!("{}"); //~ERROR: you probably are missing some parameter
+8 |         panic!("{}");
   |                ^^^^
   |
 note: lint level defined here
@@ -13,13 +13,13 @@ note: lint level defined here
 error: you probably are missing some parameter in your format string
   --> $DIR/panic.rs:10:16
    |
-10 |         panic!("{:?}"); //~ERROR: you probably are missing some parameter
+10 |         panic!("{:?}");
    |                ^^^^^^
 
 error: you probably are missing some parameter in your format string
   --> $DIR/panic.rs:12:23
    |
-12 |         assert!(true, "here be missing values: {}"); //~ERROR you probably are missing some parameter
+12 |         assert!(true, "here be missing values: {}");
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 3 previous errors
index f4ecdd4261a272862e502f3c649c2eceb601b416..9ee1f48b01c59c43999e00adae8ef713cc5c58b2 100644 (file)
@@ -9,7 +9,7 @@
 impl PartialEq for Foo {
     fn eq(&self, _: &Foo) -> bool { true }
     fn ne(&self, _: &Foo) -> bool { false }
-    //~^ ERROR re-implementing `PartialEq::ne` is unnecessary
+
 }
 
 fn main() {}
index 62bd2c43cc1487a2c3f0dd1fd253674c0b4564db..d4aa513ea062bc6bbc14048dd56984f5476cc829 100644 (file)
@@ -7,7 +7,7 @@ fn main() {
     let v = Some(true);
     match v {
         Some(x) => (),
-        y @ _   => (),  //~ERROR the `y @ _` pattern can be written as just `y`
+        y @ _   => (),
     }
     match v {
         Some(x)  => (),
index b55f9e477d41b324114a3b6dd3a852b766f5963e..515ae4cae6ee33e54da51b6404d61f10a40f5d67 100644 (file)
@@ -1,7 +1,7 @@
 error: the `y @ _` pattern can be written as just `y`
   --> $DIR/patterns.rs:10:9
    |
-10 |         y @ _   => (),  //~ERROR the `y @ _` pattern can be written as just `y`
+10 |         y @ _   => (),
    |         ^^^^^
    |
    = note: #[deny(redundant_pattern)] implied by #[deny(clippy)]
index 28cc9e643c040bfef6a154aba0a26458ee5a0cdd..1c6019fdecf1474a56dee584fd58dc9c1601b45d 100644 (file)
@@ -6,33 +6,33 @@
 #[allow(eq_op)]
 fn main() {
     1 << 2 + 3;
-    //~^ ERROR operator precedence can trip
-    //~| SUGGESTION 1 << (2 + 3)
+
+
     1 + 2 << 3;
-    //~^ERROR operator precedence can trip
-    //~| SUGGESTION (1 + 2) << 3
+
+
     4 >> 1 + 1;
-    //~^ERROR operator precedence can trip
-    //~| SUGGESTION 4 >> (1 + 1)
+
+
     1 + 3 >> 2;
-    //~^ERROR operator precedence can trip
-    //~| SUGGESTION (1 + 3) >> 2
+
+
     1 ^ 1 - 1;
-    //~^ERROR operator precedence can trip
-    //~| SUGGESTION 1 ^ (1 - 1)
+
+
     3 | 2 - 1;
-    //~^ERROR operator precedence can trip
-    //~| SUGGESTION 3 | (2 - 1)
+
+
     3 & 5 - 2;
-    //~^ERROR operator precedence can trip
-    //~| SUGGESTION 3 & (5 - 2)
+
+
 
     -1i32.abs();
-    //~^ERROR unary minus has lower precedence
-    //~| SUGGESTION -(1i32.abs())
+
+
     -1f32.abs();
-    //~^ERROR unary minus has lower precedence
-    //~| SUGGESTION -(1f32.abs())
+
+
 
     // These should not trigger an error
     let _ = (-1i32).abs();
index 34c38dca2861e0b8b117f7faa51bbb477493bd48..e6b114b897b8c24a0a0b61224d0a131de9d861dd 100644 (file)
@@ -10,7 +10,7 @@
 impl Display for Foo {
     fn fmt(&self, f: &mut Formatter) -> Result {
         write!(f, "{:?}", 43.1415)
-        //~^ ERROR use of `Debug`-based formatting
+
     }
 }
 
@@ -22,18 +22,18 @@ fn fmt(&self, f: &mut Formatter) -> Result {
 }
 
 fn main() {
-    println!("Hello"); //~ERROR use of `println!`
-    print!("Hello"); //~ERROR use of `print!`
+    println!("Hello");
+    print!("Hello");
 
-    print!("Hello {}", "World"); //~ERROR use of `print!`
+    print!("Hello {}", "World");
 
     print!("Hello {:?}", "World");
-    //~^ ERROR use of `print!`
-    //~| ERROR use of `Debug`-based formatting
+
+
 
     print!("Hello {:#?}", "#orld");
-    //~^ ERROR use of `print!`
-    //~| ERROR use of `Debug`-based formatting
+
+
 
     assert_eq!(42, 1337);
 
index efa574f56e313ad041710fd76b02f243f6fa4620..5afb8ae504d4569af576ac26c224330c4d34afc6 100644 (file)
@@ -13,7 +13,7 @@ note: lint level defined here
 error: use of `println!`
   --> $DIR/print.rs:25:5
    |
-25 |     println!("Hello"); //~ERROR use of `println!`
+25 |     println!("Hello");
    |     ^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -25,13 +25,13 @@ note: lint level defined here
 error: use of `print!`
   --> $DIR/print.rs:26:5
    |
-26 |     print!("Hello"); //~ERROR use of `print!`
+26 |     print!("Hello");
    |     ^^^^^^^^^^^^^^^^
 
 error: use of `print!`
   --> $DIR/print.rs:28:5
    |
-28 |     print!("Hello {}", "World"); //~ERROR use of `print!`
+28 |     print!("Hello {}", "World");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: use of `print!`
index 4c1ebd9fe503c1f9822427f9c7a597a70f0ec542..3e2b31a528fd8de6584a92983033f0e4cb4787a9 100644 (file)
@@ -3,10 +3,10 @@
 #![deny(print_with_newline)]
 
 fn main() {
-    print!("Hello\n"); //~ERROR using `print!()` with a format string
-    print!("Hello {}\n", "world"); //~ERROR using `print!()` with a format string
-    print!("Hello {} {}\n\n", "world", "#2"); //~ERROR using `print!()` with a format string
-    print!("{}\n", 1265); //~ERROR using `print!()` with a format string
+    print!("Hello\n");
+    print!("Hello {}\n", "world");
+    print!("Hello {} {}\n\n", "world", "#2");
+    print!("{}\n", 1265);
 
     // these are all fine
     print!("");
index 94edc532593fb87e4cde3033fbba0a3f832de1a2..44beb530277b4b2183423bba0338bc22d5a8f560 100644 (file)
@@ -1,7 +1,7 @@
 error: using `print!()` with a format string that ends in a newline, consider using `println!()` instead
  --> $DIR/print_with_newline.rs:6:5
   |
-6 |     print!("Hello/n"); //~ERROR using `print!()` with a format string
+6 |     print!("Hello/n");
   |     ^^^^^^^^^^^^^^^^^^
   |
 note: lint level defined here
@@ -13,19 +13,19 @@ note: lint level defined here
 error: using `print!()` with a format string that ends in a newline, consider using `println!()` instead
  --> $DIR/print_with_newline.rs:7:5
   |
-7 |     print!("Hello {}/n", "world"); //~ERROR using `print!()` with a format string
+7 |     print!("Hello {}/n", "world");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: using `print!()` with a format string that ends in a newline, consider using `println!()` instead
  --> $DIR/print_with_newline.rs:8:5
   |
-8 |     print!("Hello {} {}/n/n", "world", "#2"); //~ERROR using `print!()` with a format string
+8 |     print!("Hello {} {}/n/n", "world", "#2");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: using `print!()` with a format string that ends in a newline, consider using `println!()` instead
  --> $DIR/print_with_newline.rs:9:5
   |
-9 |     print!("{}/n", 1265); //~ERROR using `print!()` with a format string
+9 |     print!("{}/n", 1265);
   |     ^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 4 previous errors
index e4971208747a77041916cf0646e80934613fa4e6..f262d2a8dba197540e95d014fa0f7fbffad6cdeb 100644 (file)
@@ -3,7 +3,7 @@
 #![allow(unused)]
 #![deny(ptr_arg)]
 
-fn do_vec(x: &Vec<i64>) { //~ERROR writing `&Vec<_>` instead of `&[_]`
+fn do_vec(x: &Vec<i64>) {
     //Nothing here
 }
 
@@ -11,7 +11,7 @@ fn do_vec_mut(x: &mut Vec<i64>) { // no error here
     //Nothing here
 }
 
-fn do_str(x: &String) { //~ERROR writing `&String` instead of `&str`
+fn do_str(x: &String) {
     //Nothing here either
 }
 
@@ -24,7 +24,7 @@ fn main() {
 
 trait Foo {
     type Item;
-    fn do_vec(x: &Vec<i64>); //~ERROR writing `&Vec<_>`
+    fn do_vec(x: &Vec<i64>);
     fn do_item(x: &Self::Item);
 }
 
index a022f0e5550f49440f43b4ecc7c4a1cf4dd54a75..ce9c1e856fd63099ad390ec2b946d5a6e2f0a5a5 100644 (file)
@@ -1,7 +1,7 @@
 error: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. Consider changing the type to `&[...]`
  --> $DIR/ptr_arg.rs:6:14
   |
-6 | fn do_vec(x: &Vec<i64>) { //~ERROR writing `&Vec<_>` instead of `&[_]`
+6 | fn do_vec(x: &Vec<i64>) {
   |              ^^^^^^^^^
   |
 note: lint level defined here
@@ -13,13 +13,13 @@ note: lint level defined here
 error: writing `&String` instead of `&str` involves a new object where a slice will do. Consider changing the type to `&str`
   --> $DIR/ptr_arg.rs:14:14
    |
-14 | fn do_str(x: &String) { //~ERROR writing `&String` instead of `&str`
+14 | fn do_str(x: &String) {
    |              ^^^^^^^
 
 error: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. Consider changing the type to `&[...]`
   --> $DIR/ptr_arg.rs:27:18
    |
-27 |     fn do_vec(x: &Vec<i64>); //~ERROR writing `&Vec<_>`
+27 |     fn do_vec(x: &Vec<i64>);
    |                  ^^^^^^^^^
 
 error: aborting due to 3 previous errors
index fc12155ce9cb816b7d0569d9a9a5ba66511b2890..8e2bf6a7e69d8ecc8e9ad00b4b5dbfe6d00aab4f 100644 (file)
@@ -10,15 +10,15 @@ fn step_by(&self, _: u32) {}
 
 #[deny(range_step_by_zero, range_zip_with_len)]
 fn main() {
-    (0..1).step_by(0); //~ERROR Range::step_by(0) produces an infinite iterator
+    (0..1).step_by(0);
     // No warning for non-zero step
     (0..1).step_by(1);
 
-    (1..).step_by(0); //~ERROR Range::step_by(0) produces an infinite iterator
-    (1...2).step_by(0); //~ERROR Range::step_by(0) produces an infinite iterator
+    (1..).step_by(0);
+    (1...2).step_by(0);
 
     let x = 0..1;
-    x.step_by(0); //~ERROR Range::step_by(0) produces an infinite iterator
+    x.step_by(0);
 
     // No error, not a range.
     let y = NotARange;
@@ -26,6 +26,6 @@ fn main() {
 
     let v1 = vec![1,2,3];
     let v2 = vec![4,5];
-    let _x = v1.iter().zip(0..v1.len()); //~ERROR It is more idiomatic to use v1.iter().enumerate()
+    let _x = v1.iter().zip(0..v1.len());
     let _y = v1.iter().zip(0..v2.len()); // No error
 }
index a7c4d4fcffd274feb1302efc856be7326ecbdab0..09e9f8a475143cecc25648dfeab935a693d5c488 100644 (file)
@@ -1,7 +1,7 @@
 error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead
   --> $DIR/range.rs:13:5
    |
-13 |     (0..1).step_by(0); //~ERROR Range::step_by(0) produces an infinite iterator
+13 |     (0..1).step_by(0);
    |     ^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,25 +13,25 @@ note: lint level defined here
 error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead
   --> $DIR/range.rs:17:5
    |
-17 |     (1..).step_by(0); //~ERROR Range::step_by(0) produces an infinite iterator
+17 |     (1..).step_by(0);
    |     ^^^^^^^^^^^^^^^^
 
 error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead
   --> $DIR/range.rs:18:5
    |
-18 |     (1...2).step_by(0); //~ERROR Range::step_by(0) produces an infinite iterator
+18 |     (1...2).step_by(0);
    |     ^^^^^^^^^^^^^^^^^^
 
 error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead
   --> $DIR/range.rs:21:5
    |
-21 |     x.step_by(0); //~ERROR Range::step_by(0) produces an infinite iterator
+21 |     x.step_by(0);
    |     ^^^^^^^^^^^^
 
 error: It is more idiomatic to use v1.iter().enumerate()
   --> $DIR/range.rs:29:14
    |
-29 |     let _x = v1.iter().zip(0..v1.len()); //~ERROR It is more idiomatic to use v1.iter().enumerate()
+29 |     let _x = v1.iter().zip(0..v1.len());
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
index 73830ecc9f16427ce74fdfa4ce42d90e23a57c40..a431e05e72fd030ca09a56d7ce1edaf62f05d3cd 100644 (file)
@@ -5,20 +5,20 @@
 
 fn main() {
        let a = (|| 42)();
-       //~^ ERROR Try not to call a closure in the expression where it is declared.
-       //~| HELP Try doing something like:
-       //~| SUGGESTION let a = 42;
+
+
+
 
        let mut i = 1;
-       let k = (|m| m+1)(i); //~ERROR Try not to call a closure in the expression where it is declared.
+       let k = (|m| m+1)(i);
 
-       k = (|a,b| a*b)(1,5); //~ERROR Try not to call a closure in the expression where it is declared.
+       k = (|a,b| a*b)(1,5);
 
        let closure = || 32;
-       i = closure(); //~ERROR Closure called just once immediately after it was declared
+       i = closure();
 
        let closure = |i| i+1;
-       i = closure(3); //~ERROR Closure called just once immediately after it was declared
+       i = closure(3);
 
        i = closure(4);
 }
index 94facfa0fff65af36a6c33b3a27cf3d0d0c84bc0..287f465bb4ad4b95c91adce74c050bef3edcfa78 100644 (file)
@@ -1,7 +1,7 @@
 error: Closure called just once immediately after it was declared
   --> $DIR/redundant_closure_call.rs:18:2
    |
-18 | \ti = closure(); //~ERROR Closure called just once immediately after it was declared
+18 | \ti = closure();
    | \t^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: Closure called just once immediately after it was declared
   --> $DIR/redundant_closure_call.rs:21:2
    |
-21 | \ti = closure(3); //~ERROR Closure called just once immediately after it was declared
+21 | \ti = closure(3);
    | \t^^^^^^^^^^^^^^
 
 error: Try not to call a closure in the expression where it is declared.
@@ -28,13 +28,13 @@ help: Try doing something like:
 error: Try not to call a closure in the expression where it is declared.
   --> $DIR/redundant_closure_call.rs:13:10
    |
-13 | \tlet k = (|m| m+1)(i); //~ERROR Try not to call a closure in the expression where it is declared.
+13 | \tlet k = (|m| m+1)(i);
    | \t        ^^^^^^^^^^^^
 
 error: Try not to call a closure in the expression where it is declared.
   --> $DIR/redundant_closure_call.rs:15:6
    |
-15 | \tk = (|a,b| a*b)(1,5); //~ERROR Try not to call a closure in the expression where it is declared.
+15 | \tk = (|a,b| a*b)(1,5);
    | \t    ^^^^^^^^^^^^^^^^
 
 error: aborting due to 5 previous errors
index 789425e71fe41ed56dfc998043bd511f2111620f..d1160df9e128a36752bfb3ff9f9d476dbc474928 100644 (file)
@@ -17,63 +17,63 @@ fn main() {
     let aref = &a;
 
     let b = *&a;
-    //~^ERROR immediately dereferencing a reference
-    //~|HELP try this
-    //~|SUGGESTION let b = a;
+
+
+
 
     let b = *&get_number();
-    //~^ERROR immediately dereferencing a reference
-    //~|HELP try this
-    //~|SUGGESTION let b = get_number();
+
+
+
 
     let b = *get_reference(&a);
 
     let bytes : Vec<usize> = vec![1, 2, 3, 4];
     let b = *&bytes[1..2][0];
-    //~^ERROR immediately dereferencing a reference
-    //~|HELP try this
-    //~|SUGGESTION let b = bytes[1..2][0];
+
+
+
 
     //This produces a suggestion of 'let b = (a);' which
     //will trigger the 'unused_parens' lint
     let b = *&(a);
-    //~^ERROR immediately dereferencing a reference
-    //~|HELP try this
-    //~|SUGGESTION let b = (a)
+
+
+
 
     let b = *(&a);
-    //~^ERROR immediately dereferencing a reference
-    //~|HELP try this
-    //~|SUGGESTION let b = a;
+
+
+
 
     let b = *((&a));
-    //~^ERROR immediately dereferencing a reference
-    //~|HELP try this
-    //~|SUGGESTION let b = a
+
+
+
 
     let b = *&&a;
-    //~^ERROR immediately dereferencing a reference
-    //~|HELP try this
-    //~|SUGGESTION let b = &a;
+
+
+
 
     let b = **&aref;
-    //~^ERROR immediately dereferencing a reference
-    //~|HELP try this
-    //~|SUGGESTION let b = *aref;
+
+
+
 
     //This produces a suggestion of 'let b = *&a;' which
     //will trigger the 'deref_addrof' lint again
     let b = **&&a;
-    //~^ERROR immediately dereferencing a reference
-    //~|HELP try this
-    //~|SUGGESTION let b = *&a;
+
+
+
 
     {
         let mut x = 10;
         let y = *&mut x;
-        //~^ERROR immediately dereferencing a reference
-        //~|HELP try this
-        //~|SUGGESTION let y = x;
+
+
+
     }
 
     {
@@ -81,8 +81,8 @@ fn main() {
         //will trigger the 'deref_addrof' lint again
         let mut x = 10;
         let y = **&mut &mut x;
-        //~^ERROR immediately dereferencing a reference
-        //~|HELP try this
-        //~|SUGGESTION let y = *&mut x;
+
+
+
     }
 }
index d6287b881a19334222210dc43fefedc078db0a2c..245ceb83561761191a4db8b924eafc82f2111fb4 100644 (file)
 
 fn syntax_error() {
     let pipe_in_wrong_position = Regex::new("|");
-    //~^ERROR: regex syntax error: empty alternate
+
     let pipe_in_wrong_position_builder = RegexBuilder::new("|");
-    //~^ERROR: regex syntax error: empty alternate
+
     let wrong_char_ranice = Regex::new("[z-a]");
-    //~^ERROR: regex syntax error: invalid character class range
+
     let some_unicode = Regex::new("[é-è]");
-    //~^ERROR: regex syntax error: invalid character class range
+
 
     let some_regex = Regex::new(OPENING_PAREN);
-    //~^ERROR: regex syntax error on position 0: unclosed
+
 
     let binary_pipe_in_wrong_position = BRegex::new("|");
-    //~^ERROR: regex syntax error: empty alternate
+
     let some_binary_regex = BRegex::new(OPENING_PAREN);
-    //~^ERROR: regex syntax error on position 0: unclosed
+
     let some_binary_regex_builder = BRegexBuilder::new(OPENING_PAREN);
-    //~^ERROR: regex syntax error on position 0: unclosed
+
 
     let closing_paren = ")";
     let not_linted = Regex::new(closing_paren);
@@ -46,61 +46,61 @@ fn syntax_error() {
 
     let set_error = RegexSet::new(&[
         OPENING_PAREN,
-        //~^ERROR: regex syntax error on position 0: unclosed
+
         r"[a-z]+\.(com|org|net)",
     ]);
     let bset_error = BRegexSet::new(&[
         OPENING_PAREN,
-        //~^ERROR: regex syntax error on position 0: unclosed
+
         r"[a-z]+\.(com|org|net)",
     ]);
 }
 
 fn trivial_regex() {
     let trivial_eq = Regex::new("^foobar$");
-    //~^ERROR: trivial regex
-    //~|HELP consider using `==` on `str`s
+
+
 
     let trivial_eq_builder = RegexBuilder::new("^foobar$");
-    //~^ERROR: trivial regex
-    //~|HELP consider using `==` on `str`s
+
+
 
     let trivial_starts_with = Regex::new("^foobar");
-    //~^ERROR: trivial regex
-    //~|HELP consider using `str::starts_with`
+
+
 
     let trivial_ends_with = Regex::new("foobar$");
-    //~^ERROR: trivial regex
-    //~|HELP consider using `str::ends_with`
+
+
 
     let trivial_contains = Regex::new("foobar");
-    //~^ERROR: trivial regex
-    //~|HELP consider using `str::contains`
+
+
 
     let trivial_contains = Regex::new(NOT_A_REAL_REGEX);
-    //~^ERROR: trivial regex
-    //~|HELP consider using `str::contains`
+
+
 
     let trivial_backslash = Regex::new("a\\.b");
-    //~^ERROR: trivial regex
-    //~|HELP consider using `str::contains`
+
+
 
     // unlikely corner cases
     let trivial_empty = Regex::new("");
-    //~^ERROR: trivial regex
-    //~|HELP the regex is unlikely to be useful
+
+
 
     let trivial_empty = Regex::new("^");
-    //~^ERROR: trivial regex
-    //~|HELP the regex is unlikely to be useful
+
+
 
     let trivial_empty = Regex::new("^$");
-    //~^ERROR: trivial regex
-    //~|HELP consider using `str::is_empty`
+
+
 
     let binary_trivial_empty = BRegex::new("^$");
-    //~^ERROR: trivial regex
-    //~|HELP consider using `str::is_empty`
+
+
 
     // non-trivial regexes
     let non_trivial_dot = Regex::new("a.b");
index a0671f07101dea43420275ac64572a1e1f3ba22e..78aabf352bb05ae1de23074e9e0be9419dfb5982 100644 (file)
@@ -37,7 +37,7 @@ fn expecting(&self, _: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
     }
 
     fn visit_string<E>(self, _v: String) -> Result<Self::Value, E>
-    //~^ ERROR you should not implement `visit_string` without also implementing `visit_str`
+
         where E: serde::de::Error,
     {
         unimplemented!()
index e7b493eb2baa9311e643e0b3bdbb465264ec5946..6aa5adabe787c9083dbe19ffa81c9b33e6318840 100644 (file)
@@ -3,7 +3,7 @@ error: you should not implement `visit_string` without also implementing `visit_
    |
 39 |       fn visit_string<E>(self, _v: String) -> Result<Self::Value, E>
    |  _____^ starting here...
-40 | |     //~^ ERROR you should not implement `visit_string` without also implementing `visit_str`
+40 | |
 41 | |         where E: serde::de::Error,
 42 | |     {
 43 | |         unimplemented!()
index bf0bdd81863203d4d5b4c86cb29f65ad0e4f09cf..5a2c9ba663e04e8038ed3f006a6f9eae2148bb5e 100644 (file)
@@ -10,17 +10,17 @@ fn first(x: (isize, isize)) -> isize { x.0 }
 
 fn main() {
     let mut x = 1;
-    let x = &mut x; //~ERROR `x` is shadowed by itself in `&mut x`
-    let x = { x }; //~ERROR `x` is shadowed by itself in `{ x }`
-    let x = (&*x); //~ERROR `x` is shadowed by itself in `(&*x)`
-    let x = { *x + 1 }; //~ERROR `x` is shadowed by `{ *x + 1 }` which reuses
-    let x = id(x); //~ERROR `x` is shadowed by `id(x)` which reuses
-    let x = (1, x); //~ERROR `x` is shadowed by `(1, x)` which reuses
-    let x = first(x); //~ERROR `x` is shadowed by `first(x)` which reuses
+    let x = &mut x;
+    let x = { x };
+    let x = (&*x);
+    let x = { *x + 1 };
+    let x = id(x);
+    let x = (1, x);
+    let x = first(x);
     let y = 1;
-    let x = y; //~ERROR `x` is shadowed by `y`
+    let x = y;
 
-    let x; //~ERROR `x` shadows a previous declaration
+    let x;
     x = 42;
 
     let o = Some(1_u8);
index e5ed3f18ce04cc58a01bf58e54205ee4d1a431e3..212192a28da658c5299518a3c847770957d9b472 100644 (file)
@@ -1,7 +1,7 @@
 error: `x` is shadowed by itself in `&mut x`
   --> $DIR/shadow.rs:13:9
    |
-13 |     let x = &mut x; //~ERROR `x` is shadowed by itself in `&mut x`
+13 |     let x = &mut x;
    |         ^^^^^^^^^^
    |
    = note: #[deny(shadow_same)] implied by #[deny(clippy_pedantic)]
@@ -19,33 +19,33 @@ note: previous binding is here
 error: `x` is shadowed by itself in `{ x }`
   --> $DIR/shadow.rs:14:9
    |
-14 |     let x = { x }; //~ERROR `x` is shadowed by itself in `{ x }`
+14 |     let x = { x };
    |         ^^^^^^^^^
    |
    = note: #[deny(shadow_same)] implied by #[deny(clippy_pedantic)]
 note: previous binding is here
   --> $DIR/shadow.rs:13:9
    |
-13 |     let x = &mut x; //~ERROR `x` is shadowed by itself in `&mut x`
+13 |     let x = &mut x;
    |         ^
 
 error: `x` is shadowed by itself in `(&*x)`
   --> $DIR/shadow.rs:15:9
    |
-15 |     let x = (&*x); //~ERROR `x` is shadowed by itself in `(&*x)`
+15 |     let x = (&*x);
    |         ^^^^^^^^^
    |
    = note: #[deny(shadow_same)] implied by #[deny(clippy_pedantic)]
 note: previous binding is here
   --> $DIR/shadow.rs:14:9
    |
-14 |     let x = { x }; //~ERROR `x` is shadowed by itself in `{ x }`
+14 |     let x = { x };
    |         ^
 
 error: `x` is shadowed by `{ *x + 1 }` which reuses the original value
   --> $DIR/shadow.rs:16:9
    |
-16 |     let x = { *x + 1 }; //~ERROR `x` is shadowed by `{ *x + 1 }` which reuses
+16 |     let x = { *x + 1 };
    |         ^
    |
    = note: #[deny(shadow_reuse)] implied by #[deny(clippy_pedantic)]
@@ -57,72 +57,72 @@ note: lint level defined here
 note: initialization happens here
   --> $DIR/shadow.rs:16:13
    |
-16 |     let x = { *x + 1 }; //~ERROR `x` is shadowed by `{ *x + 1 }` which reuses
+16 |     let x = { *x + 1 };
    |             ^^^^^^^^^^
 note: previous binding is here
   --> $DIR/shadow.rs:15:9
    |
-15 |     let x = (&*x); //~ERROR `x` is shadowed by itself in `(&*x)`
+15 |     let x = (&*x);
    |         ^
 
 error: `x` is shadowed by `id(x)` which reuses the original value
   --> $DIR/shadow.rs:17:9
    |
-17 |     let x = id(x); //~ERROR `x` is shadowed by `id(x)` which reuses
+17 |     let x = id(x);
    |         ^
    |
    = note: #[deny(shadow_reuse)] implied by #[deny(clippy_pedantic)]
 note: initialization happens here
   --> $DIR/shadow.rs:17:13
    |
-17 |     let x = id(x); //~ERROR `x` is shadowed by `id(x)` which reuses
+17 |     let x = id(x);
    |             ^^^^^
 note: previous binding is here
   --> $DIR/shadow.rs:16:9
    |
-16 |     let x = { *x + 1 }; //~ERROR `x` is shadowed by `{ *x + 1 }` which reuses
+16 |     let x = { *x + 1 };
    |         ^
 
 error: `x` is shadowed by `(1, x)` which reuses the original value
   --> $DIR/shadow.rs:18:9
    |
-18 |     let x = (1, x); //~ERROR `x` is shadowed by `(1, x)` which reuses
+18 |     let x = (1, x);
    |         ^
    |
    = note: #[deny(shadow_reuse)] implied by #[deny(clippy_pedantic)]
 note: initialization happens here
   --> $DIR/shadow.rs:18:13
    |
-18 |     let x = (1, x); //~ERROR `x` is shadowed by `(1, x)` which reuses
+18 |     let x = (1, x);
    |             ^^^^^^
 note: previous binding is here
   --> $DIR/shadow.rs:17:9
    |
-17 |     let x = id(x); //~ERROR `x` is shadowed by `id(x)` which reuses
+17 |     let x = id(x);
    |         ^
 
 error: `x` is shadowed by `first(x)` which reuses the original value
   --> $DIR/shadow.rs:19:9
    |
-19 |     let x = first(x); //~ERROR `x` is shadowed by `first(x)` which reuses
+19 |     let x = first(x);
    |         ^
    |
    = note: #[deny(shadow_reuse)] implied by #[deny(clippy_pedantic)]
 note: initialization happens here
   --> $DIR/shadow.rs:19:13
    |
-19 |     let x = first(x); //~ERROR `x` is shadowed by `first(x)` which reuses
+19 |     let x = first(x);
    |             ^^^^^^^^
 note: previous binding is here
   --> $DIR/shadow.rs:18:9
    |
-18 |     let x = (1, x); //~ERROR `x` is shadowed by `(1, x)` which reuses
+18 |     let x = (1, x);
    |         ^
 
 error: `x` is shadowed by `y`
   --> $DIR/shadow.rs:21:9
    |
-21 |     let x = y; //~ERROR `x` is shadowed by `y`
+21 |     let x = y;
    |         ^
    |
    = note: #[deny(shadow_unrelated)] implied by #[deny(clippy_pedantic)]
@@ -134,25 +134,25 @@ note: lint level defined here
 note: initialization happens here
   --> $DIR/shadow.rs:21:13
    |
-21 |     let x = y; //~ERROR `x` is shadowed by `y`
+21 |     let x = y;
    |             ^
 note: previous binding is here
   --> $DIR/shadow.rs:19:9
    |
-19 |     let x = first(x); //~ERROR `x` is shadowed by `first(x)` which reuses
+19 |     let x = first(x);
    |         ^
 
 error: `x` shadows a previous declaration
   --> $DIR/shadow.rs:23:9
    |
-23 |     let x; //~ERROR `x` shadows a previous declaration
+23 |     let x;
    |         ^
    |
    = note: #[deny(shadow_unrelated)] implied by #[deny(clippy_pedantic)]
 note: previous binding is here
   --> $DIR/shadow.rs:21:9
    |
-21 |     let x = y; //~ERROR `x` is shadowed by `y`
+21 |     let x = y;
    |         ^
 
 error: aborting due to 9 previous errors
index 23dfc0ebcaf2993ae49c111d503c66f8e453db84..55ff4a83b87a9760783964c009052b84c64d8f85 100644 (file)
@@ -5,17 +5,17 @@
 
 fn main() {
     f() && g();
-    //~^ ERROR boolean short circuit operator
-    //~| HELP replace it with
-    //~| SUGGESTION if f() { g(); }
+
+
+
     f() || g();
-    //~^ ERROR boolean short circuit operator
-    //~| HELP replace it with
-    //~| SUGGESTION if !f() { g(); }
+
+
+
     1 == 2 || g();
-    //~^ ERROR boolean short circuit operator
-    //~| HELP replace it with
-    //~| SUGGESTION if !(1 == 2) { g(); }
+
+
+
 }
 
 fn f() -> bool {
index 7cfc8a41ea1f1c920f41e184845a464ef98c7efa..f893d99491bee50b7c902c40003ac9e250ca9ead 100644 (file)
@@ -7,11 +7,11 @@ fn add_only() { // ignores assignment distinction
     let mut x = "".to_owned();
 
     for _ in 1..3 {
-        x = x + "."; //~ERROR you added something to a string.
+        x = x + ".";
     }
 
     let y = "".to_owned();
-    let z = y + "..."; //~ERROR you added something to a string.
+    let z = y + "...";
 
     assert_eq!(&x, &z);
 }
@@ -21,7 +21,7 @@ fn add_assign_only() {
     let mut x = "".to_owned();
 
     for _ in 1..3 {
-        x = x + "."; //~ERROR you assigned the result of adding something to this string.
+        x = x + ".";
     }
 
     let y = "".to_owned();
@@ -35,11 +35,11 @@ fn both() {
     let mut x = "".to_owned();
 
     for _ in 1..3 {
-        x = x + "."; //~ERROR you assigned the result of adding something to this string.
+        x = x + ".";
     }
 
     let y = "".to_owned();
-    let z = y + "..."; //~ERROR you added something to a string.
+    let z = y + "...";
 
     assert_eq!(&x, &z);
 }
@@ -48,9 +48,9 @@ fn both() {
 #[deny(string_lit_as_bytes)]
 fn str_lit_as_bytes() {
     let bs = "hello there".as_bytes();
-    //~^ERROR calling `as_bytes()`
-    //~|HELP byte string literal
-    //~|SUGGESTION b"hello there"
+
+
+
 
     // no warning, because this cannot be written as a byte string literal:
     let ubs = "☃".as_bytes();
@@ -66,8 +66,8 @@ fn main() {
     // the add is only caught for `String`
     let mut x = 1;
     ; x = x + 1;
-    //~^ WARN manual implementation of an assign operation
-    //~| HELP replace
-    //~| SUGGESTION ; x += 1;
+
+
+
     assert_eq!(2, x);
 }
index 892f04c7ea924c7ee88200c0a2fd897ed3fa8be2..b16724261d87bb843d76fd4cf024467134c90930 100644 (file)
@@ -1,7 +1,7 @@
 error: you added something to a string. Consider using `String::push_str()` instead
   --> $DIR/strings.rs:10:13
    |
-10 |         x = x + "."; //~ERROR you added something to a string.
+10 |         x = x + ".";
    |             ^^^^^^^
    |
 note: lint level defined here
@@ -13,13 +13,13 @@ note: lint level defined here
 error: you added something to a string. Consider using `String::push_str()` instead
   --> $DIR/strings.rs:14:13
    |
-14 |     let z = y + "..."; //~ERROR you added something to a string.
+14 |     let z = y + "...";
    |             ^^^^^^^^^
 
 error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead
   --> $DIR/strings.rs:24:9
    |
-24 |         x = x + "."; //~ERROR you assigned the result of adding something to this string.
+24 |         x = x + ".";
    |         ^^^^^^^^^^^
    |
 note: lint level defined here
@@ -31,7 +31,7 @@ note: lint level defined here
 error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead
   --> $DIR/strings.rs:38:9
    |
-38 |         x = x + "."; //~ERROR you assigned the result of adding something to this string.
+38 |         x = x + ".";
    |         ^^^^^^^^^^^
    |
 note: lint level defined here
@@ -43,7 +43,7 @@ note: lint level defined here
 error: you added something to a string. Consider using `String::push_str()` instead
   --> $DIR/strings.rs:42:13
    |
-42 |     let z = y + "..."; //~ERROR you added something to a string.
+42 |     let z = y + "...";
    |             ^^^^^^^^^
    |
 note: lint level defined here
index 0c99859c10d8c972b96250612eec2ea7ca25b1ad..922ab080d73c7390f60552244aa6f349edb20929 100644 (file)
@@ -5,10 +5,10 @@
 
 mod foo {
     pub fn foo() {}
-    pub fn foo_bar() {} //~ ERROR: item name starts with its containing module's name
-    pub fn bar_foo() {} //~ ERROR: item name ends with its containing module's name
-    pub struct FooCake {} //~ ERROR: item name starts with its containing module's name
-    pub enum CakeFoo {} //~ ERROR: item name ends with its containing module's name
+    pub fn foo_bar() {}
+    pub fn bar_foo() {}
+    pub struct FooCake {}
+    pub enum CakeFoo {}
 }
 
 fn main() {}
index 108fccb77f56a8e9f50271b8930ceb371dd353ad..03f4c7396b40767a18e3dd5e50ef2179b3ef19ee 100644 (file)
@@ -1,7 +1,7 @@
 error: item name starts with its containing module's name
  --> $DIR/stutter.rs:8:5
   |
-8 |     pub fn foo_bar() {} //~ ERROR: item name starts with its containing module's name
+8 |     pub fn foo_bar() {}
   |     ^^^^^^^^^^^^^^^^^^^
   |
 note: lint level defined here
@@ -13,19 +13,19 @@ note: lint level defined here
 error: item name ends with its containing module's name
  --> $DIR/stutter.rs:9:5
   |
-9 |     pub fn bar_foo() {} //~ ERROR: item name ends with its containing module's name
+9 |     pub fn bar_foo() {}
   |     ^^^^^^^^^^^^^^^^^^^
 
 error: item name starts with its containing module's name
   --> $DIR/stutter.rs:10:5
    |
-10 |     pub struct FooCake {} //~ ERROR: item name starts with its containing module's name
+10 |     pub struct FooCake {}
    |     ^^^^^^^^^^^^^^^^^^^^^
 
 error: item name ends with its containing module's name
   --> $DIR/stutter.rs:11:5
    |
-11 |     pub enum CakeFoo {} //~ ERROR: item name ends with its containing module's name
+11 |     pub enum CakeFoo {}
    |     ^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 4 previous errors
index 0e56d5ca86e62e8311ec9c82fa3eb45081df4ed8..95478dda0d32ea964463b03ef7b1853b4edbbfe8 100644 (file)
@@ -8,36 +8,36 @@
 
 fn array() {
     let mut foo = [1, 2];
-    let temp = foo[0]; //~ NOTE implied by
+    let temp = foo[0];
     foo[0] = foo[1];
     foo[1] = temp;
-    //~^^^ ERROR this looks like you are swapping elements of `foo` manually
-    //~| HELP try
-    //~| SUGGESTION foo.swap(0, 1);
+
+
+
 
     foo.swap(0, 1);
 }
 
 fn slice() {
     let foo = &mut [1, 2];
-    let temp = foo[0]; //~ NOTE implied by
+    let temp = foo[0];
     foo[0] = foo[1];
     foo[1] = temp;
-    //~^^^ ERROR this looks like you are swapping elements of `foo` manually
-    //~| HELP try
-    //~| SUGGESTION foo.swap(0, 1);
+
+
+
 
     foo.swap(0, 1);
 }
 
 fn vec() {
     let mut foo = vec![1, 2];
-    let temp = foo[0]; //~ NOTE implied by
+    let temp = foo[0];
     foo[0] = foo[1];
     foo[1] = temp;
-    //~^^^ ERROR this looks like you are swapping elements of `foo` manually
-    //~| HELP try
-    //~| SUGGESTION foo.swap(0, 1);
+
+
+
 
     foo.swap(0, 1);
 }
@@ -50,35 +50,35 @@ fn main() {
     let mut a = 42;
     let mut b = 1337;
 
-    a = b; //~ NOTE implied by
+    a = b;
     b = a;
-    //~^^ ERROR this looks like you are trying to swap `a` and `b`
-    //~| HELP try
-    //~| SUGGESTION std::mem::swap(&mut a, &mut b);
-    //~| NOTE or maybe you should use `std::mem::replace`?
 
-    ; let t = a; //~ NOTE implied by
+
+
+
+
+    ; let t = a;
     a = b;
     b = t;
-    //~^^^ ERROR this looks like you are swapping `a` and `b` manually
-    //~| HELP try
-    //~| SUGGESTION ; std::mem::swap(&mut a, &mut b);
-    //~| NOTE or maybe you should use `std::mem::replace`?
+
+
+
+
 
     let mut c = Foo(42);
 
-    c.0 = a; //~ NOTE implied by
+    c.0 = a;
     a = c.0;
-    //~^^ ERROR this looks like you are trying to swap `c.0` and `a`
-    //~| HELP try
-    //~| SUGGESTION std::mem::swap(&mut c.0, &mut a);
-    //~| NOTE or maybe you should use `std::mem::replace`?
 
-    ; let t = c.0; //~ NOTE implied by
+
+
+
+
+    ; let t = c.0;
     c.0 = a;
     a = t;
-    //~^^^ ERROR this looks like you are swapping `c.0` and `a` manually
-    //~| HELP try
-    //~| SUGGESTION ; std::mem::swap(&mut c.0, &mut a);
-    //~| NOTE or maybe you should use `std::mem::replace`?
+
+
+
+
 }
index f4fd80ec9ca9d2169363d1951689c621caeafe25..714b6859ffd10ae55d15d2d4381232495f3b4590 100644 (file)
@@ -1,7 +1,7 @@
 error: this looks like you are swapping elements of `foo` manually
   --> $DIR/swap.rs:11:5
    |
-11 |       let temp = foo[0]; //~ NOTE implied by
+11 |       let temp = foo[0];
    |  _____^ starting here...
 12 | |     foo[0] = foo[1];
 13 | |     foo[1] = temp;
@@ -19,7 +19,7 @@ help: try
 error: this looks like you are swapping elements of `foo` manually
   --> $DIR/swap.rs:23:5
    |
-23 |       let temp = foo[0]; //~ NOTE implied by
+23 |       let temp = foo[0];
    |  _____^ starting here...
 24 | |     foo[0] = foo[1];
 25 | |     foo[1] = temp;
@@ -32,7 +32,7 @@ help: try
 error: this looks like you are swapping elements of `foo` manually
   --> $DIR/swap.rs:35:5
    |
-35 |       let temp = foo[0]; //~ NOTE implied by
+35 |       let temp = foo[0];
    |  _____^ starting here...
 36 | |     foo[0] = foo[1];
 37 | |     foo[1] = temp;
@@ -45,7 +45,7 @@ help: try
 error: this looks like you are swapping `a` and `b` manually
   --> $DIR/swap.rs:60:7
    |
-60 |       ; let t = a; //~ NOTE implied by
+60 |       ; let t = a;
    |  _______^ starting here...
 61 | |     a = b;
 62 | |     b = t;
@@ -59,7 +59,7 @@ help: try
 error: this looks like you are swapping `c.0` and `a` manually
   --> $DIR/swap.rs:77:7
    |
-77 |       ; let t = c.0; //~ NOTE implied by
+77 |       ; let t = c.0;
    |  _______^ starting here...
 78 | |     c.0 = a;
 79 | |     a = t;
@@ -73,7 +73,7 @@ help: try
 error: this looks like you are trying to swap `a` and `b`
   --> $DIR/swap.rs:53:5
    |
-53 |       a = b; //~ NOTE implied by
+53 |       a = b;
    |  _____^ starting here...
 54 | |     b = a;
    | |_________^ ...ending here
@@ -91,7 +91,7 @@ help: try
 error: this looks like you are trying to swap `c.0` and `a`
   --> $DIR/swap.rs:70:5
    |
-70 |       c.0 = a; //~ NOTE implied by
+70 |       c.0 = a;
    |  _____^ starting here...
 71 | |     a = c.0;
    | |___________^ ...ending here
index b1c2b990024f2a8e165b63965e079f2edb930f28..752d897d014454fdb50e42254b30ec30131dfc9f 100644 (file)
@@ -26,8 +26,8 @@ fn main() {
     let mut s = Struct { field: 0 };
     let mut t = (0, 0);
 
-    Struct { field: 0 }.field = 1; //~ERROR assignment to temporary
-    (0, 0).0 = 1; //~ERROR assignment to temporary
+    Struct { field: 0 }.field = 1;
+    (0, 0).0 = 1;
 
     // no error
     s.field = 1;
index 953fd4e772acc854f82af40a43a32ac856f45514..ea39d798e2d85b6ba0986f9c1bcaefb408950553 100644 (file)
@@ -1,7 +1,7 @@
 error: assignment to temporary
   --> $DIR/temporary_assignment.rs:29:5
    |
-29 |     Struct { field: 0 }.field = 1; //~ERROR assignment to temporary
+29 |     Struct { field: 0 }.field = 1;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: assignment to temporary
   --> $DIR/temporary_assignment.rs:30:5
    |
-30 |     (0, 0).0 = 1; //~ERROR assignment to temporary
+30 |     (0, 0).0 = 1;
    |     ^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index 86459ea97961793364a48c5a5e0757f56e82def4..a69600899afaa9bb583b4c9e73b565a56ae752bf 100644 (file)
@@ -4,7 +4,7 @@
 #![deny(clippy)]
 #![allow(unused)]
 
-fn the_answer(ref mut x: u8) {  //~ ERROR `ref` directly on a function argument is ignored
+fn the_answer(ref mut x: u8) {
   *x = 42;
 }
 
@@ -16,24 +16,24 @@ fn main() {
   y(1u8);
 
   let ref x = 1;
-  //~^ ERROR `ref` on an entire `let` pattern is discouraged
-  //~| HELP try
-  //~| SUGGESTION let x = &1;
+
+
+
 
   let ref y: (&_, u8) = (&1, 2);
-  //~^ ERROR `ref` on an entire `let` pattern is discouraged
-  //~| HELP try
-  //~| SUGGESTION let y: &(&_, u8) = &(&1, 2);
+
+
+
 
   let ref z = 1 + 2;
-  //~^ ERROR `ref` on an entire `let` pattern is discouraged
-  //~| HELP try
-  //~| SUGGESTION let z = &(1 + 2);
+
+
+
 
   let ref mut z = 1 + 2;
-  //~^ ERROR `ref` on an entire `let` pattern is discouraged
-  //~| HELP try
-  //~| SUGGESTION let z = &mut (1 + 2);
+
+
+
 
   let (ref x, _) = (1,2); // okay, not top level
   println!("The answer is {}.", x);
index 3e3ec712cd3481e0324ac630195e344ddf893200..86dd880ed12789a142fde54b99a804efae3e1862 100644 (file)
@@ -1,7 +1,7 @@
 error: `ref` directly on a function argument is ignored. Consider using a reference type instead.
  --> $DIR/toplevel_ref_arg.rs:7:15
   |
-7 | fn the_answer(ref mut x: u8) {  //~ ERROR `ref` directly on a function argument is ignored
+7 | fn the_answer(ref mut x: u8) {
   |               ^^^^^^^^^
   |
   = note: #[deny(toplevel_ref_arg)] implied by #[deny(clippy)]
index c5ab854b05ae6c28ad6dd890341a48258993cd38..1fae47c8aa0483deaf4f34ff93154ece53ea2e25 100644 (file)
@@ -20,68 +20,68 @@ fn my_vec() -> MyVec<i32> {
 #[deny(useless_transmute)]
 unsafe fn _generic<'a, T, U: 'a>(t: &'a T) {
     let _: &'a T = core::intrinsics::transmute(t);
-    //~^ ERROR transmute from a type (`&'a T`) to itself
+
 
     let _: &'a U = core::intrinsics::transmute(t);
 
     let _: *const T = core::intrinsics::transmute(t);
-    //~^ ERROR transmute from a reference to a pointer
-    //~| HELP try
-    //~| SUGGESTION = t as *const T
+
+
+
 
     let _: *mut T = core::intrinsics::transmute(t);
-    //~^ ERROR transmute from a reference to a pointer
-    //~| HELP try
-    //~| SUGGESTION = t as *const T as *mut T
+
+
+
 
     let _: *const U = core::intrinsics::transmute(t);
-    //~^ ERROR transmute from a reference to a pointer
-    //~| HELP try
-    //~| SUGGESTION = t as *const T as *const U
+
+
+
 }
 
 #[deny(transmute_ptr_to_ref)]
 unsafe fn _ptr_to_ref<T, U>(p: *const T, m: *mut T, o: *const U, om: *mut U) {
     let _: &T = std::mem::transmute(p);
-    //~^ ERROR transmute from a pointer type (`*const T`) to a reference type (`&T`)
-    //~| HELP try
-    //~| SUGGESTION = &*p;
+
+
+
     let _: &T = &*p;
 
     let _: &mut T = std::mem::transmute(m);
-    //~^ ERROR transmute from a pointer type (`*mut T`) to a reference type (`&mut T`)
-    //~| HELP try
-    //~| SUGGESTION = &mut *m;
+
+
+
     let _: &mut T = &mut *m;
 
     let _: &T = std::mem::transmute(m);
-    //~^ ERROR transmute from a pointer type (`*mut T`) to a reference type (`&T`)
-    //~| HELP try
-    //~| SUGGESTION = &*m;
+
+
+
     let _: &T = &*m;
 
     let _: &mut T = std::mem::transmute(p as *mut T);
-    //~^ ERROR transmute from a pointer type (`*mut T`) to a reference type (`&mut T`)
-    //~| HELP try
-    //~| SUGGESTION = &mut *(p as *mut T);
+
+
+
     let _ = &mut *(p as *mut T);
 
     let _: &T = std::mem::transmute(o);
-    //~^ ERROR transmute from a pointer type (`*const U`) to a reference type (`&T`)
-    //~| HELP try
-    //~| SUGGESTION = &*(o as *const T);
+
+
+
     let _: &T = &*(o as *const T);
 
     let _: &mut T = std::mem::transmute(om);
-    //~^ ERROR transmute from a pointer type (`*mut U`) to a reference type (`&mut T`)
-    //~| HELP try
-    //~| SUGGESTION = &mut *(om as *mut T);
+
+
+
     let _: &mut T = &mut *(om as *mut T);
 
     let _: &T = std::mem::transmute(om);
-    //~^ ERROR transmute from a pointer type (`*mut U`) to a reference type (`&T`)
-    //~| HELP try
-    //~| SUGGESTION = &*(om as *const T);
+
+
+
     let _: &T = &*(om as *const T);
 }
 
@@ -93,40 +93,40 @@ struct Foo<'a, T: 'a> {
 
     let raw = 0 as *const i32;
     let _: &Foo<u8> = unsafe { std::mem::transmute::<_, &Foo<_>>(raw) };
-    //~^ ERROR transmute from a pointer type
-    //~| HELP try
-    //~| SUGGESTION unsafe { &*(raw as *const Foo<_>) };
+
+
+
 
     let _: &Foo<&u8> = unsafe { std::mem::transmute::<_, &Foo<&_>>(raw) };
-    //~^ ERROR transmute from a pointer type
-    //~| HELP try
-    //~| SUGGESTION unsafe { &*(raw as *const Foo<&_>) };
+
+
+
 
     type Bar<'a> = &'a u8;
     let raw = 0 as *const i32;
     unsafe { std::mem::transmute::<_, Bar>(raw) };
-    //~^ ERROR transmute from a pointer type
-    //~| HELP try
-    //~| SUGGESTION unsafe { &*(raw as *const u8) };
+
+
+
 }
 
 #[deny(useless_transmute)]
 fn useless() {
     unsafe {
         let _: Vec<i32> = core::intrinsics::transmute(my_vec());
-        //~^ ERROR transmute from a type (`std::vec::Vec<i32>`) to itself
+
 
         let _: Vec<i32> = core::mem::transmute(my_vec());
-        //~^ ERROR transmute from a type (`std::vec::Vec<i32>`) to itself
+
 
         let _: Vec<i32> = std::intrinsics::transmute(my_vec());
-        //~^ ERROR transmute from a type (`std::vec::Vec<i32>`) to itself
+
 
         let _: Vec<i32> = std::mem::transmute(my_vec());
-        //~^ ERROR transmute from a type (`std::vec::Vec<i32>`) to itself
+
 
         let _: Vec<i32> = my_transmute(my_vec());
-        //~^ ERROR transmute from a type (`std::vec::Vec<i32>`) to itself
+
 
         let _: Vec<u32> = core::intrinsics::transmute(my_vec());
         let _: Vec<u32> = core::mem::transmute(my_vec());
@@ -135,15 +135,15 @@ fn useless() {
         let _: Vec<u32> = my_transmute(my_vec());
 
         let _: *const usize = std::mem::transmute(5_isize);
-        //~^ ERROR transmute from an integer to a pointer
-        //~| HELP try
-        //~| SUGGESTION 5_isize as *const usize
+
+
+
         let _  = 5_isize as *const usize;
 
         let _: *const usize = std::mem::transmute(1+1usize);
-        //~^ ERROR transmute from an integer to a pointer
-        //~| HELP try
-        //~| SUGGESTION (1+1usize) as *const usize
+
+
+
         let _  = (1+1_usize) as *const usize;
     }
 }
@@ -158,16 +158,16 @@ fn crosspointer() {
 
     unsafe {
         let _: Usize = core::intrinsics::transmute(int_const_ptr);
-        //~^ ERROR transmute from a type (`*const Usize`) to the type that it points to (`Usize`)
+
 
         let _: Usize = core::intrinsics::transmute(int_mut_ptr);
-        //~^ ERROR transmute from a type (`*mut Usize`) to the type that it points to (`Usize`)
+
 
         let _: *const Usize = core::intrinsics::transmute(my_int());
-        //~^ ERROR transmute from a type (`Usize`) to a pointer to that type (`*const Usize`)
+
 
         let _: *mut Usize = core::intrinsics::transmute(my_int());
-        //~^ ERROR transmute from a type (`Usize`) to a pointer to that type (`*mut Usize`)
+
     }
 }
 
index 1368ab5015d8f7e07bbd2dc76ce160698b5355f8..9c63a6fe0d9084a4509a9ad26b5a757362123c06 100644 (file)
@@ -6,15 +6,15 @@
 fn main() {
     unsafe {
         let _: *const usize = std::mem::transmute(6.0f32);
-        //~^ ERROR transmute from a `f32` to a pointer
+
 
         let _: *mut usize = std::mem::transmute(6.0f32);
-        //~^ ERROR transmute from a `f32` to a pointer
+
 
         let _: *const usize = std::mem::transmute('x');
-        //~^ ERROR transmute from a `char` to a pointer
+
 
         let _: *mut usize = std::mem::transmute('x');
-        //~^ ERROR transmute from a `char` to a pointer
+
     }
 }
index 8bc6a2367b91cc908d8fb51c820a2a194778603e..bf7066245a1f7c49e5bc93cef8003617d4090b22 100644 (file)
@@ -7,9 +7,9 @@
 fn main() {
     unsafe {
         let _: *const usize = std::mem::transmute(6.0f64);
-        //~^ ERROR transmute from a `f64` to a pointer
+
 
         let _: *mut usize = std::mem::transmute(6.0f64);
-        //~^ ERROR transmute from a `f64` to a pointer
+
     }
 }
index e55a0390ff324cf80478bc1116f771ab40673f7b..a12276b9851eb707a5c7d8d382ec519be07e54ad 100644 (file)
@@ -4,19 +4,19 @@
 #[deny(zero_width_space)]
 fn zero() {
     print!("Here >​< is a ZWS, and ​another");
-               //~^ ERROR zero-width space detected
+
     print!("This\u{200B}is\u{200B}fine");
 }
 
 #[deny(unicode_not_nfc)]
 fn canon() {
-    print!("̀àh?"); //~ERROR non-nfc unicode sequence detected
+    print!("̀àh?");
     print!("a\u{0300}h?"); // also okay
 }
 
 #[deny(non_ascii_literal)]
 fn uni() {
-    print!("Üben!"); //~ERROR literal non-ASCII character detected
+    print!("Üben!");
     print!("\u{DC}ben!"); // this is okay
 }
 
index b8ecb7c460fb1b1230e13b1b27e355bfc39c3b83..407220d1ae0773d340abf641e827685b78ba1ac6 100644 (file)
@@ -11,7 +11,7 @@ error: zero-width space detected
 error: non-nfc unicode sequence detected
   --> $DIR/unicode.rs:13:12
    |
-13 |     print!("̀àh?"); //~ERROR non-nfc unicode sequence detected
+13 |     print!("̀àh?");
    |            ^^^^^^^
    |
 note: lint level defined here
@@ -25,7 +25,7 @@ note: lint level defined here
 error: literal non-ASCII character detected
   --> $DIR/unicode.rs:19:12
    |
-19 |     print!("Üben!"); //~ERROR literal non-ASCII character detected
+19 |     print!("Üben!");
    |            ^^^^^^^
    |
 note: lint level defined here
index 13095ee6bfb4191e547f76c65cce4c142187fcd9..d5176a5eaca51b7e372db0d9d09b6226c4eb7757 100644 (file)
@@ -13,9 +13,9 @@ fn main() {
     }
 
     // this warns
-    if { true; } == { false; } {  //~ERROR ==-comparison of unit values detected. This will always be true
+    if { true; } == { false; } {
     }
 
-    if { true; } > { false; } {  //~ERROR >-comparison of unit values detected. This will always be false
+    if { true; } > { false; } {
     }
 }
index a35c04b4998a9cfd0c7e81a779239a5d64cebb6f..fa5f108fad8ceb533a178788b2b05db2c1a0ac24 100644 (file)
@@ -1,7 +1,7 @@
 error: ==-comparison of unit values detected. This will always be true
   --> $DIR/unit_cmp.rs:16:8
    |
-16 |     if { true; } == { false; } {  //~ERROR ==-comparison of unit values detected. This will always be true
+16 |     if { true; } == { false; } {
    |        ^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: >-comparison of unit values detected. This will always be false
   --> $DIR/unit_cmp.rs:19:8
    |
-19 |     if { true; } > { false; } {  //~ERROR >-comparison of unit values detected. This will always be false
+19 |     if { true; } > { false; } {
    |        ^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index 9c7623d85b7105d5ee5c201b12ea5321c04eb529..9c1661e99ce7a63e03e234a5e7450a07af4ebe87 100644 (file)
@@ -14,10 +14,10 @@ fn main() {
     let f = Foo { a: 0, b: 0, c: 0 };
 
     match f {
-        Foo { a: _, b: 0, .. } => {} //~ERROR You matched a field with a wildcard pattern
-                                     //~^ HELP Try with `Foo { b: 0, .. }`
-        Foo { a: _, b: _, c: _ } => {} //~ERROR All the struct fields are matched to a
-                                       //~^ HELP Try with `Foo { .. }`
+        Foo { a: _, b: 0, .. } => {}
+
+        Foo { a: _, b: _, c: _ } => {}
+
     }
     match f {
         Foo { b: 0, .. } => {} // should be OK
index cb721a2d6943f615fdd0a10e472d93a9da35ad68..fdf976fd5194040f4f98aaca55b3cde53fc0dcdd 100644 (file)
@@ -1,7 +1,7 @@
 error: You matched a field with a wildcard pattern. Consider using `..` instead
   --> $DIR/unneeded_field_pattern.rs:17:15
    |
-17 |         Foo { a: _, b: 0, .. } => {} //~ERROR You matched a field with a wildcard pattern
+17 |         Foo { a: _, b: 0, .. } => {}
    |               ^^^^
    |
 note: lint level defined here
@@ -14,7 +14,7 @@ note: lint level defined here
 error: All the struct fields are matched to a wildcard pattern, consider using `..`.
   --> $DIR/unneeded_field_pattern.rs:19:9
    |
-19 |         Foo { a: _, b: _, c: _ } => {} //~ERROR All the struct fields are matched to a
+19 |         Foo { a: _, b: _, c: _ } => {}
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: Try with `Foo { .. }` instead
index 3e5f6e58c90a3fc77037638ad7c65aa40502dc92..7ff20223bd2c376ca80e79b122eb0b38b3dc7967 100644 (file)
@@ -5,10 +5,10 @@
 #![deny(unsafe_removed_from_name)]
 
 use std::cell::{UnsafeCell as TotallySafeCell};
-//~^ ERROR removed "unsafe" from the name of `UnsafeCell` in use as `TotallySafeCell`
+
 
 use std::cell::UnsafeCell as TotallySafeCellAgain;
-//~^ ERROR removed "unsafe" from the name of `UnsafeCell` in use as `TotallySafeCellAgain`
+
 
 // Shouldn't error
 use std::cell::{UnsafeCell as SuperDangerousUnsafeCell};
@@ -23,7 +23,7 @@ pub struct Unsafe {}
 }
 
 use mod_with_some_unsafe_things::Unsafe as LieAboutModSafety;
-//~^ ERROR removed "unsafe" from the name of `Unsafe` in use as `LieAboutModSafety`
+
 
 // Shouldn't error
 use mod_with_some_unsafe_things::Safe as IPromiseItsSafeThisTime;
index 2e63705c5107cb5028408f343a9254813ca9325a..7456a3602d664a657879adbc89617a39be136821 100644 (file)
@@ -15,19 +15,19 @@ fn try_macro<T: io::Read + io::Write>(s: &mut T) -> io::Result<()> {
 
 fn question_mark<T: io::Read + io::Write>(s: &mut T) -> io::Result<()> {
     s.write(b"test")?;
-    //~^ ERROR handle written amount returned
+
     let mut buf = [0u8; 4];
     s.read(&mut buf)?;
-    //~^ ERROR handle read amount returned
+
     Ok(())
 }
 
 fn unwrap<T: io::Read + io::Write>(s: &mut T) {
     s.write(b"test").unwrap();
-    //~^ ERROR handle written amount returned
+
     let mut buf = [0u8; 4];
     s.read(&mut buf).unwrap();
-    //~^ ERROR handle read amount returned
+
 }
 
 fn main() {
index 26b4d4a2f3b28bd506bfd8ab026eded811a05d51..ce718c4903a1c825358fed87a2e07f79a8617342 100644 (file)
@@ -5,7 +5,7 @@
 #![deny(unused_label)]
 
 fn unused_label() {
-    'label: for i in 1..2 { //~ERROR: unused label `'label`
+    'label: for i in 1..2 {
         if i > 4 { continue }
     }
 }
@@ -18,7 +18,7 @@ fn foo() {
 
 
 fn bla() {
-    'a: loop { break } //~ERROR: unused label `'a`
+    'a: loop { break }
     fn blub() {}
 }
 
@@ -29,7 +29,7 @@ fn main() {
         }
     }
 
-    'same_label_in_two_fns: loop { //~ERROR: unused label `'same_label_in_two_fns`
+    'same_label_in_two_fns: loop {
         let _ = 1;
     }
 }
index 280ea148cf2389c642aac235ec4f1708c33038e7..7b124477ded0c68087677c9b2d963d057cd0f925 100644 (file)
@@ -1,7 +1,7 @@
 error: unused label `'label`
   --> $DIR/unused_labels.rs:8:5
    |
-8  |       'label: for i in 1..2 { //~ERROR: unused label `'label`
+8  |       'label: for i in 1..2 {
    |  _____^ starting here...
 9  | |         if i > 4 { continue }
 10 | |     }
@@ -16,13 +16,13 @@ note: lint level defined here
 error: unused label `'a`
   --> $DIR/unused_labels.rs:21:5
    |
-21 |     'a: loop { break } //~ERROR: unused label `'a`
+21 |     'a: loop { break }
    |     ^^^^^^^^^^^^^^^^^^
 
 error: unused label `'same_label_in_two_fns`
   --> $DIR/unused_labels.rs:32:5
    |
-32 |       'same_label_in_two_fns: loop { //~ERROR: unused label `'same_label_in_two_fns`
+32 |       'same_label_in_two_fns: loop {
    |  _____^ starting here...
 33 | |         let _ = 1;
 34 | |     }
index 19502720993b641a5be782c161d6cb8dc364d60f..ec44420a376e5c1bc403077d8a2a2e0d6220f93c 100644 (file)
@@ -13,11 +13,11 @@ fn used_lt<'a>(x: &'a u8) {
 }
 
 
-fn unused_lt<'a>(x: u8) { //~ ERROR this lifetime
+fn unused_lt<'a>(x: u8) {
 
 }
 
-fn unused_lt_transitive<'a, 'b: 'a>(x: &'b u8) { //~ ERROR this lifetime
+fn unused_lt_transitive<'a, 'b: 'a>(x: &'b u8) {
     // 'a is useless here since it's not directly bound
 }
 
@@ -47,7 +47,7 @@ fn x(&self, a: &'a u8) {
 struct Bar;
 
 impl Bar {
-    fn x<'a>(&self) {} //~ ERROR this lifetime
+    fn x<'a>(&self) {}
 }
 
 // test for #489 (used lifetimes in bounds)
index 1df4e285f7a9abf6a62d1f4f23546cd7ec0cf073..1e13f4c80b4fda7c37962b7efe1a6f69774d34ff 100644 (file)
@@ -1,7 +1,7 @@
 error: this lifetime isn't used in the function definition
   --> $DIR/unused_lt.rs:16:14
    |
-16 | fn unused_lt<'a>(x: u8) { //~ ERROR this lifetime
+16 | fn unused_lt<'a>(x: u8) {
    |              ^^
    |
 note: lint level defined here
@@ -13,13 +13,13 @@ note: lint level defined here
 error: this lifetime isn't used in the function definition
   --> $DIR/unused_lt.rs:20:25
    |
-20 | fn unused_lt_transitive<'a, 'b: 'a>(x: &'b u8) { //~ ERROR this lifetime
+20 | fn unused_lt_transitive<'a, 'b: 'a>(x: &'b u8) {
    |                         ^^
 
 error: this lifetime isn't used in the function definition
   --> $DIR/unused_lt.rs:50:10
    |
-50 |     fn x<'a>(&self) {} //~ ERROR this lifetime
+50 |     fn x<'a>(&self) {}
    |          ^^
 
 error: aborting due to 3 previous errors
index c3700d1b1cd430108ac7e7439443505195509c2e..fe0db6346ca3b7cfdd31398548c30e0391e28275 100644 (file)
@@ -14,16 +14,16 @@ macro_rules! test_macro {
 
 /// Test that we lint if we use a binding with a single leading underscore
 fn prefix_underscore(_foo: u32) -> u32 {
-    _foo + 1 //~ ERROR used binding `_foo` which is prefixed with an underscore
+    _foo + 1
 }
 
 /// Test that we lint if we use a `_`-variable defined outside within a macro expansion
 fn in_macro(_foo: u32) {
     println!("{}", _foo);
-    //~^ ERROR used binding `_foo` which is prefixed with an underscore
+
     assert_eq!(_foo, _foo);
-    //~^ ERROR used binding `_foo` which is prefixed with an underscore
-    //~| ERROR used binding `_foo` which is prefixed with an underscore
+
+
 
     test_macro!() + 1;
 }
@@ -36,7 +36,7 @@ struct StructFieldTest {
 /// Test that we lint the use of a struct field which is prefixed with an underscore
 fn in_struct_field() {
     let mut s = StructFieldTest { _underscore_field: 0 };
-    s._underscore_field += 1; //~ Error used binding `_underscore_field` which is prefixed with an underscore
+    s._underscore_field += 1;
 }
 
 /// Test that we do not lint if the underscore is not a prefix
index 5377698a6b8a9db38457acac4097912c65628aa9..35179ac37035329dc4370cade18637989491febf 100644 (file)
@@ -1,7 +1,7 @@
 error: used binding `_foo` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
   --> $DIR/used_underscore_binding.rs:17:5
    |
-17 |     _foo + 1 //~ ERROR used binding `_foo` which is prefixed with an underscore
+17 |     _foo + 1
    |     ^^^^
    |
 note: lint level defined here
@@ -31,7 +31,7 @@ error: used binding `_foo` which is prefixed with an underscore. A leading under
 error: used binding `_underscore_field` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
   --> $DIR/used_underscore_binding.rs:39:5
    |
-39 |     s._underscore_field += 1; //~ Error used binding `_underscore_field` which is prefixed with an underscore
+39 |     s._underscore_field += 1;
    |     ^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 5 previous errors
index de3896f091b4b55b9fbb1cc5a66edcaad6f075be..2b8a4cf56d7f1799b5a8a3979ad484fbe5930b11 100644 (file)
@@ -2,9 +2,9 @@
 #![plugin(clippy)]
 #![deny(useless_attribute)]
 
-#[allow(dead_code)] //~ ERROR useless lint attribute
-//~| HELP if you just forgot a `!`, use
-//~| SUGGESTION #![allow(dead_code)]
+#[allow(dead_code)]
+
+
 extern crate clippy_lints;
 
 // don't lint on unused_import for `use` items
index a0a7936dc0b3fcaf3d0c26c8cb911f382cf8153d..05d3da4ca3ff68bcdf5cf0b058541c3e5114266b 100644 (file)
@@ -1,7 +1,7 @@
 error: useless lint attribute
  --> $DIR/useless_attribute.rs:5:1
   |
-5 | #[allow(dead_code)] //~ ERROR useless lint attribute
+5 | #[allow(dead_code)]
   | ^^^^^^^^^^^^^^^^^^^
   |
 note: lint level defined here
@@ -10,7 +10,7 @@ note: lint level defined here
 3 | #![deny(useless_attribute)]
   |         ^^^^^^^^^^^^^^^^^
 help: if you just forgot a `!`, use
-  | #![allow(dead_code)] //~ ERROR useless lint attribute
+  | #![allow(dead_code)]
 
 error: aborting due to previous error
 
index 7a790e62116123f77bed1795d96568c3cebb142f..3717192fb9813e6ffb7e7cf36582c728225d93a1 100644 (file)
@@ -22,33 +22,33 @@ fn length(&self) -> usize {
 
 fn main() {
     on_slice(&vec![]);
-    //~^ ERROR useless use of `vec!`
-    //~| HELP you can use
-    //~| SUGGESTION on_slice(&[])
+
+
+
     on_slice(&[]);
 
     on_slice(&vec![1, 2]);
-    //~^ ERROR useless use of `vec!`
-    //~| HELP you can use
-    //~| SUGGESTION on_slice(&[1, 2])
+
+
+
     on_slice(&[1, 2]);
 
     on_slice(&vec ![1, 2]);
-    //~^ ERROR useless use of `vec!`
-    //~| HELP you can use
-    //~| SUGGESTION on_slice(&[1, 2])
+
+
+
     on_slice(&[1, 2]);
 
     on_slice(&vec!(1, 2));
-    //~^ ERROR useless use of `vec!`
-    //~| HELP you can use
-    //~| SUGGESTION on_slice(&[1, 2])
+
+
+
     on_slice(&[1, 2]);
 
     on_slice(&vec![1; 2]);
-    //~^ ERROR useless use of `vec!`
-    //~| HELP you can use
-    //~| SUGGESTION on_slice(&[1; 2])
+
+
+
     on_slice(&[1; 2]);
 
     on_vec(&vec![]);
@@ -62,9 +62,9 @@ fn main() {
     on_slice(&vec![2; line.length()]);
 
     for a in vec![1, 2, 3] {
-        //~^ ERROR useless use of `vec!`
-        //~| HELP you can use
-        //~| SUGGESTION for a in &[1, 2, 3] {
+
+
+
         println!("{:?}", a);
     }
 
index 7b0fb43575eeadd097dbfefe5ae3b8ad6908032c..2b75e5b83e8f21cc5372c2ea7a4d706510bf21a8 100644 (file)
@@ -7,9 +7,9 @@
 fn main() {
     let y = Some(true);
     loop {
-    //~^ERROR this loop could be written as a `while let` loop
-    //~|HELP try
-    //~|SUGGESTION while let Some(_x) = y {
+
+
+
         if let Some(_x) = y {
             let _v = 1;
         } else {
@@ -23,18 +23,18 @@ fn main() {
         break;
     }
     loop {
-    //~^ERROR this loop could be written as a `while let` loop
-    //~|HELP try
-    //~|SUGGESTION while let Some(_x) = y {
+
+
+
         match y {
             Some(_x) => true,
             None => break
         };
     }
     loop {
-    //~^ERROR this loop could be written as a `while let` loop
-    //~|HELP try
-    //~|SUGGESTION while let Some(x) = y {
+
+
+
         let x = match y {
             Some(x) => x,
             None => break
@@ -43,9 +43,9 @@ fn main() {
         let _str = "foo";
     }
     loop {
-    //~^ERROR this loop could be written as a `while let` loop
-    //~|HELP try
-    //~|SUGGESTION while let Some(x) = y {
+
+
+
         let x = match y {
             Some(x) => x,
             None => break,
@@ -68,9 +68,9 @@ fn main() {
 
     // #675, this used to have a wrong suggestion
     loop {
-    //~^ERROR this loop could be written as a `while let` loop
-    //~|HELP try
-    //~|SUGGESTION while let Some(word) = "".split_whitespace().next() { .. }
+
+
+
         let (e, l) = match "".split_whitespace().next() {
             Some(word) => (word.is_empty(), word.len()),
             None => break
@@ -81,25 +81,25 @@ fn main() {
 
     let mut iter = 1..20;
     while let Option::Some(x) = iter.next() {
-    //~^ ERROR this loop could be written as a `for` loop
-    //~| HELP try
-    //~| SUGGESTION for x in iter {
+
+
+
         println!("{}", x);
     }
 
     let mut iter = 1..20;
     while let Some(x) = iter.next() {
-    //~^ ERROR this loop could be written as a `for` loop
-    //~| HELP try
-    //~| SUGGESTION for x in iter {
+
+
+
         println!("{}", x);
     }
 
     let mut iter = 1..20;
     while let Some(_) = iter.next() {}
-    //~^ ERROR this loop could be written as a `for` loop
-    //~| HELP try
-    //~| SUGGESTION for _ in iter {
+
+
+
 
     let mut iter = 1..20;
     while let None = iter.next() {} // this is fine (if nonsensical)
@@ -140,14 +140,14 @@ fn main() {
 fn no_panic<T>(slice: &[T]) {
     let mut iter = slice.iter();
     loop {
-    //~^ ERROR
-    //~| HELP try
-    //~| SUGGESTION while let Some(ele) = iter.next() { .. }
+
+
+
         let _ = match iter.next() {
             Some(ele) => ele,
             None => break
         };
-        loop {} //~ERROR empty `loop {}` detected.
+        loop {}
     }
 }
 
index 46f0260879a0b6b3c4fdb0fb9776c7e2e2f21268..a3bb0c34f3126bf0d6db86e928d172805c57eae4 100644 (file)
@@ -17,9 +17,9 @@ error: this loop could be written as a `while let` loop
    |
 25 |       loop {
    |  _____^ starting here...
-26 | |     //~^ERROR this loop could be written as a `while let` loop
-27 | |     //~|HELP try
-28 | |     //~|SUGGESTION while let Some(_x) = y {
+26 | |
+27 | |
+28 | |
 29 | |         match y {
 30 | |             Some(_x) => true,
 31 | |             None => break
@@ -62,9 +62,9 @@ error: this loop could be written as a `for` loop
    |
 83 |       while let Option::Some(x) = iter.next() {
    |  _____^ starting here...
-84 | |     //~^ ERROR this loop could be written as a `for` loop
-85 | |     //~| HELP try
-86 | |     //~| SUGGESTION for x in iter {
+84 | |
+85 | |
+86 | |
 87 | |         println!("{}", x);
 88 | |     }
    | |_____^ ...ending here
@@ -82,9 +82,9 @@ error: this loop could be written as a `for` loop
    |
 91 |       while let Some(x) = iter.next() {
    |  _____^ starting here...
-92 | |     //~^ ERROR this loop could be written as a `for` loop
-93 | |     //~| HELP try
-94 | |     //~| SUGGESTION for x in iter {
+92 | |
+93 | |
+94 | |
 95 | |         println!("{}", x);
 96 | |     }
    | |_____^ ...ending here
@@ -113,7 +113,7 @@ help: try
 error: empty `loop {}` detected. You may want to either use `panic!()` or add `std::thread::sleep(..);` to the loop body.
    --> $DIR/while_loop.rs:150:9
     |
-150 |         loop {} //~ERROR empty `loop {}` detected.
+150 |         loop {}
     |         ^^^^^^^
     |
 note: lint level defined here
index f22efd810f8382c5842f8f4edf4dc4a6e93cd894..fcacb030b850745f69b6518cb31ef95ca8960310 100644 (file)
@@ -19,9 +19,9 @@ fn main() {
             let t = &thingy;
 
             match t.$idx { Foo::A(ref val) => { println!("42"); }, _ => {} }
-            //~^ ERROR you seem to be trying to use match
-            //~| HELP try this
-            //~| SUGGESTION if let Foo::A(ref val) = t.$idx { println!("42"); }
+
+
+
         }}
     }
 
index d22648c0cdba93c00f6257c36f50e5ca969c3ea2..8e81679aaab299c1ca2835ff4c4dd06712ae4c44 100644 (file)
@@ -18,13 +18,13 @@ fn into_i32(self) {}
     fn is_i32(self) {}
     fn is_u32(&self) {}
     fn to_i32(self) {}
-    fn from_i32(self) {} //~ERROR: methods called `from_*` usually take no self
+    fn from_i32(self) {}
 
     pub fn as_i64(self) {}
     pub fn into_i64(self) {}
     pub fn is_i64(self) {}
     pub fn to_i64(self) {}
-    pub fn from_i64(self) {} //~ERROR: methods called `from_*` usually take no self
+    pub fn from_i64(self) {}
     // check whether the lint can be allowed at the function level
     #[allow(wrong_self_convention)]
     pub fn from_cake(self) {}
@@ -35,21 +35,21 @@ pub fn from_cake(self) {}
 
 impl Bar {
 
-    fn as_i32(self) {} //~ERROR: methods called `as_*` usually take self by reference
+    fn as_i32(self) {}
     fn as_u32(&self) {}
-    fn into_i32(&self) {} //~ERROR: methods called `into_*` usually take self by value
+    fn into_i32(&self) {}
     fn into_u32(self) {}
-    fn is_i32(self) {} //~ERROR: methods called `is_*` usually take self by reference
+    fn is_i32(self) {}
     fn is_u32(&self) {}
-    fn to_i32(self) {} //~ERROR: methods called `to_*` usually take self by reference
+    fn to_i32(self) {}
     fn to_u32(&self) {}
-    fn from_i32(self) {} //~ERROR: methods called `from_*` usually take no self
+    fn from_i32(self) {}
 
-    pub fn as_i64(self) {} //~ERROR: methods called `as_*` usually take self by reference
-    pub fn into_i64(&self) {} //~ERROR: methods called `into_*` usually take self by value
-    pub fn is_i64(self) {} //~ERROR: methods called `is_*` usually take self by reference
-    pub fn to_i64(self) {} //~ERROR: methods called `to_*` usually take self by reference
-    pub fn from_i64(self) {} //~ERROR: methods called `from_*` usually take no self
+    pub fn as_i64(self) {}
+    pub fn into_i64(&self) {}
+    pub fn is_i64(self) {}
+    pub fn to_i64(self) {}
+    pub fn from_i64(self) {}
 
     // test for false positives
     fn as_(self) {}
index 06781411b9e865a6bf4740db5481d183d8f1f01b..cbee5bd45a26adc085a2c32e3c9bd390d65b9fd5 100644 (file)
@@ -1,7 +1,7 @@
 error: methods called `from_*` usually take no self; consider choosing a less ambiguous name
   --> $DIR/wrong_self_convention.rs:21:17
    |
-21 |     fn from_i32(self) {} //~ERROR: methods called `from_*` usually take no self
+21 |     fn from_i32(self) {}
    |                 ^^^^
    |
 note: lint level defined here
@@ -13,67 +13,67 @@ note: lint level defined here
 error: methods called `from_*` usually take no self; consider choosing a less ambiguous name
   --> $DIR/wrong_self_convention.rs:27:21
    |
-27 |     pub fn from_i64(self) {} //~ERROR: methods called `from_*` usually take no self
+27 |     pub fn from_i64(self) {}
    |                     ^^^^
 
 error: methods called `as_*` usually take self by reference or self by mutable reference; consider choosing a less ambiguous name
   --> $DIR/wrong_self_convention.rs:38:15
    |
-38 |     fn as_i32(self) {} //~ERROR: methods called `as_*` usually take self by reference
+38 |     fn as_i32(self) {}
    |               ^^^^
 
 error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name
   --> $DIR/wrong_self_convention.rs:40:17
    |
-40 |     fn into_i32(&self) {} //~ERROR: methods called `into_*` usually take self by value
+40 |     fn into_i32(&self) {}
    |                 ^^^^^
 
 error: methods called `is_*` usually take self by reference or no self; consider choosing a less ambiguous name
   --> $DIR/wrong_self_convention.rs:42:15
    |
-42 |     fn is_i32(self) {} //~ERROR: methods called `is_*` usually take self by reference
+42 |     fn is_i32(self) {}
    |               ^^^^
 
 error: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name
   --> $DIR/wrong_self_convention.rs:44:15
    |
-44 |     fn to_i32(self) {} //~ERROR: methods called `to_*` usually take self by reference
+44 |     fn to_i32(self) {}
    |               ^^^^
 
 error: methods called `from_*` usually take no self; consider choosing a less ambiguous name
   --> $DIR/wrong_self_convention.rs:46:17
    |
-46 |     fn from_i32(self) {} //~ERROR: methods called `from_*` usually take no self
+46 |     fn from_i32(self) {}
    |                 ^^^^
 
 error: methods called `as_*` usually take self by reference or self by mutable reference; consider choosing a less ambiguous name
   --> $DIR/wrong_self_convention.rs:48:19
    |
-48 |     pub fn as_i64(self) {} //~ERROR: methods called `as_*` usually take self by reference
+48 |     pub fn as_i64(self) {}
    |                   ^^^^
 
 error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name
   --> $DIR/wrong_self_convention.rs:49:21
    |
-49 |     pub fn into_i64(&self) {} //~ERROR: methods called `into_*` usually take self by value
+49 |     pub fn into_i64(&self) {}
    |                     ^^^^^
 
 error: methods called `is_*` usually take self by reference or no self; consider choosing a less ambiguous name
   --> $DIR/wrong_self_convention.rs:50:19
    |
-50 |     pub fn is_i64(self) {} //~ERROR: methods called `is_*` usually take self by reference
+50 |     pub fn is_i64(self) {}
    |                   ^^^^
 
 error: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name
   --> $DIR/wrong_self_convention.rs:51:19
    |
-51 |     pub fn to_i64(self) {} //~ERROR: methods called `to_*` usually take self by reference
+51 |     pub fn to_i64(self) {}
    |                   ^^^^
 
 error: methods called `from_*` usually take no self; consider choosing a less ambiguous name
   --> $DIR/wrong_self_convention.rs:52:21
    |
-52 |     pub fn from_i64(self) {} //~ERROR: methods called `from_*` usually take no self
+52 |     pub fn from_i64(self) {}
    |                     ^^^^
 
 error: aborting due to 12 previous errors
index c422e83873b09b855f5c515cbc2ce3e552fc619a..6f126337246774d3836129863f620fffa58aafbc 100644 (file)
@@ -4,14 +4,14 @@
 #[allow(unused_variables)]
 #[deny(zero_divided_by_zero)]
 fn main() {
-    let nan = 0.0 / 0.0; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
-                         //~^ equal expressions as operands to `/`
-    let f64_nan = 0.0 / 0.0f64; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
-                         //~^ equal expressions as operands to `/`
-    let other_f64_nan = 0.0f64 / 0.0; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
-                         //~^ equal expressions as operands to `/`
-    let one_more_f64_nan = 0.0f64/0.0f64; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
-                         //~^ equal expressions as operands to `/`
+    let nan = 0.0 / 0.0;
+
+    let f64_nan = 0.0 / 0.0f64;
+
+    let other_f64_nan = 0.0f64 / 0.0;
+
+    let one_more_f64_nan = 0.0f64/0.0f64;
+
     let zero = 0.0;
     let other_zero = 0.0;
     let other_nan = zero / other_zero; // fine - this lint doesn't propegate constants.
index a28d47257a14d830399d4f04e51b2eda227dbe72..6b34e2da13ca05904ff778c11e6e33b189875ac0 100644 (file)
@@ -1,7 +1,7 @@
 warning: equal expressions as operands to `/`
  --> $DIR/zero_div_zero.rs:7:15
   |
-7 |     let nan = 0.0 / 0.0; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
+7 |     let nan = 0.0 / 0.0;
   |               ^^^^^^^^^
   |
   = note: #[warn(eq_op)] on by default
@@ -9,7 +9,7 @@ warning: equal expressions as operands to `/`
 error: constant division of 0.0 with 0.0 will always result in NaN
  --> $DIR/zero_div_zero.rs:7:15
   |
-7 |     let nan = 0.0 / 0.0; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
+7 |     let nan = 0.0 / 0.0;
   |               ^^^^^^^^^
   |
 note: lint level defined here
@@ -22,7 +22,7 @@ note: lint level defined here
 warning: equal expressions as operands to `/`
  --> $DIR/zero_div_zero.rs:9:19
   |
-9 |     let f64_nan = 0.0 / 0.0f64; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
+9 |     let f64_nan = 0.0 / 0.0f64;
   |                   ^^^^^^^^^^^^
   |
   = note: #[warn(eq_op)] on by default
@@ -30,7 +30,7 @@ warning: equal expressions as operands to `/`
 error: constant division of 0.0 with 0.0 will always result in NaN
  --> $DIR/zero_div_zero.rs:9:19
   |
-9 |     let f64_nan = 0.0 / 0.0f64; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
+9 |     let f64_nan = 0.0 / 0.0f64;
   |                   ^^^^^^^^^^^^
   |
   = help: Consider using `std::f64::NAN` if you would like a constant representing NaN
@@ -38,7 +38,7 @@ error: constant division of 0.0 with 0.0 will always result in NaN
 warning: equal expressions as operands to `/`
   --> $DIR/zero_div_zero.rs:11:25
    |
-11 |     let other_f64_nan = 0.0f64 / 0.0; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
+11 |     let other_f64_nan = 0.0f64 / 0.0;
    |                         ^^^^^^^^^^^^
    |
    = note: #[warn(eq_op)] on by default
@@ -46,7 +46,7 @@ warning: equal expressions as operands to `/`
 error: constant division of 0.0 with 0.0 will always result in NaN
   --> $DIR/zero_div_zero.rs:11:25
    |
-11 |     let other_f64_nan = 0.0f64 / 0.0; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
+11 |     let other_f64_nan = 0.0f64 / 0.0;
    |                         ^^^^^^^^^^^^
    |
    = help: Consider using `std::f64::NAN` if you would like a constant representing NaN
@@ -54,7 +54,7 @@ error: constant division of 0.0 with 0.0 will always result in NaN
 warning: equal expressions as operands to `/`
   --> $DIR/zero_div_zero.rs:13:28
    |
-13 |     let one_more_f64_nan = 0.0f64/0.0f64; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
+13 |     let one_more_f64_nan = 0.0f64/0.0f64;
    |                            ^^^^^^^^^^^^^
    |
    = note: #[warn(eq_op)] on by default
@@ -62,7 +62,7 @@ warning: equal expressions as operands to `/`
 error: constant division of 0.0 with 0.0 will always result in NaN
   --> $DIR/zero_div_zero.rs:13:28
    |
-13 |     let one_more_f64_nan = 0.0f64/0.0f64; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
+13 |     let one_more_f64_nan = 0.0f64/0.0f64;
    |                            ^^^^^^^^^^^^^
    |
    = help: Consider using `std::f64::NAN` if you would like a constant representing NaN