@@ -32,11 +32,11 @@ pub trait IntegerExt {
32
32
fn to_ty < ' a , ' tcx > ( & self , tcx : TyCtxt < ' a , ' tcx , ' tcx > , signed : bool ) -> Ty < ' tcx > ;
33
33
fn from_attr < C : HasDataLayout > ( cx : C , ity : attr:: IntType ) -> Integer ;
34
34
fn repr_discr < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
35
- ty : Ty < ' tcx > ,
36
- repr : & ReprOptions ,
37
- min : i128 ,
38
- max : i128 )
39
- -> ( Integer , bool ) ;
35
+ ty : Ty < ' tcx > ,
36
+ repr : & ReprOptions ,
37
+ min : i128 ,
38
+ max : i128 )
39
+ -> ( Integer , bool ) ;
40
40
}
41
41
42
42
impl IntegerExt for Integer {
@@ -76,11 +76,11 @@ impl IntegerExt for Integer {
76
76
/// N.B.: u128 values above i128::MAX will be treated as signed, but
77
77
/// that shouldn't affect anything, other than maybe debuginfo.
78
78
fn repr_discr < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
79
- ty : Ty < ' tcx > ,
80
- repr : & ReprOptions ,
81
- min : i128 ,
82
- max : i128 )
83
- -> ( Integer , bool ) {
79
+ ty : Ty < ' tcx > ,
80
+ repr : & ReprOptions ,
81
+ min : i128 ,
82
+ max : i128 )
83
+ -> ( Integer , bool ) {
84
84
// Theoretically, negative values could be larger in unsigned representation
85
85
// than the unsigned representation of the signed minimum. However, if there
86
86
// are any negative values, the only valid unsigned representation is u128
@@ -96,7 +96,7 @@ impl IntegerExt for Integer {
96
96
let fit = if ity. is_signed ( ) { signed_fit } else { unsigned_fit } ;
97
97
if discr < fit {
98
98
bug ! ( "Integer::repr_discr: `#[repr]` hint too small for \
99
- discriminant range of enum `{}", ty)
99
+ discriminant range of enum `{}", ty)
100
100
}
101
101
return ( discr, ity. is_signed ( ) ) ;
102
102
}
@@ -106,7 +106,7 @@ impl IntegerExt for Integer {
106
106
// WARNING: the ARM EABI has two variants; the one corresponding
107
107
// to `at_least == I32` appears to be used on Linux and NetBSD,
108
108
// but some systems may use the variant corresponding to no
109
- // lower bound. However, we don't run on those yet...?
109
+ // lower bound. However, we don't run on those yet...?
110
110
"arm" => min_from_extern = Some ( I32 ) ,
111
111
_ => min_from_extern = Some ( I32 ) ,
112
112
}
@@ -250,6 +250,7 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> {
250
250
/// A univariant, but with a prefix of an arbitrary size & alignment (e.g. enum tag).
251
251
Prefixed ( Size , Align ) ,
252
252
}
253
+
253
254
let univariant_uninterned = |fields : & [ TyLayout < ' _ > ] , repr : & ReprOptions , kind| {
254
255
let packed = repr. packed ( ) ;
255
256
if packed && repr. align > 0 {
@@ -324,7 +325,7 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> {
324
325
let field = fields[ i as usize ] ;
325
326
if !sized {
326
327
bug ! ( "univariant: field #{} of `{}` comes after unsized field" ,
327
- offsets. len( ) , ty) ;
328
+ offsets. len( ) , ty) ;
328
329
}
329
330
330
331
if field. is_unsized ( ) {
@@ -628,7 +629,7 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> {
628
629
} ;
629
630
630
631
univariant ( & tys. iter ( ) . map ( |ty| self . layout_of ( ty) ) . collect :: < Result < Vec < _ > , _ > > ( ) ?,
631
- & ReprOptions :: default ( ) , kind) ?
632
+ & ReprOptions :: default ( ) , kind) ?
632
633
}
633
634
634
635
// SIMD vector types.
@@ -640,7 +641,7 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> {
640
641
Abi :: Scalar ( ref scalar) => scalar. clone ( ) ,
641
642
_ => {
642
643
tcx. sess . fatal ( & format ! ( "monomorphising SIMD type `{}` with \
643
- a non-machine element type `{}`",
644
+ a non-machine element type `{}`",
644
645
ty, element. ty) ) ;
645
646
}
646
647
} ;
@@ -743,7 +744,7 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> {
743
744
// Only one variant is present.
744
745
( present_second. is_none ( ) &&
745
746
// Representation optimizations are allowed.
746
- !def. repr . inhibit_enum_layout_opt ( ) ) ;
747
+ !def. repr . inhibit_enum_layout_opt ( ) ) ;
747
748
if is_struct {
748
749
// Struct, or univariant enum equivalent to a struct.
749
750
// (Typechecking will reject discriminant-sizing attrs.)
@@ -755,7 +756,7 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> {
755
756
let param_env = tcx. param_env ( def. did ) ;
756
757
let last_field = def. variants [ v] . fields . last ( ) . unwrap ( ) ;
757
758
let always_sized = tcx. type_of ( last_field. did )
758
- . is_sized ( tcx. at ( DUMMY_SP ) , param_env) ;
759
+ . is_sized ( tcx. at ( DUMMY_SP ) , param_env) ;
759
760
if !always_sized { StructKind :: MaybeUnsized }
760
761
else { StructKind :: AlwaysSized }
761
762
} ;
@@ -1258,8 +1259,8 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> {
1258
1259
let fields: Vec < _ > =
1259
1260
variant_def. fields . iter ( ) . map ( |f| f. ident . name ) . collect ( ) ;
1260
1261
build_variant_info ( Some ( variant_def. name ) ,
1261
- & fields,
1262
- layout. for_variant ( self , i) )
1262
+ & fields,
1263
+ layout. for_variant ( self , i) )
1263
1264
} )
1264
1265
. collect ( ) ;
1265
1266
record ( adt_kind. into ( ) , adt_packed, match layout. variants {
0 commit comments