Skip to content

Commit 348d18e

Browse files
committed
Removed new_ret_no_self tests from method.rs
1 parent a5e4805 commit 348d18e

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

tests/ui/methods.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#![warn(clippy::all, clippy::pedantic, clippy::option_unwrap_used)]
1515
#![allow(clippy::blacklisted_name, unused, clippy::print_stdout, clippy::non_ascii_literal, clippy::new_without_default,
1616
clippy::new_without_default_derive, clippy::missing_docs_in_private_items, clippy::needless_pass_by_value,
17-
clippy::default_trait_access, clippy::use_self, clippy::useless_format)]
17+
clippy::default_trait_access, clippy::use_self, clippy::new_ret_no_self, clippy::useless_format)]
1818

1919
use std::collections::BTreeMap;
2020
use std::collections::HashMap;
@@ -43,7 +43,7 @@ impl T {
4343

4444
fn to_something(self) -> u32 { 0 }
4545

46-
fn new(self) {}
46+
fn new(self) -> Self { unimplemented!(); }
4747
}
4848

4949
struct Lt<'a> {

tests/ui/methods.stderr

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,9 @@ error: methods called `to_*` usually take self by reference; consider choosing a
2323
error: methods called `new` usually take no self; consider choosing a less ambiguous name
2424
--> $DIR/methods.rs:46:12
2525
|
26-
46 | fn new(self) {}
26+
46 | fn new(self) -> Self { unimplemented!(); }
2727
| ^^^^
2828

29-
error: methods called `new` usually return `Self`
30-
--> $DIR/methods.rs:46:5
31-
|
32-
46 | fn new(self) {}
33-
| ^^^^^^^^^^^^^^^
34-
|
35-
= note: `-D clippy::new-ret-no-self` implied by `-D warnings`
36-
3729
error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
3830
--> $DIR/methods.rs:114:13
3931
|
@@ -465,5 +457,5 @@ error: used unwrap() on an Option value. If you don't want to handle the None ca
465457
|
466458
= note: `-D clippy::option-unwrap-used` implied by `-D warnings`
467459

468-
error: aborting due to 58 previous errors
460+
error: aborting due to 57 previous errors
469461

0 commit comments

Comments
 (0)