Skip to content

Commit f1fe925

Browse files
committed
Remove param_substs from FunctionCx
1 parent 7b94195 commit f1fe925

File tree

1 file changed

+3
-9
lines changed
  • src/librustc_codegen_ssa/mir

1 file changed

+3
-9
lines changed

src/librustc_codegen_ssa/mir/mod.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use rustc::ty::{self, Ty, TypeFoldable, UpvarSubsts};
22
use rustc::ty::layout::{TyLayout, HasTyCtxt};
33
use rustc::mir::{self, Mir};
4-
use rustc::ty::subst::SubstsRef;
54
use rustc::session::config::DebugInfo;
65
use rustc_mir::monomorphize::Instance;
76
use rustc_target::abi::call::{FnType, PassMode, IgnoreMode};
@@ -83,9 +82,6 @@ pub struct FunctionCx<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> {
8382
/// Debug information for MIR scopes.
8483
scopes: IndexVec<mir::SourceScope, debuginfo::MirDebugScope<Bx::DIScope>>,
8584

86-
/// If this function is being monomorphized, this contains the type substitutions used.
87-
param_substs: SubstsRef<'tcx>,
88-
8985
/// If this function is a C-variadic function, this contains the `PlaceRef` of the
9086
/// "spoofed" `VaList`.
9187
va_list_ref: Option<PlaceRef<'tcx, Bx::Value>>,
@@ -96,7 +92,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
9692
where T: TypeFoldable<'tcx>
9793
{
9894
self.cx.tcx().subst_and_normalize_erasing_regions(
99-
self.param_substs,
95+
self.instance.substs,
10096
ty::ParamEnv::reveal_all(),
10197
value,
10298
)
@@ -203,6 +199,8 @@ pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
203199
instance: Instance<'tcx>,
204200
sig: ty::FnSig<'tcx>,
205201
) {
202+
assert!(!instance.substs.needs_infer());
203+
206204
let fn_ty = cx.new_fn_type(sig, &[]);
207205
debug!("fn_ty: {:?}", fn_ty);
208206
let debug_context =
@@ -245,10 +243,6 @@ pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
245243
scopes,
246244
locals: IndexVec::new(),
247245
debug_context,
248-
param_substs: {
249-
assert!(!instance.substs.needs_infer());
250-
instance.substs
251-
},
252246
va_list_ref: None,
253247
};
254248

0 commit comments

Comments
 (0)