File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -53,3 +53,12 @@ impl IteratorFalsePositives {
53
53
self . foo as usize
54
54
}
55
55
}
56
+
57
+ #[ derive( Copy , Clone ) ]
58
+ pub struct IteratorMethodFalsePositives ;
59
+
60
+ impl IteratorMethodFalsePositives {
61
+ pub fn filter ( & self , _s : i32 ) -> std:: vec:: IntoIter < i32 > {
62
+ unimplemented ! ( ) ;
63
+ }
64
+ }
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ use std::ops::Mul;
32
32
use std:: rc:: { self , Rc } ;
33
33
use std:: sync:: { self , Arc } ;
34
34
35
- use option_helpers:: IteratorFalsePositives ;
35
+ use option_helpers:: { IteratorFalsePositives , IteratorMethodFalsePositives } ;
36
36
37
37
struct Lt < ' a > {
38
38
foo : & ' a u32 ,
@@ -131,6 +131,9 @@ fn filter_next() {
131
131
// Check that we don't lint if the caller is not an `Iterator`.
132
132
let foo = IteratorFalsePositives { foo : 0 } ;
133
133
let _ = foo. filter ( ) . next ( ) ;
134
+
135
+ let foo = IteratorMethodFalsePositives { } ;
136
+ let _ = foo. filter ( 42 ) . next ( ) ;
134
137
}
135
138
136
139
fn main ( ) {
You can’t perform that action at this time.
0 commit comments