fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1020 B23 linesraw
1error: `Iterator::map` call that discard the iterator's values
2  --> $DIR/issue-109152.rs:5:21
3   |
4LL |     vec![42].iter().map(drop);
5   |                     ^^^^----^
6   |                     |   |
7   |                     |   this function returns `()`, which is likely not what you wanted
8   |                     |   called `Iterator::map` with callable that returns `()`
9   |                     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
10   |
11   = 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
12note: the lint level is defined here
13  --> $DIR/issue-109152.rs:1:9
14   |
15LL | #![deny(map_unit_fn)]
16   |         ^^^^^^^^^^^
17help: you might have meant to use `Iterator::for_each`
18   |
19LL |     vec![42].iter().for_each(drop);
20   |                     ~~~~~~~~
21
22error: aborting due to previous error
23