Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/109152.rs: fixed with no errors #1532

Merged
merged 1 commit into from
Mar 16, 2023
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#109152

fn _y() {
    vec![42].iter().map(drop);
}

fn main() {}
=== stdout ===
=== stderr ===
warning: unused `Map` that must be used
 --> /home/runner/work/glacier/glacier/ices/109152.rs:2:5
  |
2 |     vec![42].iter().map(drop);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: iterators are lazy and do nothing unless consumed
  = note: `#[warn(unused_must_use)]` on by default

warning: `Iterator::map` call that discard the iterator's values
 --> /home/runner/work/glacier/glacier/ices/109152.rs:2:21
  |
2 |     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: `#[warn(map_unit_fn)]` on by default
help: you might have meant to use `Iterator::for_each`
  |
2 |     vec![42].iter().for_each(drop);
  |                     ~~~~~~~~

warning: 2 warnings emitted

==============

=== stdout ===
=== stderr ===
warning: unused `Map` that must be used
 --> /home/runner/work/glacier/glacier/ices/109152.rs:2:5
  |
2 |     vec![42].iter().map(drop);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: iterators are lazy and do nothing unless consumed
  = note: `#[warn(unused_must_use)]` on by default

warning: `Iterator::map` call that discard the iterator's values
 --> /home/runner/work/glacier/glacier/ices/109152.rs:2:21
  |
2 |     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: `#[warn(map_unit_fn)]` on by default
help: you might have meant to use `Iterator::for_each`
  |
2 |     vec![42].iter().for_each(drop);
  |                     ~~~~~~~~

warning: 2 warnings emitted

==============
@Alexendoo Alexendoo merged commit b58b7b5 into master Mar 16, 2023
@Alexendoo Alexendoo deleted the autofix/ices/109152.rs branch March 16, 2023 15:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants