@@ -7,7 +7,7 @@ use tracing::debug;
7
7
8
8
use crate :: {
9
9
Abi , AbiAndPrefAlign , Align , FieldsShape , HasDataLayout , IndexSlice , IndexVec , Integer ,
10
- LayoutS , Niche , NonZeroUsize , Primitive , ReprOptions , Scalar , Size , StructKind , TagEncoding ,
10
+ LayoutData , Niche , NonZeroUsize , Primitive , ReprOptions , Scalar , Size , StructKind , TagEncoding ,
11
11
Variants , WrappingRange ,
12
12
} ;
13
13
@@ -26,7 +26,7 @@ fn absent<'a, FieldIdx, VariantIdx, F>(fields: &IndexSlice<FieldIdx, F>) -> bool
26
26
where
27
27
FieldIdx : Idx ,
28
28
VariantIdx : Idx ,
29
- F : Deref < Target = & ' a LayoutS < FieldIdx , VariantIdx > > + fmt:: Debug ,
29
+ F : Deref < Target = & ' a LayoutData < FieldIdx , VariantIdx > > + fmt:: Debug ,
30
30
{
31
31
let uninhabited = fields. iter ( ) . any ( |f| f. abi . is_uninhabited ( ) ) ;
32
32
// We cannot ignore alignment; that might lead us to entirely discard a variant and
@@ -89,7 +89,7 @@ impl<F> LayoutCalculatorError<F> {
89
89
}
90
90
91
91
type LayoutCalculatorResult < FieldIdx , VariantIdx , F > =
92
- Result < LayoutS < FieldIdx , VariantIdx > , LayoutCalculatorError < F > > ;
92
+ Result < LayoutData < FieldIdx , VariantIdx > , LayoutCalculatorError < F > > ;
93
93
94
94
#[ derive( Clone , Copy , Debug ) ]
95
95
pub struct LayoutCalculator < Cx > {
@@ -105,7 +105,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
105
105
& self ,
106
106
a : Scalar ,
107
107
b : Scalar ,
108
- ) -> LayoutS < FieldIdx , VariantIdx > {
108
+ ) -> LayoutData < FieldIdx , VariantIdx > {
109
109
let dl = self . cx . data_layout ( ) ;
110
110
let b_align = b. align ( dl) ;
111
111
let align = a. align ( dl) . max ( b_align) . max ( dl. aggregate_align ) ;
@@ -119,7 +119,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
119
119
. chain ( Niche :: from_scalar ( dl, Size :: ZERO , a) )
120
120
. max_by_key ( |niche| niche. available ( dl) ) ;
121
121
122
- LayoutS {
122
+ LayoutData {
123
123
variants : Variants :: Single { index : VariantIdx :: new ( 0 ) } ,
124
124
fields : FieldsShape :: Arbitrary {
125
125
offsets : [ Size :: ZERO , b_offset] . into ( ) ,
@@ -138,7 +138,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
138
138
' a ,
139
139
FieldIdx : Idx ,
140
140
VariantIdx : Idx ,
141
- F : Deref < Target = & ' a LayoutS < FieldIdx , VariantIdx > > + fmt:: Debug + Copy ,
141
+ F : Deref < Target = & ' a LayoutData < FieldIdx , VariantIdx > > + fmt:: Debug + Copy ,
142
142
> (
143
143
& self ,
144
144
fields : & IndexSlice < FieldIdx , F > ,
@@ -211,9 +211,9 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
211
211
212
212
pub fn layout_of_never_type < FieldIdx : Idx , VariantIdx : Idx > (
213
213
& self ,
214
- ) -> LayoutS < FieldIdx , VariantIdx > {
214
+ ) -> LayoutData < FieldIdx , VariantIdx > {
215
215
let dl = self . cx . data_layout ( ) ;
216
- LayoutS {
216
+ LayoutData {
217
217
variants : Variants :: Single { index : VariantIdx :: new ( 0 ) } ,
218
218
fields : FieldsShape :: Primitive ,
219
219
abi : Abi :: Uninhabited ,
@@ -229,7 +229,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
229
229
' a ,
230
230
FieldIdx : Idx ,
231
231
VariantIdx : Idx ,
232
- F : Deref < Target = & ' a LayoutS < FieldIdx , VariantIdx > > + fmt:: Debug + Copy ,
232
+ F : Deref < Target = & ' a LayoutData < FieldIdx , VariantIdx > > + fmt:: Debug + Copy ,
233
233
> (
234
234
& self ,
235
235
repr : & ReprOptions ,
@@ -292,7 +292,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
292
292
' a ,
293
293
FieldIdx : Idx ,
294
294
VariantIdx : Idx ,
295
- F : Deref < Target = & ' a LayoutS < FieldIdx , VariantIdx > > + fmt:: Debug + Copy ,
295
+ F : Deref < Target = & ' a LayoutData < FieldIdx , VariantIdx > > + fmt:: Debug + Copy ,
296
296
> (
297
297
& self ,
298
298
repr : & ReprOptions ,
@@ -384,7 +384,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
384
384
return Err ( LayoutCalculatorError :: EmptyUnion ) ;
385
385
} ;
386
386
387
- Ok ( LayoutS {
387
+ Ok ( LayoutData {
388
388
variants : Variants :: Single { index : only_variant_idx } ,
389
389
fields : FieldsShape :: Union ( union_field_count) ,
390
390
abi,
@@ -401,7 +401,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
401
401
' a ,
402
402
FieldIdx : Idx ,
403
403
VariantIdx : Idx ,
404
- F : Deref < Target = & ' a LayoutS < FieldIdx , VariantIdx > > + fmt:: Debug + Copy ,
404
+ F : Deref < Target = & ' a LayoutData < FieldIdx , VariantIdx > > + fmt:: Debug + Copy ,
405
405
> (
406
406
& self ,
407
407
repr : & ReprOptions ,
@@ -501,7 +501,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
501
501
' a ,
502
502
FieldIdx : Idx ,
503
503
VariantIdx : Idx ,
504
- F : Deref < Target = & ' a LayoutS < FieldIdx , VariantIdx > > + fmt:: Debug + Copy ,
504
+ F : Deref < Target = & ' a LayoutData < FieldIdx , VariantIdx > > + fmt:: Debug + Copy ,
505
505
> (
506
506
& self ,
507
507
repr : & ReprOptions ,
@@ -516,8 +516,8 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
516
516
// overall LayoutS. Store the overall LayoutS
517
517
// and the variant LayoutSs here until then.
518
518
struct TmpLayout < FieldIdx : Idx , VariantIdx : Idx > {
519
- layout : LayoutS < FieldIdx , VariantIdx > ,
520
- variants : IndexVec < VariantIdx , LayoutS < FieldIdx , VariantIdx > > ,
519
+ layout : LayoutData < FieldIdx , VariantIdx > ,
520
+ variants : IndexVec < VariantIdx , LayoutData < FieldIdx , VariantIdx > > ,
521
521
}
522
522
523
523
let dl = self . cx . data_layout ( ) ;
@@ -649,7 +649,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
649
649
Abi :: Aggregate { sized : true }
650
650
} ;
651
651
652
- let layout = LayoutS {
652
+ let layout = LayoutData {
653
653
variants : Variants :: Multiple {
654
654
tag : niche_scalar,
655
655
tag_encoding : TagEncoding :: Niche {
@@ -958,7 +958,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
958
958
959
959
let largest_niche = Niche :: from_scalar ( dl, Size :: ZERO , tag) ;
960
960
961
- let tagged_layout = LayoutS {
961
+ let tagged_layout = LayoutData {
962
962
variants : Variants :: Multiple {
963
963
tag,
964
964
tag_encoding : TagEncoding :: Direct ,
@@ -1013,7 +1013,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
1013
1013
' a ,
1014
1014
FieldIdx : Idx ,
1015
1015
VariantIdx : Idx ,
1016
- F : Deref < Target = & ' a LayoutS < FieldIdx , VariantIdx > > + fmt:: Debug + Copy ,
1016
+ F : Deref < Target = & ' a LayoutData < FieldIdx , VariantIdx > > + fmt:: Debug + Copy ,
1017
1017
> (
1018
1018
& self ,
1019
1019
fields : & IndexSlice < FieldIdx , F > ,
@@ -1341,7 +1341,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
1341
1341
unadjusted_abi_align
1342
1342
} ;
1343
1343
1344
- Ok ( LayoutS {
1344
+ Ok ( LayoutData {
1345
1345
variants : Variants :: Single { index : VariantIdx :: new ( 0 ) } ,
1346
1346
fields : FieldsShape :: Arbitrary { offsets, memory_index } ,
1347
1347
abi,
@@ -1357,10 +1357,10 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
1357
1357
' a ,
1358
1358
FieldIdx : Idx ,
1359
1359
VariantIdx : Idx ,
1360
- F : Deref < Target = & ' a LayoutS < FieldIdx , VariantIdx > > + fmt:: Debug ,
1360
+ F : Deref < Target = & ' a LayoutData < FieldIdx , VariantIdx > > + fmt:: Debug ,
1361
1361
> (
1362
1362
& self ,
1363
- layout : & LayoutS < FieldIdx , VariantIdx > ,
1363
+ layout : & LayoutData < FieldIdx , VariantIdx > ,
1364
1364
fields : & IndexSlice < FieldIdx , F > ,
1365
1365
) -> String {
1366
1366
let dl = self . cx . data_layout ( ) ;
0 commit comments