diff options
| author | Björn Steinbrink <bsteinbr@gmail.com> | 2015-07-28 00:29:05 +0200 |
|---|---|---|
| committer | Björn Steinbrink <bsteinbr@gmail.com> | 2015-07-28 10:58:22 +0200 |
| commit | 218eccfa4e66acb13bbd420564066a22709eb7dd (patch) | |
| tree | 539e5533ca276f9fda686b4cac6f1e6b9f62356f /src/test/debuginfo | |
| parent | 57f7fb60a8072fd11f8a496a0f06cdccdb7430e7 (diff) | |
| download | rust-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.rs | 18 |
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(); } } |
