about summary refs log tree commit diff
path: root/clippy_lints/src
diff options
context:
space:
mode:
authorMateusz Gacek <96mateusz.gacek@gmail.com>2021-04-26 13:03:51 -0700
committerMateusz Gacek <96mateusz.gacek@gmail.com>2021-04-26 13:03:51 -0700
commitd7627dcfc8a60aaedccf002738dc44a2576fa8fd (patch)
treef9084e128d9688dc948325a0973a6db1bb782c06 /clippy_lints/src
parenta362a4d1d0edb66aef186c1d27b28c60573078f4 (diff)
downloadrust-d7627dcfc8a60aaedccf002738dc44a2576fa8fd.tar.gz
rust-d7627dcfc8a60aaedccf002738dc44a2576fa8fd.zip
Fix FN in `iter_cloned_collect` with a large array
Diffstat (limited to 'clippy_lints/src')
-rw-r--r--clippy_lints/src/methods/utils.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/clippy_lints/src/methods/utils.rs b/clippy_lints/src/methods/utils.rs
index f6bf37e08b9..0daea47816a 100644
--- a/clippy_lints/src/methods/utils.rs
+++ b/clippy_lints/src/methods/utils.rs
@@ -18,9 +18,7 @@ pub(super) fn derefs_to_slice<'tcx>(
             ty::Slice(_) => true,
             ty::Adt(def, _) if def.is_box() => may_slice(cx, ty.boxed_ty()),
             ty::Adt(..) => is_type_diagnostic_item(cx, ty, sym::vec_type),
-            ty::Array(_, size) => size
-                .try_eval_usize(cx.tcx, cx.param_env)
-                .map_or(false, |size| size < 32),
+            ty::Array(_, size) => size.try_eval_usize(cx.tcx, cx.param_env).is_some(),
             ty::Ref(_, inner, _) => may_slice(cx, inner),
             _ => false,
         }