about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
diff options
context:
space:
mode:
authorcsmoe <csmoe@msn.com>2019-09-26 17:30:44 +0000
committercsmoe <csmoe@msn.com>2019-10-03 19:24:59 +0800
commit9b91bef78b15dfecc5144b0575f40a2d84ea795a (patch)
tree688ca27861a17a0ec4c8418383bc6cdcabfe356c /src/librustc_codegen_ssa
parent1f8e1d8aea495ec22fa33cefcfacbcb6ba3bad1d (diff)
generate ClosureSubsts from SubstsRef
Diffstat (limited to 'src/librustc_codegen_ssa')
-rw-r--r--src/librustc_codegen_ssa/mir/mod.rs2
-rw-r--r--src/librustc_codegen_ssa/mir/rvalue.rs5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/librustc_codegen_ssa/mir/mod.rs b/src/librustc_codegen_ssa/mir/mod.rs
index 30d519c8733..378bbd0cc38 100644
--- a/src/librustc_codegen_ssa/mir/mod.rs
+++ b/src/librustc_codegen_ssa/mir/mod.rs
@@ -616,7 +616,7 @@ fn arg_local_refs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
 
             let (def_id, upvar_substs) = match closure_layout.ty.kind {
                 ty::Closure(def_id, substs) => (def_id,
-                    UpvarSubsts::Closure(rustc::ty::ClosureSubsts::from_ref(substs))),
+                    UpvarSubsts::Closure(substs)),
                 ty::Generator(def_id, substs, _) => (def_id, UpvarSubsts::Generator(substs)),
                 _ => bug!("upvar debuginfo with non-closure arg0 type `{}`", closure_layout.ty)
             };
diff --git a/src/librustc_codegen_ssa/mir/rvalue.rs b/src/librustc_codegen_ssa/mir/rvalue.rs
index 9cc21a28b27..6ffa561f3fe 100644
--- a/src/librustc_codegen_ssa/mir/rvalue.rs
+++ b/src/librustc_codegen_ssa/mir/rvalue.rs
@@ -201,8 +201,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
                         match operand.layout.ty.kind {
                             ty::Closure(def_id, substs) => {
                                 let instance = Instance::resolve_closure(
-                                    bx.cx().tcx(), def_id,
-                                    rustc::ty::ClosureSubsts::from_ref(substs),
+                                    bx.cx().tcx(),
+                                    def_id,
+                                    substs,
                                     ty::ClosureKind::FnOnce);
                                 OperandValue::Immediate(bx.cx().get_fn(instance))
                             }