]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/captured-fields-2.rs
Rollup merge of #106701 - ibraheemdev:sync-sender-spin, r=Amanieu
[rust.git] / tests / debuginfo / captured-fields-2.rs
1 // compile-flags:-g
2
3 // === GDB TESTS ===================================================================================
4
5 // gdb-command:run
6 // gdb-command:print my_ref__my_field1
7 // gdbr-check:$1 = 11
8 // gdb-command:continue
9 // gdb-command:print my_var__my_field2
10 // gdbr-check:$2 = 22
11 // gdb-command:continue
12
13 // === LLDB TESTS ==================================================================================
14
15 // lldb-command:run
16 // lldb-command:print my_ref__my_field1
17 // lldbg-check:(unsigned int) $0 = 11
18 // lldb-command:continue
19 // lldb-command:print my_var__my_field2
20 // lldbg-check:(unsigned int) $1 = 22
21 // lldb-command:continue
22
23 #![feature(capture_disjoint_fields)]
24 #![allow(unused)]
25
26 struct MyStruct {
27     my_field1: u32,
28     my_field2: u32,
29 }
30
31 fn main() {
32     let mut my_var = MyStruct {
33         my_field1: 11,
34         my_field2: 22,
35     };
36     let my_ref = &mut my_var;
37
38     let test = || {
39         let a = my_ref.my_field1;
40
41         _zzz(); // #break
42     };
43
44     test();
45
46     let test = move || {
47         let a = my_var.my_field2;
48
49         _zzz(); // #break
50     };
51
52     test();
53 }
54
55 fn _zzz() {}