From e7d66758cfce4dc2c87e3224b6ed47aee1fee257 Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Wed, 7 Nov 2018 10:33:35 +0100 Subject: Update generator upvar debug info --- src/librustc_codegen_ssa/mir/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/librustc_codegen_ssa') diff --git a/src/librustc_codegen_ssa/mir/mod.rs b/src/librustc_codegen_ssa/mir/mod.rs index 85a663dacdc..c7e2131eed5 100644 --- a/src/librustc_codegen_ssa/mir/mod.rs +++ b/src/librustc_codegen_ssa/mir/mod.rs @@ -586,10 +586,17 @@ fn arg_local_refs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( return; } + let pin_did = tcx.lang_items().pin_type(); // Or is it the closure environment? let (closure_layout, env_ref) = match arg.layout.ty.sty { ty::RawPtr(ty::TypeAndMut { ty, .. }) | ty::Ref(_, ty, _) => (bx.layout_of(ty), true), + ty::Adt(def, substs) if Some(def.did) == pin_did => { + match substs.type_at(0).sty { + ty::Ref(_, ty, _) => (bx.layout_of(ty), true), + _ => (arg.layout, false), + } + } _ => (arg.layout, false) }; -- cgit 1.4.1-3-g733a5