26
26
// debugger:print nested
27
27
// check:$4 = {a = {a = {x = 7890, y = 9870}}}
28
28
29
- // debugger:print sizeof(nested)
30
- // check:$5 = 32
31
-
32
-
33
29
struct NoDestructor {
34
30
x : i32 ,
35
31
y : i64
@@ -84,6 +80,8 @@ fn main() {
84
80
// then the debugger will have an invalid offset for the field 'guard' and thus should not be
85
81
// able to read its value correctly (dots are padding bytes, D is the boolean destructor flag):
86
82
//
83
+ // 64 bit
84
+ //
87
85
// NoDestructorGuarded = 0000....00000000FFFFFFFF
88
86
// <--------------><------>
89
87
// NoDestructor guard
@@ -96,15 +94,29 @@ fn main() {
96
94
// <----------------------><------> // How it actually is
97
95
// WithDestructor guard
98
96
//
97
+ // 32 bit
98
+ //
99
+ // NoDestructorGuarded = 000000000000FFFFFFFF
100
+ // <----------><------>
101
+ // NoDestructor guard
102
+ //
103
+ //
104
+ // withDestructorGuarded = 000000000000D...FFFFFFFF
105
+ // <----------><------> // How debug info says it is
106
+ // WithDestructor guard
107
+ //
108
+ // <--------------><------> // How it actually is
109
+ // WithDestructor guard
110
+ //
99
111
let withDestructor = WithDestructorGuarded {
100
112
a : WithDestructor { x : 10 , y : 20 } ,
101
113
guard : -1
102
114
} ;
103
115
104
- // expected layout = xxxx....yyyyyyyyD.......D...
105
- // <--WithDestructor------>
106
- // <-------NestedInner-------->
107
- // <-------NestedOuter-------->
116
+ // expected layout (64 bit) = xxxx....yyyyyyyyD.......D...
117
+ // <--WithDestructor------>
118
+ // <-------NestedInner-------->
119
+ // <-------NestedOuter-------->
108
120
let nested = NestedOuter { a : NestedInner { a : WithDestructor { x : 7890 , y : 9870 } } } ;
109
121
110
122
zzz ( ) ;
0 commit comments