Skip to content

Commit c284099

Browse files
committed
trans: Remove unused ref_id from monomorphic_fn.
1 parent 0c01f6e commit c284099

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

src/librustc_trans/trans/callee.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,9 @@ pub fn trans_fn_ref_with_substs<'a, 'tcx>(
446446
// Should be either intra-crate or inlined.
447447
assert_eq!(def_id.krate, LOCAL_CRATE);
448448

449-
let opt_ref_id = match node {
450-
ExprId(id) => if id != 0 { Some(id) } else { None },
451-
MethodCallKey(_) => None,
452-
};
453-
454449
let substs = tcx.mk_substs(substs);
455450
let (val, fn_ty, must_cast) =
456-
monomorphize::monomorphic_fn(ccx, def_id, substs, opt_ref_id);
451+
monomorphize::monomorphic_fn(ccx, def_id, substs);
457452
if must_cast && node != ExprId(0) {
458453
// Monotype of the REFERENCE to the function (type params
459454
// are subst'd)

src/librustc_trans/trans/mir/did.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
7979
let did = inline::maybe_instantiate_inline(bcx.ccx(), did);
8080

8181
if !substs.types.is_empty() || is_named_tuple_constructor(bcx.tcx(), did) {
82-
let (val, fn_ty, _) = monomorphize::monomorphic_fn(bcx.ccx(), did, substs, None);
82+
let (val, fn_ty, _) = monomorphize::monomorphic_fn(bcx.ccx(), did, substs);
8383
// FIXME: cast fnptr to proper type if necessary
8484
OperandRef {
8585
ty: fn_ty,

src/librustc_trans/trans/monomorphize.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,9 @@ use std::hash::{Hasher, Hash, SipHasher};
3737

3838
pub fn monomorphic_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
3939
fn_id: DefId,
40-
psubsts: &'tcx subst::Substs<'tcx>,
41-
ref_id: Option<ast::NodeId>)
40+
psubsts: &'tcx subst::Substs<'tcx>)
4241
-> (ValueRef, Ty<'tcx>, bool) {
43-
debug!("monomorphic_fn(\
44-
fn_id={:?}, \
45-
real_substs={:?}, \
46-
ref_id={:?})",
47-
fn_id,
48-
psubsts,
49-
ref_id);
42+
debug!("monomorphic_fn(fn_id={:?}, real_substs={:?})", fn_id, psubsts);
5043

5144
assert!(!psubsts.types.needs_infer() && !psubsts.types.has_param_types());
5245

0 commit comments

Comments
 (0)