File tree 3 files changed +23
-5
lines changed 3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change
1
+ error: methods called `new` usually return `Self`
2
+ --> $DIR/methods.rs:96:5
3
+ |
4
+ LL | / async fn new() -> Option<Self> {
5
+ LL | | None
6
+ LL | | }
7
+ | |_____^
8
+ |
9
+ = note: `-D clippy::new-ret-no-self` implied by `-D warnings`
10
+
1
11
error: methods called `new` usually return `Self`
2
12
--> $DIR/methods.rs:104:5
3
13
|
4
14
LL | / fn new() -> i32 {
5
15
LL | | 0
6
16
LL | | }
7
17
| |_____^
8
- |
9
- = note: `-D clippy::new-ret-no-self` implied by `-D warnings`
10
18
11
19
error: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
12
20
--> $DIR/methods.rs:125:13
@@ -20,5 +28,5 @@ LL | | ).next();
20
28
|
21
29
= note: `-D clippy::filter-next` implied by `-D warnings`
22
30
23
- error: aborting due to 2 previous errors
31
+ error: aborting due to 3 previous errors
24
32
Original file line number Diff line number Diff line change @@ -413,14 +413,14 @@ mod issue10041 {
413
413
}
414
414
}
415
415
416
- mod issue10041_TAIT {
416
+ mod issue10041_tait {
417
417
type X = impl std:: ops:: Add < Output = X > ;
418
418
419
419
struct Foo ;
420
420
421
421
impl Foo {
422
422
fn new ( ) -> X {
423
- return 1 ;
423
+ 1
424
424
}
425
425
}
426
426
}
Original file line number Diff line number Diff line change @@ -92,3 +92,13 @@ LL | | unimplemented!()
92
92
LL | | }
93
93
| |_________^
94
94
95
+ error: methods called `new` usually return `Self`
96
+ --> $DIR/new_ret_no_self.rs:422:9
97
+ |
98
+ LL | / fn new() -> X {
99
+ LL | | 1
100
+ LL | | }
101
+ | |_________^
102
+
103
+ error: aborting due to 13 previous errors
104
+
You can’t perform that action at this time.
0 commit comments