mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 08:05:12 +00:00
address review by @eddyb
This commit is contained in:
parent
dc63fea427
commit
f28c053c67
@ -4,7 +4,8 @@
|
|||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||||
pub enum ConstScalar {
|
pub enum ConstScalar {
|
||||||
// for now, we only support the trivial case of constant evaluating the length of an array
|
// 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
|
/// Case of an unknown value that rustc might know but we don't
|
||||||
Unknown,
|
Unknown,
|
||||||
|
@ -746,7 +746,7 @@ impl<'a> InferenceContext<'a> {
|
|||||||
ty: TyKind::Scalar(Scalar::Uint(UintTy::Usize)).intern(&Interner),
|
ty: TyKind::Scalar(Scalar::Uint(UintTy::Usize)).intern(&Interner),
|
||||||
value: ConstValue::Concrete(chalk_ir::ConcreteConst {
|
value: ConstValue::Concrete(chalk_ir::ConcreteConst {
|
||||||
interned: len
|
interned: len
|
||||||
.map(|len| ConstScalar::Usize(len))
|
.map(|len| ConstScalar::Usize(len as u64))
|
||||||
.unwrap_or(ConstScalar::Unknown),
|
.unwrap_or(ConstScalar::Unknown),
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user