@@ -6,9 +6,8 @@ use base_db::ra_salsa::Cycle;
6
6
use chalk_ir:: { AdtId , FloatTy , IntTy , TyKind , UintTy } ;
7
7
use hir_def:: {
8
8
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 ,
12
11
} ,
13
12
LocalFieldId , StructId ,
14
13
} ;
@@ -192,43 +191,52 @@ pub fn layout_of_ty_query(
192
191
valid_range : WrappingRange { start : 0 , end : 0x10FFFF } ,
193
192
} ,
194
193
) ,
195
- chalk_ir:: Scalar :: Int ( i) => Layout :: scalar ( dl , scalar_unit (
194
+ chalk_ir:: Scalar :: Int ( i) => Layout :: scalar (
196
195
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
+ ) ,
207
209
) ,
208
- ) ) ,
209
- chalk_ir:: Scalar :: Uint ( i) => Layout :: scalar ( dl , scalar_unit (
210
+ ) ,
211
+ chalk_ir:: Scalar :: Uint ( i) => Layout :: scalar (
210
212
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
+ ) ,
221
226
) ,
222
- ) ) ,
223
- chalk_ir:: Scalar :: Float ( f) => Layout :: scalar ( dl , scalar_unit (
227
+ ) ,
228
+ chalk_ir:: Scalar :: Float ( f) => Layout :: scalar (
224
229
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
+ ) ,
232
240
} ,
233
241
TyKind :: Tuple ( len, tys) => {
234
242
let kind = if * len == 0 { StructKind :: AlwaysSized } else { StructKind :: MaybeUnsized } ;
0 commit comments