1
Fork 0

fix #103783, fix ICE checking transmutability of NaughtyLenArray

This commit is contained in:
yukang 2022-10-30 01:32:04 +08:00
parent 126dbdc9c7
commit 55568419ac
3 changed files with 35 additions and 1 deletions

View file

@ -284,7 +284,8 @@ pub(crate) mod rustc {
}
ty::Array(ty, len) => {
let len = len.try_eval_usize(tcx, ParamEnv::reveal_all()).unwrap();
let len =
len.try_eval_usize(tcx, ParamEnv::reveal_all()).ok_or(Err::Unspecified)?;
let elt = Tree::from_ty(*ty, tcx)?;
Ok(std::iter::repeat(elt)
.take(len as usize)