summary refs log tree commit diff
path: root/src/test/debuginfo
diff options
context:
space:
mode:
authorBjörn Steinbrink <bsteinbr@gmail.com>2015-07-28 00:29:05 +0200
committerBjörn Steinbrink <bsteinbr@gmail.com>2015-07-28 10:58:22 +0200
commit218eccfa4e66acb13bbd420564066a22709eb7dd (patch)
tree539e5533ca276f9fda686b4cac6f1e6b9f62356f /src/test/debuginfo
parent57f7fb60a8072fd11f8a496a0f06cdccdb7430e7 (diff)
downloadrust-218eccfa4e66acb13bbd420564066a22709eb7dd.tar.gz
rust-218eccfa4e66acb13bbd420564066a22709eb7dd.zip
Fix de-deduplication for closure debuginfo
Closure variables represent the closure environment, not the closure
function, so the identifier used to ensure that the debuginfo is unique
for each kind of closure needs to be based on the closure upvars and not
the function signature.
Diffstat (limited to 'src/test/debuginfo')
-rw-r--r--src/test/debuginfo/basic-types-metadata.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/debuginfo/basic-types-metadata.rs b/src/test/debuginfo/basic-types-metadata.rs
index 2468150a6a5..3b662ae0264 100644
--- a/src/test/debuginfo/basic-types-metadata.rs
+++ b/src/test/debuginfo/basic-types-metadata.rs
@@ -46,6 +46,21 @@
 // gdb-check:type = [...] (*)([...])
 // gdb-command:info functions _yyy
 // gdb-check:[...]![...]_yyy([...]);
+// gdb-command:ptype closure_0
+// gdb-check: type = struct closure {
+// gdb-check:     <no data fields>
+// gdb-check: }
+// gdb-command:ptype closure_1
+// gdb-check: type = struct closure {
+// gdb-check:     bool *__0;
+// gdb-check: }
+// gdb-command:ptype closure_2
+// gdb-check: type = struct closure {
+// gdb-check:     bool *__0;
+// gdb-check:     isize *__1;
+// gdb-check: }
+
+//
 // gdb-command:continue
 
 #![allow(unused_variables)]
@@ -68,6 +83,9 @@ fn main() {
     let f32: f32 = 2.5;
     let f64: f64 = 3.5;
     let fnptr : fn() = _zzz;
+    let closure_0 = || {};
+    let closure_1 = || { b; };
+    let closure_2 = || { if b { i } else { i }; };
     _zzz(); // #break
     if 1 == 1 { _yyy(); }
 }