about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo.net>2016-05-06 00:55:53 -0400
committerMichael Woerister <michaelwoerister@posteo.net>2016-05-09 16:17:00 -0400
commit3f74c6afe0821778047ec46f29b815fc30f7ec1f (patch)
tree0c0230b004fab13d059fbd61d15b4994da8bb205
parent566aa54b494524e4af48fd0d72cada6ebf138487 (diff)
downloadrust-3f74c6afe0821778047ec46f29b815fc30f7ec1f.tar.gz
rust-3f74c6afe0821778047ec46f29b815fc30f7ec1f.zip
trans: Make base::custom_coerce_unsize_info only depend on SharedCrateContext.
-rw-r--r--src/librustc_trans/base.rs4
-rw-r--r--src/librustc_trans/collector.rs5
-rw-r--r--src/librustc_trans/expr.rs4
3 files changed, 7 insertions, 6 deletions
diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs
index 098b7d163c1..10fd4b00f3c 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 db0e04c3476..5258bdf5d3c 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 cd11ca58689..edb3d167dde 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 {