Fix rebase 2

This commit is contained in:
Vadim Petrochenkov 2015-10-09 23:32:37 +03:00
parent 40aa09e4c9
commit a5225cbe92
3 changed files with 10 additions and 8 deletions

View file

@ -1315,7 +1315,7 @@ fn copy_item_types(dcx: &DecodeContext, ii: &InlinedItem, orig_did: DefId) {
def.variants.iter().zip(orig_def.variants.iter())
{
debug!("astencode: copying variant {:?} => {:?}",
orig_variant.did, i_variant.node.id);
orig_variant.did, i_variant.node.data.id);
copy_item_type(dcx, i_variant.node.data.id, orig_variant.did);
}
}
@ -1324,8 +1324,8 @@ fn copy_item_types(dcx: &DecodeContext, ii: &InlinedItem, orig_did: DefId) {
let ctor_did = dcx.tcx.lookup_adt_def(orig_did)
.struct_variant().did;
debug!("astencode: copying ctor {:?} => {:?}", ctor_did,
ctor_id);
copy_item_type(dcx, ctor_id, ctor_did);
def.id);
copy_item_type(dcx, def.id, ctor_did);
}
}
_ => {}

View file

@ -267,7 +267,7 @@ pub fn lower_variant(_lctx: &LoweringContext, v: &Variant) -> P<hir::Variant> {
name: v.node.name.name,
attrs: v.node.attrs.clone(),
data: lower_struct_def(_lctx, &v.node.data),
disr_expr: v.node.disr_expr.as_ref().map(|e| lower_expr(e)),
disr_expr: v.node.disr_expr.as_ref().map(|e| lower_expr(_lctx, e)),
},
span: v.span,
})
@ -498,15 +498,17 @@ pub fn lower_where_predicate(_lctx: &LoweringContext,
}
}
pub fn lower_struct_def(sd: &VariantData) -> P<hir::VariantData> {
pub fn lower_struct_def(_lctx: &LoweringContext, sd: &VariantData) -> P<hir::VariantData> {
P(hir::VariantData {
id: sd.id,
data_: match sd.data_ {
VariantData_::Struct(ref fields) => {
hir::VariantData_::Struct(fields.iter().map(|f| lower_struct_field(_lctx, f)).collect())
hir::VariantData_::Struct(fields.iter()
.map(|f| lower_struct_field(_lctx, f)).collect())
}
VariantData_::Tuple(ref fields) => {
hir::VariantData_::Tuple(fields.iter().map(|f| lower_struct_field(_lctx, f)).collect())
hir::VariantData_::Tuple(fields.iter()
.map(|f| lower_struct_field(_lctx, f)).collect())
}
VariantData_::Unit => hir::VariantData_::Unit
}

View file

@ -1211,7 +1211,7 @@ fn convert_enum_def<'tcx>(tcx: &ty::ctxt<'tcx>,
{
let did = tcx.map.local_def_id(v.node.data.id);
let name = v.node.name;
convert_struct_variant(tcx, did, name, disr, &v.node.data, did)
convert_struct_variant(tcx, did, name, disr, &v.node.data)
}
let did = tcx.map.local_def_id(it.id);
let repr_hints = tcx.lookup_repr_hints(did);