@@ -6,9 +6,8 @@ use base_db::ra_salsa::Cycle;
66use chalk_ir:: { AdtId , FloatTy , IntTy , TyKind , UintTy } ;
77use hir_def:: {
88 layout:: {
9- Float , Integer , LayoutCalculator , LayoutCalculatorError ,
10- LayoutData , Primitive , ReprOptions , Scalar , StructKind , TargetDataLayout ,
11- WrappingRange ,
9+ Float , Integer , LayoutCalculator , LayoutCalculatorError , LayoutData , Primitive ,
10+ ReprOptions , Scalar , StructKind , TargetDataLayout , WrappingRange ,
1211 } ,
1312 LocalFieldId , StructId ,
1413} ;
@@ -192,43 +191,52 @@ pub fn layout_of_ty_query(
192191 valid_range : WrappingRange { start : 0 , end : 0x10FFFF } ,
193192 } ,
194193 ) ,
195- chalk_ir:: Scalar :: Int ( i) => Layout :: scalar ( dl , scalar_unit (
194+ chalk_ir:: Scalar :: Int ( i) => Layout :: scalar (
196195 dl,
197- Primitive :: Int (
198- match i {
199- IntTy :: Isize => dl. ptr_sized_integer ( ) ,
200- IntTy :: I8 => Integer :: I8 ,
201- IntTy :: I16 => Integer :: I16 ,
202- IntTy :: I32 => Integer :: I32 ,
203- IntTy :: I64 => Integer :: I64 ,
204- IntTy :: I128 => Integer :: I128 ,
205- } ,
206- true ,
196+ scalar_unit (
197+ dl,
198+ Primitive :: Int (
199+ match i {
200+ IntTy :: Isize => dl. ptr_sized_integer ( ) ,
201+ IntTy :: I8 => Integer :: I8 ,
202+ IntTy :: I16 => Integer :: I16 ,
203+ IntTy :: I32 => Integer :: I32 ,
204+ IntTy :: I64 => Integer :: I64 ,
205+ IntTy :: I128 => Integer :: I128 ,
206+ } ,
207+ true ,
208+ ) ,
207209 ) ,
208- ) ) ,
209- chalk_ir:: Scalar :: Uint ( i) => Layout :: scalar ( dl , scalar_unit (
210+ ) ,
211+ chalk_ir:: Scalar :: Uint ( i) => Layout :: scalar (
210212 dl,
211- Primitive :: Int (
212- match i {
213- UintTy :: Usize => dl. ptr_sized_integer ( ) ,
214- UintTy :: U8 => Integer :: I8 ,
215- UintTy :: U16 => Integer :: I16 ,
216- UintTy :: U32 => Integer :: I32 ,
217- UintTy :: U64 => Integer :: I64 ,
218- UintTy :: U128 => Integer :: I128 ,
219- } ,
220- false ,
213+ scalar_unit (
214+ dl,
215+ Primitive :: Int (
216+ match i {
217+ UintTy :: Usize => dl. ptr_sized_integer ( ) ,
218+ UintTy :: U8 => Integer :: I8 ,
219+ UintTy :: U16 => Integer :: I16 ,
220+ UintTy :: U32 => Integer :: I32 ,
221+ UintTy :: U64 => Integer :: I64 ,
222+ UintTy :: U128 => Integer :: I128 ,
223+ } ,
224+ false ,
225+ ) ,
221226 ) ,
222- ) ) ,
223- chalk_ir:: Scalar :: Float ( f) => Layout :: scalar ( dl , scalar_unit (
227+ ) ,
228+ chalk_ir:: Scalar :: Float ( f) => Layout :: scalar (
224229 dl,
225- Primitive :: Float ( match f {
226- FloatTy :: F16 => Float :: F16 ,
227- FloatTy :: F32 => Float :: F32 ,
228- FloatTy :: F64 => Float :: F64 ,
229- FloatTy :: F128 => Float :: F128 ,
230- } ) ,
231- ) ) ,
230+ scalar_unit (
231+ dl,
232+ Primitive :: Float ( match f {
233+ FloatTy :: F16 => Float :: F16 ,
234+ FloatTy :: F32 => Float :: F32 ,
235+ FloatTy :: F64 => Float :: F64 ,
236+ FloatTy :: F128 => Float :: F128 ,
237+ } ) ,
238+ ) ,
239+ ) ,
232240 } ,
233241 TyKind :: Tuple ( len, tys) => {
234242 let kind = if * len == 0 { StructKind :: AlwaysSized } else { StructKind :: MaybeUnsized } ;
0 commit comments