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 {
5353 self . foo as usize
5454 }
5555}
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;
3232use std:: rc:: { self , Rc } ;
3333use std:: sync:: { self , Arc } ;
3434
35- use option_helpers:: IteratorFalsePositives ;
35+ use option_helpers:: { IteratorFalsePositives , IteratorMethodFalsePositives } ;
3636
3737struct Lt < ' a > {
3838 foo : & ' a u32 ,
@@ -131,6 +131,9 @@ fn filter_next() {
131131 // Check that we don't lint if the caller is not an `Iterator`.
132132 let foo = IteratorFalsePositives { foo : 0 } ;
133133 let _ = foo. filter ( ) . next ( ) ;
134+
135+ let foo = IteratorMethodFalsePositives { } ;
136+ let _ = foo. filter ( 42 ) . next ( ) ;
134137}
135138
136139fn main ( ) {
You can’t perform that action at this time.
0 commit comments