about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaik Klein <maikklein@googlemail.com>2017-11-23 15:06:18 +0100
committerAriel Ben-Yehuda <ariel.byd@gmail.com>2017-12-18 17:08:49 +0200
commit116e43f73bb6e0beb5b27403ce7f0616ed5ce627 (patch)
tree21afa8944d2846e31aae68ec6eeac61a63cc71b2
parent282b231af2c7194215330588d1e5af15e5ab8990 (diff)
downloadrust-116e43f73bb6e0beb5b27403ce7f0616ed5ce627.tar.gz
rust-116e43f73bb6e0beb5b27403ce7f0616ed5ce627.zip
Prefer type_of().substs over instance::ty()
-rw-r--r--src/librustc_trans/debuginfo/mod.rs4
-rw-r--r--src/librustc_trans/partitioning.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_trans/debuginfo/mod.rs b/src/librustc_trans/debuginfo/mod.rs
index 228b83a58ad..7b892c9057e 100644
--- a/src/librustc_trans/debuginfo/mod.rs
+++ b/src/librustc_trans/debuginfo/mod.rs
@@ -24,7 +24,7 @@ use llvm;
 use llvm::{ModuleRef, ContextRef, ValueRef};
 use llvm::debuginfo::{DIFile, DIType, DIScope, DIBuilderRef, DISubprogram, DIArray, DIFlags};
 use rustc::hir::def_id::{DefId, CrateNum};
-use rustc::ty::subst::Substs;
+use rustc::ty::subst::{Subst, Substs};
 
 use abi::Abi;
 use common::CrateContext;
@@ -428,7 +428,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
             // If the method does *not* belong to a trait, proceed
             if cx.tcx().trait_id_of_impl(impl_def_id).is_none() {
                 let impl_self_ty =
-                    Instance::new(impl_def_id, instance.substs).ty(cx.tcx());
+                    cx.tcx().type_of(impl_def_id).subst(cx.tcx(), instance.substs);
 
                 // Only "class" methods are generally understood by LLVM,
                 // so avoid methods on other types (e.g. `<*mut T>::null`).
diff --git a/src/librustc_trans/partitioning.rs b/src/librustc_trans/partitioning.rs
index 9d5b4e9893c..6897a4aa5a5 100644
--- a/src/librustc_trans/partitioning.rs
+++ b/src/librustc_trans/partitioning.rs
@@ -114,7 +114,7 @@ use std::collections::hash_map::Entry;
 use syntax::ast::NodeId;
 use syntax::symbol::{Symbol, InternedString};
 use trans_item::{MonoItem, BaseMonoItemExt, MonoItemExt, InstantiationMode};
-use rustc::ty::Instance;
+use rustc::ty::subst::Subst;
 
 pub use rustc::mir::mono::CodegenUnit;
 
@@ -575,7 +575,7 @@ fn characteristic_def_id_of_trans_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
             if let Some(impl_def_id) = tcx.impl_of_method(def_id) {
                 // This is a method within an inherent impl, find out what the
                 // self-type is:
-                let impl_self_ty = Instance::new(impl_def_id, instance.substs).ty(tcx);
+                let impl_self_ty = tcx.type_of(impl_def_id).subst(tcx, instance.substs);
                 if let Some(def_id) = characteristic_def_id_of_type(impl_self_ty) {
                     return Some(def_id);
                 }