]> git.lizzy.rs Git - rust.git/commitdiff
Removed new_ret_no_self tests from method.rs
authorJosh Mcguigan <joshmcg88@gmail.com>
Fri, 5 Oct 2018 04:37:28 +0000 (21:37 -0700)
committerJosh Mcguigan <joshmcg88@gmail.com>
Sat, 13 Oct 2018 13:25:10 +0000 (06:25 -0700)
tests/ui/methods.rs
tests/ui/methods.stderr

index 883dbf589d785f58ebea950d724dd39340c9ee7b..ae1b1642be7ead7b12914cc2d618b95bd6efbd17 100644 (file)
@@ -14,7 +14,7 @@
 #![warn(clippy::all, clippy::pedantic, clippy::option_unwrap_used)]
 #![allow(clippy::blacklisted_name, unused, clippy::print_stdout, clippy::non_ascii_literal, clippy::new_without_default,
     clippy::new_without_default_derive, clippy::missing_docs_in_private_items, clippy::needless_pass_by_value,
-    clippy::default_trait_access, clippy::use_self, clippy::useless_format)]
+    clippy::default_trait_access, clippy::use_self, clippy::new_ret_no_self, clippy::useless_format)]
 
 use std::collections::BTreeMap;
 use std::collections::HashMap;
@@ -43,7 +43,7 @@ fn into_u16(&self) -> u16 { 0 }
 
     fn to_something(self) -> u32 { 0 }
 
-    fn new(self) {}
+    fn new(self) -> Self { unimplemented!(); }
 }
 
 struct Lt<'a> {
index 124edee6a5297a39e401c316742b265410e9a76c..307814824eaa3613c2ec8d48c640687d04b9218e 100644 (file)
@@ -23,17 +23,9 @@ error: methods called `to_*` usually take self by reference; consider choosing a
 error: methods called `new` usually take no self; consider choosing a less ambiguous name
   --> $DIR/methods.rs:46:12
    |
-46 |     fn new(self) {}
+46 |     fn new(self) -> Self { unimplemented!(); }
    |            ^^^^
 
-error: methods called `new` usually return `Self`
-  --> $DIR/methods.rs:46:5
-   |
-46 |     fn new(self) {}
-   |     ^^^^^^^^^^^^^^^
-   |
-   = note: `-D clippy::new-ret-no-self` implied by `-D warnings`
-
 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
    --> $DIR/methods.rs:114:13
     |
@@ -465,5 +457,5 @@ error: used unwrap() on an Option value. If you don't want to handle the None ca
     |
     = note: `-D clippy::option-unwrap-used` implied by `-D warnings`
 
-error: aborting due to 58 previous errors
+error: aborting due to 57 previous errors