about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2015-10-04 13:11:56 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2015-10-13 15:19:22 +0300
commitf4e3851aa7bbd49294c20cc63eef9974f20192c8 (patch)
tree10c3fe7653bae1485657c21ac92d9bf34f45780f /src
parentb404ded15b0873696181114766967e2e154a6425 (diff)
downloadrust-f4e3851aa7bbd49294c20cc63eef9974f20192c8.tar.gz
rust-f4e3851aa7bbd49294c20cc63eef9974f20192c8.zip
Fix rebase
Diffstat (limited to 'src')
-rw-r--r--src/librustc/metadata/encoder.rs4
-rw-r--r--src/librustc/middle/astencode.rs4
-rw-r--r--src/librustc_typeck/collect.rs9
3 files changed, 10 insertions, 7 deletions
diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs
index 75cc04a98c6..2ea4f694ec4 100644
--- a/src/librustc/metadata/encoder.rs
+++ b/src/librustc/metadata/encoder.rs
@@ -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));
         }
diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs
index 3b4cb56ec74..20ffa8c3e95 100644
--- a/src/librustc/middle/astencode.rs
+++ b/src/librustc/middle/astencode.rs
@@ -1316,11 +1316,11 @@ fn copy_item_types(dcx: &DecodeContext, ii: &InlinedItem, orig_did: DefId) {
                 {
                     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,
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs
index decc269442d..a52226db4aa 100644
--- a/src/librustc_typeck/collect.rs
+++ b/src/librustc_typeck/collect.rs
@@ -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_def<'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);