Merge commit '7c7683c8efe447b251d6c5ca6cce51233060f6e8' into clippyup

This commit is contained in:
flip1995
2021-04-27 16:55:11 +02:00
parent f801d026f5
commit ae72f1adb9
52 changed files with 416 additions and 326 deletions

View File

@@ -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,
}