fix #103783, fix ICE checking transmutability of NaughtyLenArray
This commit is contained in:
parent
126dbdc9c7
commit
55568419ac
3 changed files with 35 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue