@@ -9,9 +9,7 @@ use std::cell::{Cell, RefCell};
99use std:: { iter, sync:: Arc } ;
1010
1111use base_db:: CrateId ;
12- use chalk_ir:: {
13- cast:: Cast , fold:: Shift , interner:: HasInterner , Mutability , Safety , Scalar , UintTy ,
14- } ;
12+ use chalk_ir:: { cast:: Cast , fold:: Shift , interner:: HasInterner , Mutability , Safety } ;
1513use hir_def:: {
1614 adt:: StructKind ,
1715 body:: { Expander , LowerCtx } ,
@@ -31,16 +29,17 @@ use stdx::impl_from;
3129use syntax:: ast;
3230
3331use crate :: {
32+ consteval,
3433 db:: HirDatabase ,
3534 mapping:: ToChalk ,
3635 static_lifetime, to_assoc_type_id, to_chalk_trait_id, to_placeholder_idx,
3736 utils:: {
3837 all_super_trait_refs, associated_type_by_name_including_super_traits, generics, Generics ,
3938 } ,
40- AliasEq , AliasTy , Binders , BoundVar , CallableSig , ConstData , ConstValue , DebruijnIndex , DynTy ,
41- FnPointer , FnSig , FnSubst , ImplTraitId , Interner , OpaqueTy , PolyFnSig , ProjectionTy ,
42- QuantifiedWhereClause , QuantifiedWhereClauses , ReturnTypeImplTrait , ReturnTypeImplTraits ,
43- Substitution , TraitEnvironment , TraitRef , TraitRefExt , Ty , TyBuilder , TyKind , WhereClause ,
39+ AliasEq , AliasTy , Binders , BoundVar , CallableSig , DebruijnIndex , DynTy , FnPointer , FnSig ,
40+ FnSubst , ImplTraitId , Interner , OpaqueTy , PolyFnSig , ProjectionTy , QuantifiedWhereClause ,
41+ QuantifiedWhereClauses , ReturnTypeImplTrait , ReturnTypeImplTraits , Substitution ,
42+ TraitEnvironment , TraitRef , TraitRefExt , Ty , TyBuilder , TyKind , WhereClause ,
4443} ;
4544
4645#[ derive( Debug ) ]
@@ -176,11 +175,7 @@ impl<'a> TyLoweringContext<'a> {
176175 TypeRef :: Array ( inner, len) => {
177176 let inner_ty = self . lower_ty ( inner) ;
178177
179- let const_len = ConstData {
180- ty : TyKind :: Scalar ( Scalar :: Uint ( UintTy :: Usize ) ) . intern ( & Interner ) ,
181- value : ConstValue :: Concrete ( chalk_ir:: ConcreteConst { interned : * len } ) ,
182- }
183- . intern ( & Interner ) ;
178+ let const_len = consteval:: usize_const ( len. as_usize ( ) ) ;
184179
185180 TyKind :: Array ( inner_ty, const_len) . intern ( & Interner )
186181 }
0 commit comments