Skip to content

Commit d636c06

Browse files
committed
Use usize for const generics in chalk-integration
Since const generics are primarily used by arrays, this avoids an unusual disparity between Chalk and Rust.
1 parent 03a20f1 commit d636c06

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

chalk-integration/src/lowering.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ lower_param_map!(
107107
))
108108
);
109109

110-
fn get_type_of_u32() -> chalk_ir::Ty<ChalkIr> {
111-
chalk_ir::TyKind::Scalar(chalk_ir::Scalar::Uint(chalk_ir::UintTy::U32)).intern(&ChalkIr)
110+
fn get_type_of_usize() -> chalk_ir::Ty<ChalkIr> {
111+
chalk_ir::TyKind::Scalar(chalk_ir::Scalar::Uint(chalk_ir::UintTy::Usize)).intern(&ChalkIr)
112112
}
113113

114114
impl Lower for VariableKind {
@@ -128,7 +128,7 @@ impl Lower for VariableKind {
128128
n,
129129
),
130130
VariableKind::Lifetime(n) => (chalk_ir::VariableKind::Lifetime, n),
131-
VariableKind::Const(ref n) => (chalk_ir::VariableKind::Const(get_type_of_u32()), n),
131+
VariableKind::Const(ref n) => (chalk_ir::VariableKind::Const(get_type_of_usize()), n),
132132
};
133133

134134
chalk_ir::WithKind::new(kind, n.str.clone())
@@ -830,7 +830,7 @@ impl LowerWithEnv for Const {
830830
.map(|c| c.clone())
831831
}
832832
Const::Value(value) => Ok(chalk_ir::ConstData {
833-
ty: get_type_of_u32(),
833+
ty: get_type_of_usize(),
834834
value: chalk_ir::ConstValue::Concrete(chalk_ir::ConcreteConst { interned: *value }),
835835
}
836836
.intern(interner)),

0 commit comments

Comments
 (0)