File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,18 @@ fn long_span() {
5555 . collect ( ) ;
5656}
5757
58+ #[ allow( clippy:: useless_vec) ]
59+ fn no_suggestion_if_comments_present ( ) {
60+ let vec = vec ! [ vec![ 1 , 2 , 3 ] ] ;
61+ let _ = vec
62+ . iter ( )
63+ // a lovely comment explaining the code in very detail
64+ . map ( |x| x. iter ( ) )
65+ //~^ ERROR: called `map(..).flatten()` on `Iterator`
66+ // the answer to life, the universe and everything could be here
67+ . flatten ( ) ;
68+ }
69+
5870fn main ( ) {
5971 long_span ( ) ;
6072}
Original file line number Diff line number Diff line change @@ -102,5 +102,14 @@ LL + }
102102LL + })
103103 |
104104
105- error: aborting due to 4 previous errors
105+ error: called `map(..).flatten()` on `Iterator`
106+ --> tests/ui/map_flatten.rs:64:10
107+ |
108+ LL | .map(|x| x.iter())
109+ | __________^
110+ ... |
111+ LL | | .flatten();
112+ | |__________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|x| x.iter())`
113+
114+ error: aborting due to 5 previous errors
106115
You can’t perform that action at this time.
0 commit comments