Closed
Description
Generally, we should be using assert_usize
, which will fail gracefully if we have a generic parameter as an array length instead, and handling that case specially. Using unwrap_usize
has caused issues in the past: #61380.
ICEs resulting from this issue have the form:
error: internal compiler error: src/librustc/ty/sty.rs:2311: expected constant usize, got Const {
ty: usize,
val: Param(
N/#0,
),
}