File: issue-109152.stderr

package info (click to toggle)
rustc 1.87.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 925,564 kB
  • sloc: xml: 158,127; python: 36,039; javascript: 19,761; sh: 19,737; cpp: 18,981; ansic: 13,133; asm: 4,376; makefile: 710; perl: 29; lisp: 28; ruby: 19; sql: 11
file content (24 lines) | stat: -rw-r--r-- 1,029 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
error: `Iterator::map` call that discard the iterator's values
  --> $DIR/issue-109152.rs:5:21
   |
LL |     vec![42].iter().map(drop);
   |                     ^^^^----^
   |                     |   |
   |                     |   this function returns `()`, which is likely not what you wanted
   |                     |   called `Iterator::map` with callable that returns `()`
   |                     after this call to map, the resulting iterator is `impl Iterator<Item = ()>`, which means the only information carried by the iterator is the number of items
   |
   = note: `Iterator::map`, like many of the methods on `Iterator`, gets executed lazily, meaning that its effects won't be visible until it is iterated
note: the lint level is defined here
  --> $DIR/issue-109152.rs:1:9
   |
LL | #![deny(map_unit_fn)]
   |         ^^^^^^^^^^^
help: you might have meant to use `Iterator::for_each`
   |
LL -     vec![42].iter().map(drop);
LL +     vec![42].iter().for_each(drop);
   |

error: aborting due to 1 previous error