Skip to content

Commit f4e3851

Browse files
committed
Fix rebase
1 parent b404ded commit f4e3851

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,8 +1068,8 @@ fn encode_info_for_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
10681068
// Encode inherent implementations for this structure.
10691069
encode_inherent_implementations(ecx, rbml_w, def_id);
10701070

1071-
if let Some(ctor_id) = struct_def.ctor_id {
1072-
let ctor_did = ecx.tcx.map.local_def_id(ctor_id);
1071+
if struct_def.kind != hir::VariantKind::Dict {
1072+
let ctor_did = ecx.tcx.map.local_def_id(struct_def.id);
10731073
rbml_w.wr_tagged_u64(tag_items_data_item_struct_ctor,
10741074
def_to_u64(ctor_did));
10751075
}

src/librustc/middle/astencode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,11 +1316,11 @@ fn copy_item_types(dcx: &DecodeContext, ii: &InlinedItem, orig_did: DefId) {
13161316
{
13171317
debug!("astencode: copying variant {:?} => {:?}",
13181318
orig_variant.did, i_variant.node.id);
1319-
copy_item_type(dcx, i_variant.node.id, orig_variant.did);
1319+
copy_item_type(dcx, i_variant.node.def.id, orig_variant.did);
13201320
}
13211321
}
13221322
hir::ItemStruct(ref def, _) => {
1323-
if let Some(ctor_id) = def.ctor_id {
1323+
if def.kind != hir::VariantKind::Dict {
13241324
let ctor_did = dcx.tcx.lookup_adt_def(orig_did)
13251325
.struct_variant().did;
13261326
debug!("astencode: copying ctor {:?} => {:?}", ctor_did,

src/librustc_typeck/collect.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,8 +1125,11 @@ fn convert_struct_def<'tcx>(tcx: &ty::ctxt<'tcx>,
11251125
{
11261126

11271127
let did = tcx.map.local_def_id(it.id);
1128-
let ctor_id = def.ctor_id.map_or(did,
1129-
|ctor_id| tcx.map.local_def_id(ctor_id));
1128+
let ctor_id = if def.kind != hir::VariantKind::Dict {
1129+
tcx.map.local_def_id(def.id)
1130+
} else {
1131+
did
1132+
};
11301133
tcx.intern_adt_def(
11311134
did,
11321135
ty::AdtKind::Struct,
@@ -1208,7 +1211,7 @@ fn convert_enum_def<'tcx>(tcx: &ty::ctxt<'tcx>,
12081211
{
12091212
let did = tcx.map.local_def_id(v.node.def.id);
12101213
let name = v.node.name;
1211-
convert_struct_variant(tcx, did, name, disr, &v.node.def)
1214+
convert_struct_variant(tcx, did, name, disr, &v.node.def, did)
12121215
}
12131216
let did = tcx.map.local_def_id(it.id);
12141217
let repr_hints = tcx.lookup_repr_hints(did);

0 commit comments

Comments
 (0)