Fix FN in iter_cloned_collect with a large array
This commit is contained in:
parent
a362a4d1d0
commit
d7627dcfc8
4 changed files with 16 additions and 4 deletions
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue