]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/captured-fields-1.rs
Compress amount of hashed bytes for `isize` values in StableHasher
[rust.git] / src / test / debuginfo / captured-fields-1.rs
1 // compile-flags:-g
2
3 // === GDB TESTS ===================================================================================
4
5 // gdb-command:run
6 // gdb-command:print test
7 // gdbr-check:$1 = captured_fields_1::main::{closure#0} {_ref__my_ref__my_field1: 0x[...]}
8 // gdb-command:continue
9 // gdb-command:print test
10 // gdbr-check:$2 = captured_fields_1::main::{closure#1} {_ref__my_ref__my_field2: 0x[...]}
11 // gdb-command:continue
12 // gdb-command:print test
13 // gdbr-check:$3 = captured_fields_1::main::{closure#2} {_ref__my_ref: 0x[...]}
14 // gdb-command:continue
15 // gdb-command:print test
16 // gdbr-check:$4 = captured_fields_1::main::{closure#3} {my_ref: 0x[...]}
17 // gdb-command:continue
18 // gdb-command:print test
19 // gdbr-check:$5 = captured_fields_1::main::{closure#4} {my_var__my_field2: 22}
20 // gdb-command:continue
21 // gdb-command:print test
22 // gdbr-check:$6 = captured_fields_1::main::{closure#5} {my_var: captured_fields_1::MyStruct {my_field1: 11, my_field2: 22}}
23 // gdb-command:continue
24
25 // === LLDB TESTS ==================================================================================
26
27 // lldb-command:run
28 // lldb-command:print test
29 // lldbg-check:(captured_fields_1::main::{closure#0}) $0 = { _ref__my_ref__my_field1 = 0x[...] }
30 // lldb-command:continue
31 // lldb-command:print test
32 // lldbg-check:(captured_fields_1::main::{closure#1}) $1 = { _ref__my_ref__my_field2 = 0x[...] }
33 // lldb-command:continue
34 // lldb-command:print test
35 // lldbg-check:(captured_fields_1::main::{closure#2}) $2 = { _ref__my_ref = 0x[...] }
36 // lldb-command:continue
37 // lldb-command:print test
38 // lldbg-check:(captured_fields_1::main::{closure#3}) $3 = { my_ref = 0x[...] }
39 // lldb-command:continue
40 // lldb-command:print test
41 // lldbg-check:(captured_fields_1::main::{closure#4}) $4 = { my_var__my_field2 = 22 }
42 // lldb-command:continue
43 // lldb-command:print test
44 // lldbg-check:(captured_fields_1::main::{closure#5}) $5 = { my_var = { my_field1 = 11 my_field2 = 22 } }
45 // lldb-command:continue
46
47 #![feature(capture_disjoint_fields)]
48 #![allow(unused)]
49
50 struct MyStruct {
51     my_field1: u32,
52     my_field2: u32,
53 }
54
55 fn main() {
56     let mut my_var = MyStruct {
57         my_field1: 11,
58         my_field2: 22,
59     };
60     let my_ref = &mut my_var;
61
62     let test = || {
63         let a = &mut my_ref.my_field1;
64     };
65
66     _zzz(); // #break
67
68     let test = || {
69         let a = &my_ref.my_field2;
70     };
71
72     _zzz(); // #break
73
74     let test = || {
75         let a = &my_ref;
76     };
77
78     _zzz(); // #break
79
80     let test = || {
81         let a = my_ref;
82     };
83
84     _zzz(); // #break
85
86     let test = move || {
87         let a = my_var.my_field2;
88     };
89
90     _zzz(); // #break
91
92     let test = || {
93         let a = my_var;
94     };
95
96     _zzz(); // #break
97 }
98
99 fn _zzz() {}