File tree Expand file tree Collapse file tree 4 files changed +92
-0
lines changed Expand file tree Collapse file tree 4 files changed +92
-0
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,30 @@ macro_rules! in_macros {
22
22
};
23
23
}
24
24
25
+ // Don't trigger on a `None` that isn't std's option
26
+ mod custom_option {
27
+ #[allow(unused)]
28
+ enum CustomOption {
29
+ Some(i32),
30
+ None,
31
+ }
32
+
33
+ impl CustomOption {
34
+ fn iter(&self) {}
35
+ fn iter_mut(&mut self) {}
36
+ fn into_iter(self) {}
37
+ }
38
+ use CustomOption::*;
39
+
40
+ pub fn custom_option() {
41
+ None.iter();
42
+ None.iter_mut();
43
+ None.into_iter();
44
+ }
45
+ }
46
+
25
47
fn main() {
26
48
array();
49
+ custom_option::custom_option();
27
50
in_macros!();
28
51
}
Original file line number Diff line number Diff line change @@ -22,7 +22,30 @@ macro_rules! in_macros {
22
22
} ;
23
23
}
24
24
25
+ // Don't trigger on a `None` that isn't std's option
26
+ mod custom_option {
27
+ #[ allow( unused) ]
28
+ enum CustomOption {
29
+ Some ( i32 ) ,
30
+ None ,
31
+ }
32
+
33
+ impl CustomOption {
34
+ fn iter ( & self ) { }
35
+ fn iter_mut ( & mut self ) { }
36
+ fn into_iter ( self ) { }
37
+ }
38
+ use CustomOption :: * ;
39
+
40
+ pub fn custom_option ( ) {
41
+ None . iter ( ) ;
42
+ None . iter_mut ( ) ;
43
+ None . into_iter ( ) ;
44
+ }
45
+ }
46
+
25
47
fn main ( ) {
26
48
array ( ) ;
49
+ custom_option:: custom_option ( ) ;
27
50
in_macros ! ( ) ;
28
51
}
Original file line number Diff line number Diff line change @@ -22,7 +22,30 @@ macro_rules! in_macros {
22
22
};
23
23
}
24
24
25
+ // Don't trigger on a `Some` that isn't std's option
26
+ mod custom_option {
27
+ #[allow(unused)]
28
+ enum CustomOption {
29
+ Some(i32),
30
+ None,
31
+ }
32
+
33
+ impl CustomOption {
34
+ fn iter(&self) {}
35
+ fn iter_mut(&mut self) {}
36
+ fn into_iter(self) {}
37
+ }
38
+ use CustomOption::*;
39
+
40
+ pub fn custom_option() {
41
+ Some(3).iter();
42
+ Some(3).iter_mut();
43
+ Some(3).into_iter();
44
+ }
45
+ }
46
+
25
47
fn main() {
26
48
array();
49
+ custom_option::custom_option();
27
50
in_macros!();
28
51
}
Original file line number Diff line number Diff line change @@ -22,7 +22,30 @@ macro_rules! in_macros {
22
22
} ;
23
23
}
24
24
25
+ // Don't trigger on a `Some` that isn't std's option
26
+ mod custom_option {
27
+ #[ allow( unused) ]
28
+ enum CustomOption {
29
+ Some ( i32 ) ,
30
+ None ,
31
+ }
32
+
33
+ impl CustomOption {
34
+ fn iter ( & self ) { }
35
+ fn iter_mut ( & mut self ) { }
36
+ fn into_iter ( self ) { }
37
+ }
38
+ use CustomOption :: * ;
39
+
40
+ pub fn custom_option ( ) {
41
+ Some ( 3 ) . iter ( ) ;
42
+ Some ( 3 ) . iter_mut ( ) ;
43
+ Some ( 3 ) . into_iter ( ) ;
44
+ }
45
+ }
46
+
25
47
fn main ( ) {
26
48
array ( ) ;
49
+ custom_option:: custom_option ( ) ;
27
50
in_macros ! ( ) ;
28
51
}
You can’t perform that action at this time.
0 commit comments