diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-10-09 23:32:37 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-10-13 15:19:26 +0300 |
| commit | a5225cbe92d962dfed922b434a21f8474f303da2 (patch) | |
| tree | 9cdadfbd2e08fe5a9ec9a15978a8c1e9d2f3bdaf | |
| parent | 40aa09e4c9f4c3f0fa2b088895c8f5125325eaa4 (diff) | |
| download | rust-a5225cbe92d962dfed922b434a21f8474f303da2.tar.gz rust-a5225cbe92d962dfed922b434a21f8474f303da2.zip | |
Fix rebase 2
| -rw-r--r-- | src/librustc/middle/astencode.rs | 6 | ||||
| -rw-r--r-- | src/librustc_front/lowering.rs | 10 | ||||
| -rw-r--r-- | src/librustc_typeck/collect.rs | 2 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index ca05de81e77..584f6cb4e99 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -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); } } _ => {} diff --git a/src/librustc_front/lowering.rs b/src/librustc_front/lowering.rs index cd32ad15744..2f257a47dbf 100644 --- a/src/librustc_front/lowering.rs +++ b/src/librustc_front/lowering.rs @@ -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 } diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 44e06688774..31f7f3174b8 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -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); |
