1- use crate :: session:: { self , DataTypeKind } ;
1+ use crate :: ich:: StableHashingContext ;
2+ use crate :: mir:: { GeneratorLayout , GeneratorSavedLocal } ;
3+ use crate :: ty:: subst:: Subst ;
24use crate :: ty:: { self , subst:: SubstsRef , ReprOptions , Ty , TyCtxt , TypeFoldable } ;
35
46use rustc_ast:: ast:: { self , Ident , IntTy , UintTy } ;
57use rustc_attr as attr;
6- use rustc_span:: DUMMY_SP ;
7-
8- use std:: cmp;
9- use std:: fmt;
10- use std:: iter;
11- use std:: mem;
12- use std:: ops:: Bound ;
13-
14- use crate :: ich:: StableHashingContext ;
15- use crate :: mir:: { GeneratorLayout , GeneratorSavedLocal } ;
16- use crate :: ty:: subst:: Subst ;
178use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
189use rustc_hir as hir;
1910use rustc_index:: bit_set:: BitSet ;
2011use rustc_index:: vec:: { Idx , IndexVec } ;
21-
12+ use rustc_session:: { DataTypeKind , FieldInfo , SizeKind , VariantInfo } ;
13+ use rustc_span:: DUMMY_SP ;
2214use rustc_target:: abi:: call:: {
2315 ArgAbi , ArgAttribute , ArgAttributes , Conv , FnAbi , PassMode , Reg , RegKind ,
2416} ;
2517pub use rustc_target:: abi:: * ;
2618use rustc_target:: spec:: { abi:: Abi as SpecAbi , HasTargetSpec } ;
2719
20+ use std:: cmp;
21+ use std:: fmt;
22+ use std:: iter;
23+ use std:: mem;
24+ use std:: ops:: Bound ;
25+
2826pub trait IntegerExt {
2927 fn to_ty < ' tcx > ( & self , tcx : TyCtxt < ' tcx > , signed : bool ) -> Ty < ' tcx > ;
3028 fn from_attr < C : HasDataLayout > ( cx : & C , ity : attr:: IntType ) -> Integer ;
@@ -1648,7 +1646,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
16481646 if min_size < field_end {
16491647 min_size = field_end;
16501648 }
1651- session :: FieldInfo {
1649+ FieldInfo {
16521650 name : name. to_string ( ) ,
16531651 offset : offset. bytes ( ) ,
16541652 size : field_layout. size . bytes ( ) ,
@@ -1658,13 +1656,9 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
16581656 } )
16591657 . collect ( ) ;
16601658
1661- session :: VariantInfo {
1659+ VariantInfo {
16621660 name : n. map ( |n| n. to_string ( ) ) ,
1663- kind : if layout. is_unsized ( ) {
1664- session:: SizeKind :: Min
1665- } else {
1666- session:: SizeKind :: Exact
1667- } ,
1661+ kind : if layout. is_unsized ( ) { SizeKind :: Min } else { SizeKind :: Exact } ,
16681662 align : layout. align . abi . bytes ( ) ,
16691663 size : if min_size. bytes ( ) == 0 { layout. size . bytes ( ) } else { min_size. bytes ( ) } ,
16701664 fields : field_info,
0 commit comments