@@ -425,8 +425,8 @@ impl<'tcx> EntryKind<'tcx> {
425425 EntryKind :: ForeignImmStatic => Def :: Static ( did, false ) ,
426426 EntryKind :: MutStatic |
427427 EntryKind :: ForeignMutStatic => Def :: Static ( did, true ) ,
428- EntryKind :: Struct ( _) => Def :: Struct ( did) ,
429- EntryKind :: Union ( _) => Def :: Union ( did) ,
428+ EntryKind :: Struct ( _, _ ) => Def :: Struct ( did) ,
429+ EntryKind :: Union ( _, _ ) => Def :: Union ( did) ,
430430 EntryKind :: Fn ( _) |
431431 EntryKind :: ForeignFn ( _) => Def :: Fn ( did) ,
432432 EntryKind :: Method ( _) => Def :: Method ( did) ,
@@ -435,7 +435,7 @@ impl<'tcx> EntryKind<'tcx> {
435435 EntryKind :: Mod ( _) => Def :: Mod ( did) ,
436436 EntryKind :: Variant ( _) => Def :: Variant ( did) ,
437437 EntryKind :: Trait ( _) => Def :: Trait ( did) ,
438- EntryKind :: Enum => Def :: Enum ( did) ,
438+ EntryKind :: Enum ( _ ) => Def :: Enum ( did) ,
439439 EntryKind :: MacroDef ( _) => Def :: Macro ( did) ,
440440
441441 EntryKind :: ForeignMod |
@@ -519,8 +519,8 @@ impl<'a, 'tcx> CrateMetadata {
519519 -> ( ty:: VariantDef , Option < DefIndex > ) {
520520 let data = match item. kind {
521521 EntryKind :: Variant ( data) |
522- EntryKind :: Struct ( data) |
523- EntryKind :: Union ( data) => data. decode ( self ) ,
522+ EntryKind :: Struct ( data, _ ) |
523+ EntryKind :: Union ( data, _ ) => data. decode ( self ) ,
524524 _ => bug ! ( ) ,
525525 } ;
526526
@@ -547,7 +547,7 @@ impl<'a, 'tcx> CrateMetadata {
547547 let item = self . entry ( item_id) ;
548548 let did = self . local_def_id ( item_id) ;
549549 let mut ctor_index = None ;
550- let variants = if let EntryKind :: Enum = item. kind {
550+ let variants = if let EntryKind :: Enum ( _ ) = item. kind {
551551 item. children
552552 . decode ( self )
553553 . map ( |index| {
@@ -561,14 +561,14 @@ impl<'a, 'tcx> CrateMetadata {
561561 ctor_index = struct_ctor;
562562 vec ! [ variant]
563563 } ;
564- let kind = match item. kind {
565- EntryKind :: Enum => ty:: AdtKind :: Enum ,
566- EntryKind :: Struct ( _) => ty:: AdtKind :: Struct ,
567- EntryKind :: Union ( _) => ty:: AdtKind :: Union ,
564+ let ( kind, repr ) = match item. kind {
565+ EntryKind :: Enum ( repr ) => ( ty:: AdtKind :: Enum , repr ) ,
566+ EntryKind :: Struct ( _, repr ) => ( ty:: AdtKind :: Struct , repr ) ,
567+ EntryKind :: Union ( _, repr ) => ( ty:: AdtKind :: Union , repr ) ,
568568 _ => bug ! ( "get_adt_def called on a non-ADT {:?}" , did) ,
569569 } ;
570570
571- let adt = tcx. alloc_adt_def ( did, kind, variants) ;
571+ let adt = tcx. alloc_adt_def ( did, kind, variants, repr ) ;
572572 if let Some ( ctor_index) = ctor_index {
573573 // Make adt definition available through constructor id as well.
574574 tcx. adt_defs . borrow_mut ( ) . insert ( self . local_def_id ( ctor_index) , adt) ;
@@ -881,16 +881,16 @@ impl<'a, 'tcx> CrateMetadata {
881881
882882 pub fn get_ctor_kind ( & self , node_id : DefIndex ) -> CtorKind {
883883 match self . entry ( node_id) . kind {
884- EntryKind :: Struct ( data) |
885- EntryKind :: Union ( data) |
884+ EntryKind :: Struct ( data, _ ) |
885+ EntryKind :: Union ( data, _ ) |
886886 EntryKind :: Variant ( data) => data. decode ( self ) . ctor_kind ,
887887 _ => CtorKind :: Fictive ,
888888 }
889889 }
890890
891891 pub fn get_struct_ctor_def_id ( & self , node_id : DefIndex ) -> Option < DefId > {
892892 match self . entry ( node_id) . kind {
893- EntryKind :: Struct ( data) => {
893+ EntryKind :: Struct ( data, _ ) => {
894894 data. decode ( self ) . struct_ctor . map ( |index| self . local_def_id ( index) )
895895 }
896896 _ => None ,
0 commit comments