summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/clippy_lints/src/loops/mod.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:32 +0000
commit4547b622d8d29df964fa2914213088b148c498fc (patch)
tree9fc6b25f3c3add6b745be9a2400a6e96140046e9 /src/tools/clippy/clippy_lints/src/loops/mod.rs
parentReleasing progress-linux version 1.66.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-4547b622d8d29df964fa2914213088b148c498fc.tar.xz
rustc-4547b622d8d29df964fa2914213088b148c498fc.zip
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/clippy_lints/src/loops/mod.rs')
-rw-r--r--src/tools/clippy/clippy_lints/src/loops/mod.rs26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/tools/clippy/clippy_lints/src/loops/mod.rs b/src/tools/clippy/clippy_lints/src/loops/mod.rs
index bcf278d9c..8e52cac43 100644
--- a/src/tools/clippy/clippy_lints/src/loops/mod.rs
+++ b/src/tools/clippy/clippy_lints/src/loops/mod.rs
@@ -9,7 +9,6 @@ mod manual_flatten;
mod manual_memcpy;
mod missing_spin_loop;
mod mut_range_bound;
-mod needless_collect;
mod needless_range_loop;
mod never_loop;
mod same_item_push;
@@ -207,28 +206,6 @@ declare_clippy_lint! {
declare_clippy_lint! {
/// ### What it does
- /// Checks for functions collecting an iterator when collect
- /// is not needed.
- ///
- /// ### Why is this bad?
- /// `collect` causes the allocation of a new data structure,
- /// when this allocation may not be needed.
- ///
- /// ### Example
- /// ```rust
- /// # let iterator = vec![1].into_iter();
- /// let len = iterator.clone().collect::<Vec<_>>().len();
- /// // should be
- /// let len = iterator.count();
- /// ```
- #[clippy::version = "1.30.0"]
- pub NEEDLESS_COLLECT,
- perf,
- "collecting an iterator when collect is not needed"
-}
-
-declare_clippy_lint! {
- /// ### What it does
/// Checks `for` loops over slices with an explicit counter
/// and suggests the use of `.enumerate()`.
///
@@ -605,7 +582,6 @@ declare_lint_pass!(Loops => [
EXPLICIT_INTO_ITER_LOOP,
ITER_NEXT_LOOP,
WHILE_LET_LOOP,
- NEEDLESS_COLLECT,
EXPLICIT_COUNTER_LOOP,
EMPTY_LOOP,
WHILE_LET_ON_ITERATOR,
@@ -667,8 +643,6 @@ impl<'tcx> LateLintPass<'tcx> for Loops {
while_immutable_condition::check(cx, condition, body);
missing_spin_loop::check(cx, condition, body);
}
-
- needless_collect::check(expr, cx);
}
}