]> git.proxmox.com Git - rustc.git/blob - tests/ui/lint/issue-109152.stderr
New upstream version 1.76.0+dfsg1
[rustc.git] / tests / ui / lint / issue-109152.stderr
1 error: `Iterator::map` call that discard the iterator's values
2 --> $DIR/issue-109152.rs:5:21
3 |
4 LL | 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
12 note: the lint level is defined here
13 --> $DIR/issue-109152.rs:1:9
14 |
15 LL | #![deny(map_unit_fn)]
16 | ^^^^^^^^^^^
17 help: you might have meant to use `Iterator::for_each`
18 |
19 LL | vec![42].iter().for_each(drop);
20 | ~~~~~~~~
21
22 error: aborting due to 1 previous error
23