diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs index 098b7d163c196..10fd4b00f3cbd 100644 --- a/src/librustc_trans/base.rs +++ b/src/librustc_trans/base.rs @@ -664,7 +664,7 @@ pub fn coerce_unsized_into<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, } } -pub fn custom_coerce_unsize_info<'ccx, 'tcx>(ccx: &CrateContext<'ccx, 'tcx>, +pub fn custom_coerce_unsize_info<'ccx, 'tcx>(ccx: &SharedCrateContext<'ccx, 'tcx>, source_ty: Ty<'tcx>, target_ty: Ty<'tcx>) -> CustomCoerceUnsized { @@ -678,7 +678,7 @@ pub fn custom_coerce_unsize_info<'ccx, 'tcx>(ccx: &CrateContext<'ccx, 'tcx>, substs: ccx.tcx().mk_substs(trait_substs) }); - match fulfill_obligation(ccx.shared(), DUMMY_SP, trait_ref) { + match fulfill_obligation(ccx, DUMMY_SP, trait_ref) { traits::VtableImpl(traits::VtableImplData { impl_def_id, .. }) => { ccx.tcx().custom_coerce_unsized_kind(impl_def_id) } diff --git a/src/librustc_trans/collector.rs b/src/librustc_trans/collector.rs index db0e04c347633..5258bdf5d3c5b 100644 --- a/src/librustc_trans/collector.rs +++ b/src/librustc_trans/collector.rs @@ -211,8 +211,7 @@ use syntax::parse::token; use base::{custom_coerce_unsize_info, llvm_linkage_by_name}; use context::CrateContext; -use common::{fulfill_obligation, normalize_and_test_predicates, - type_is_sized}; +use common::{fulfill_obligation, normalize_and_test_predicates, type_is_sized}; use glue::{self, DropGlueKind}; use llvm; use meth; @@ -937,7 +936,7 @@ fn find_vtable_types_for_unsizing<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, &ty::TyStruct(target_adt_def, target_substs)) => { assert_eq!(source_adt_def, target_adt_def); - let kind = custom_coerce_unsize_info(ccx, source_ty, target_ty); + let kind = custom_coerce_unsize_info(ccx.shared(), source_ty, target_ty); let coerce_index = match kind { CustomCoerceUnsized::Struct(i) => i diff --git a/src/librustc_trans/expr.rs b/src/librustc_trans/expr.rs index cd11ca586890c..edb3d167ddeb0 100644 --- a/src/librustc_trans/expr.rs +++ b/src/librustc_trans/expr.rs @@ -510,7 +510,9 @@ fn coerce_unsized<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, let source = unpack_datum!(bcx, source.to_ref_datum(bcx)); assert!(target.kind.is_by_ref()); - let kind = custom_coerce_unsize_info(bcx.ccx(), source.ty, target.ty); + let kind = custom_coerce_unsize_info(bcx.ccx().shared(), + source.ty, + target.ty); let repr_source = adt::represent_type(bcx.ccx(), source.ty); let src_fields = match &*repr_source {