Skip to content

Commit

Permalink
Removed new_ret_no_self tests from method.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshMcguigan committed Oct 9, 2018
1 parent 78722f9 commit f2d4cfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tests/ui/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::default_trait_access, clippy::use_self, clippy::new_ret_no_self)]

use std::collections::BTreeMap;
use std::collections::HashMap;
Expand Down Expand Up @@ -43,7 +43,7 @@ impl T {

fn to_something(self) -> u32 { 0 }

fn new(self) {}
fn new(self) -> Self { unimplemented!(); }
}

struct Lt<'a> {
Expand Down
12 changes: 2 additions & 10 deletions tests/ui/methods.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
|
Expand Down Expand Up @@ -453,5 +445,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 56 previous errors
error: aborting due to 55 previous errors

0 comments on commit f2d4cfe

Please sign in to comment.