#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum ConstScalar {
// for now, we only support the trivial case of constant evaluating the length of an array
- Usize(usize),
+ // Note that this is u64 because the target usize may be bigger than our usize
+ Usize(u64),
/// Case of an unknown value that rustc might know but we don't
Unknown,
ty: TyKind::Scalar(Scalar::Uint(UintTy::Usize)).intern(&Interner),
value: ConstValue::Concrete(chalk_ir::ConcreteConst {
interned: len
- .map(|len| ConstScalar::Usize(len))
+ .map(|len| ConstScalar::Usize(len as u64))
.unwrap_or(ConstScalar::Unknown),
}),
};