about summary refs log tree commit diff
path: root/src/test/debuginfo
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-12-09 09:24:41 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-12-09 09:24:41 -0800
commit2593070d57cb0b4cdc626cfc2924d6c590b0f9a8 (patch)
tree4fd3715fd63aa67783ad97d5fb68efb58eafd517 /src/test/debuginfo
parent39b57115fbf5d91df3382699b1dbde7ea8716f6c (diff)
parent8ebc1c9fd88640b1833e0743b649a957f3337720 (diff)
downloadrust-2593070d57cb0b4cdc626cfc2924d6c590b0f9a8.tar.gz
rust-2593070d57cb0b4cdc626cfc2924d6c590b0f9a8.zip
rollup merge of #19581: luqmana/duc
Fixes #19575.
Diffstat (limited to 'src/test/debuginfo')
-rw-r--r--src/test/debuginfo/var-captured-in-stack-closure.rs49
1 files changed, 43 insertions, 6 deletions
diff --git a/src/test/debuginfo/var-captured-in-stack-closure.rs b/src/test/debuginfo/var-captured-in-stack-closure.rs
index 92a3d358f5c..761d0f0be8f 100644
--- a/src/test/debuginfo/var-captured-in-stack-closure.rs
+++ b/src/test/debuginfo/var-captured-in-stack-closure.rs
@@ -28,6 +28,19 @@
 // gdb-command:print *owned
 // gdb-check:$5 = 6
 
+// gdb-command:continue
+
+// gdb-command:print variable
+// gdb-check:$6 = 2
+// gdb-command:print constant
+// gdb-check:$7 = 2
+// gdb-command:print a_struct
+// gdb-check:$8 = {a = -3, b = 4.5, c = 5}
+// gdb-command:print *struct_ref
+// gdb-check:$9 = {a = -3, b = 4.5, c = 5}
+// gdb-command:print *owned
+// gdb-check:$10 = 6
+
 
 // === LLDB TESTS ==================================================================================
 
@@ -44,6 +57,20 @@
 // lldb-command:print *owned
 // lldb-check:[...]$4 = 6
 
+// lldb-command:continue
+
+// lldb-command:print variable
+// lldb-check:[...]$5 = 2
+// lldb-command:print constant
+// lldb-check:[...]$6 = 2
+// lldb-command:print a_struct
+// lldb-check:[...]$7 = Struct { a: -3, b: 4.5, c: 5 }
+// lldb-command:print *struct_ref
+// lldb-check:[...]$8 = Struct { a: -3, b: 4.5, c: 5 }
+// lldb-command:print *owned
+// lldb-check:[...]$9 = 6
+
+#![feature(unboxed_closures)]
 #![allow(unused_variables)]
 
 struct Struct {
@@ -65,12 +92,22 @@ fn main() {
     let struct_ref = &a_struct;
     let owned = box 6;
 
-    let closure = || {
-        zzz(); // #break
-        variable = constant + a_struct.a + struct_ref.a + *owned;
-    };
-
-    closure();
+    {
+        let closure = || {
+            zzz(); // #break
+            variable = constant + a_struct.a + struct_ref.a + *owned;
+        };
+
+        closure();
+    }
+
+    {
+        let mut unboxed_closure = |&mut:| {
+            zzz(); // #break
+            variable = constant + a_struct.a + struct_ref.a + *owned;
+        };
+        unboxed_closure();
+    }
 }
 
 fn zzz() {()}