diff options
| author | bors <bors@rust-lang.org> | 2020-10-25 17:35:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-10-25 17:35:33 +0000 |
| commit | 83bb5ecec8dc893671cf1370f124ac3816750c7f (patch) | |
| tree | 13aaf4100e829e1503929f54d2a214f7740f7cc9 /compiler/rustc_errors/src/snippet.rs | |
| parent | 15f6fb99e4fb7b80639fa6a1217c61c6e95e8792 (diff) | |
| parent | 2f5d418011f80d99e0e4c8ddea3980b6cdc8332d (diff) | |
| download | rust-83bb5ecec8dc893671cf1370f124ac3816750c7f.tar.gz rust-83bb5ecec8dc893671cf1370f124ac3816750c7f.zip | |
Auto merge of #6202 - giraffate:fix_invalid_suggestion_in_needless_collect_test, r=flip1995
Fix an invalid suggestion in `needless_collect` test A test, https://github.com/rust-lang/rust-clippy/blob/master/tests/ui/needless_collect_indirect.rs#L11-L12, suggests following codes, but the suggested codes don't work. An example is here: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6947d9f2806a83f41cc5eb8e39b09d0b. ``` error: avoid using `collect()` when not needed --> $DIR/needless_collect_indirect.rs:11:5 | LL | / let indirect_contains = sample.iter().collect::<VecDeque<_>>(); LL | | indirect_contains.contains(&&5); | |____^ | help: Check if the original Iterator contains an element instead of collecting then checking | LL | LL | sample.iter().any(|x| x == &&5); ``` changelog: none
Diffstat (limited to 'compiler/rustc_errors/src/snippet.rs')
0 files changed, 0 insertions, 0 deletions
