From c284099f5678da0d6cae52757fffe0c2c0eb2d1f Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Wed, 17 Feb 2016 09:11:46 +0200 Subject: [PATCH] trans: Remove unused ref_id from monomorphic_fn. --- src/librustc_trans/trans/callee.rs | 7 +------ src/librustc_trans/trans/mir/did.rs | 2 +- src/librustc_trans/trans/monomorphize.rs | 11 ++--------- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/librustc_trans/trans/callee.rs b/src/librustc_trans/trans/callee.rs index cf9dde9ef60e..7afd09634850 100644 --- a/src/librustc_trans/trans/callee.rs +++ b/src/librustc_trans/trans/callee.rs @@ -446,14 +446,9 @@ pub fn trans_fn_ref_with_substs<'a, 'tcx>( // Should be either intra-crate or inlined. assert_eq!(def_id.krate, LOCAL_CRATE); - let opt_ref_id = match node { - ExprId(id) => if id != 0 { Some(id) } else { None }, - MethodCallKey(_) => None, - }; - let substs = tcx.mk_substs(substs); let (val, fn_ty, must_cast) = - monomorphize::monomorphic_fn(ccx, def_id, substs, opt_ref_id); + monomorphize::monomorphic_fn(ccx, def_id, substs); if must_cast && node != ExprId(0) { // Monotype of the REFERENCE to the function (type params // are subst'd) diff --git a/src/librustc_trans/trans/mir/did.rs b/src/librustc_trans/trans/mir/did.rs index 3741b07d248e..5b6af4757197 100644 --- a/src/librustc_trans/trans/mir/did.rs +++ b/src/librustc_trans/trans/mir/did.rs @@ -79,7 +79,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> { let did = inline::maybe_instantiate_inline(bcx.ccx(), did); if !substs.types.is_empty() || is_named_tuple_constructor(bcx.tcx(), did) { - let (val, fn_ty, _) = monomorphize::monomorphic_fn(bcx.ccx(), did, substs, None); + let (val, fn_ty, _) = monomorphize::monomorphic_fn(bcx.ccx(), did, substs); // FIXME: cast fnptr to proper type if necessary OperandRef { ty: fn_ty, diff --git a/src/librustc_trans/trans/monomorphize.rs b/src/librustc_trans/trans/monomorphize.rs index 9edda3d2b5c9..c6119416e47e 100644 --- a/src/librustc_trans/trans/monomorphize.rs +++ b/src/librustc_trans/trans/monomorphize.rs @@ -37,16 +37,9 @@ use std::hash::{Hasher, Hash, SipHasher}; pub fn monomorphic_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_id: DefId, - psubsts: &'tcx subst::Substs<'tcx>, - ref_id: Option) + psubsts: &'tcx subst::Substs<'tcx>) -> (ValueRef, Ty<'tcx>, bool) { - debug!("monomorphic_fn(\ - fn_id={:?}, \ - real_substs={:?}, \ - ref_id={:?})", - fn_id, - psubsts, - ref_id); + debug!("monomorphic_fn(fn_id={:?}, real_substs={:?})", fn_id, psubsts); assert!(!psubsts.types.needs_infer() && !psubsts.types.has_param_types());