Don't abort on unevaluated constants without at least tryting to eval them

This commit is contained in:
Oliver Scherer
2019-03-22 18:30:35 +01:00
parent 437f017e2e
commit 9b87d22ea8
33 changed files with 80 additions and 64 deletions

View File

@@ -341,7 +341,7 @@ fn fixed_vec_metadata(
let (size, align) = cx.size_and_align_of(array_or_slice_type);
let upper_bound = match array_or_slice_type.sty {
ty::Array(_, len) => len.unwrap_usize(cx.tcx) as c_longlong,
ty::Array(_, len) => len.eval_usize(cx.tcx) as c_longlong,
_ => -1
};