diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:29 +0000 |
commit | 631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch) | |
tree | a1b87c8f8cad01cf18f7c5f57a08f102771ed303 /tests/ui/lint/issue-109152.stderr | |
parent | Adding debian version 1.69.0+dfsg1-1. (diff) | |
download | rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip |
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/lint/issue-109152.stderr')
-rw-r--r-- | tests/ui/lint/issue-109152.stderr | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/lint/issue-109152.stderr b/tests/ui/lint/issue-109152.stderr new file mode 100644 index 000000000..7db9e71a5 --- /dev/null +++ b/tests/ui/lint/issue-109152.stderr @@ -0,0 +1,23 @@ +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().for_each(drop); + | ~~~~~~~~ + +error: aborting due to previous error + |