about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
diff options
context:
space:
mode:
authorWim Looman <wim@nemo157.com>2018-11-07 10:33:35 +0100
committerWim Looman <wim@nemo157.com>2019-01-27 22:58:59 +0100
commite7d66758cfce4dc2c87e3224b6ed47aee1fee257 (patch)
tree5dace82fecd4589422e4c555a1d4b066abd99d6c /src/librustc_codegen_ssa
parentbe3989301aea41777bdbc65d5c3537b7036ec407 (diff)
downloadrust-e7d66758cfce4dc2c87e3224b6ed47aee1fee257.tar.gz
rust-e7d66758cfce4dc2c87e3224b6ed47aee1fee257.zip
Update generator upvar debug info
Diffstat (limited to 'src/librustc_codegen_ssa')
-rw-r--r--src/librustc_codegen_ssa/mir/mod.rs7
1 files changed, 7 insertions, 0 deletions
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)
             };