]> git.lizzy.rs Git - rust.git/commitdiff
Fix rebase
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Sun, 4 Oct 2015 10:11:56 +0000 (13:11 +0300)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Tue, 13 Oct 2015 12:19:22 +0000 (15:19 +0300)
src/librustc/metadata/encoder.rs
src/librustc/middle/astencode.rs
src/librustc_typeck/collect.rs

index 75cc04a98c66ffdffa7ae842746d24c088281b15..2ea4f694ec4bb54bdc122af439a476d9abe5e99c 100644 (file)
@@ -1068,8 +1068,8 @@ fn encode_info_for_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
         // Encode inherent implementations for this structure.
         encode_inherent_implementations(ecx, rbml_w, def_id);
 
-        if let Some(ctor_id) = struct_def.ctor_id {
-            let ctor_did = ecx.tcx.map.local_def_id(ctor_id);
+        if struct_def.kind != hir::VariantKind::Dict {
+            let ctor_did = ecx.tcx.map.local_def_id(struct_def.id);
             rbml_w.wr_tagged_u64(tag_items_data_item_struct_ctor,
                                  def_to_u64(ctor_did));
         }
index 3b4cb56ec741f4b793463a8246d1f0726ae714ad..20ffa8c3e95487f026a3d7a9dbe0e1de846bd608 100644 (file)
@@ -1316,11 +1316,11 @@ fn copy_item_type(dcx: &DecodeContext,
                 {
                     debug!("astencode: copying variant {:?} => {:?}",
                            orig_variant.did, i_variant.node.id);
-                    copy_item_type(dcx, i_variant.node.id, orig_variant.did);
+                    copy_item_type(dcx, i_variant.node.def.id, orig_variant.did);
                 }
             }
             hir::ItemStruct(ref def, _) => {
-                if let Some(ctor_id) = def.ctor_id {
+                if def.kind != hir::VariantKind::Dict {
                     let ctor_did = dcx.tcx.lookup_adt_def(orig_did)
                         .struct_variant().did;
                     debug!("astencode: copying ctor {:?} => {:?}", ctor_did,
index decc269442d81a31f1bf3d6bcdcfbc58ea868548..a52226db4aa6201f7aa279f4355f1246b3a5cc19 100644 (file)
@@ -1125,8 +1125,11 @@ fn convert_struct_def<'tcx>(tcx: &ty::ctxt<'tcx>,
 {
 
     let did = tcx.map.local_def_id(it.id);
-    let ctor_id = def.ctor_id.map_or(did,
-        |ctor_id| tcx.map.local_def_id(ctor_id));
+    let ctor_id = if def.kind != hir::VariantKind::Dict {
+        tcx.map.local_def_id(def.id)
+    } else {
+        did
+    };
     tcx.intern_adt_def(
         did,
         ty::AdtKind::Struct,
@@ -1208,7 +1211,7 @@ fn convert_enum_variant<'tcx>(tcx: &ty::ctxt<'tcx>,
     {
         let did = tcx.map.local_def_id(v.node.def.id);
         let name = v.node.name;
-        convert_struct_variant(tcx, did, name, disr, &v.node.def)
+        convert_struct_variant(tcx, did, name, disr, &v.node.def, did)
     }
     let did = tcx.map.local_def_id(it.id);
     let repr_hints = tcx.lookup_repr_hints(did);