You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2
+
// file at the top-level directory of this distribution and at
3
+
// http://rust-lang.org/COPYRIGHT.
4
+
//
5
+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+
// option. This file may not be copied, modified, or distributed
9
+
// except according to those terms.
10
+
11
+
// xfail-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
12
+
13
+
// compile-flags:-Z extra-debug-info
14
+
// debugger:set print pretty off
15
+
// debugger:break zzz
16
+
// debugger:run
17
+
// debugger:finish
18
+
19
+
// debugger:print packed
20
+
// check:$1 = {x = 123, y = 234, z = 345}
21
+
22
+
// debugger:print packedInPacked
23
+
// check:$2 = {a = 1111, b = {x = 2222, y = 3333, z = 4444}, c = 5555, d = {x = 6666, y = 7777, z = 8888}}
24
+
25
+
// debugger:print packedInUnpacked
26
+
// check:$3 = {a = -1111, b = {x = -2222, y = -3333, z = -4444}, c = -5555, d = {x = -6666, y = -7777, z = -8888}}
27
+
28
+
// debugger:print unpackedInPacked
29
+
// check:$4 = {a = 987, b = {x = 876, y = 765, z = 654}, c = {x = 543, y = 432, z = 321}, d = 210}
30
+
31
+
32
+
// debugger:print packedInPackedWithDrop
33
+
// check:$5 = {a = 11, b = {x = 22, y = 33, z = 44}, c = 55, d = {x = 66, y = 77, z = 88}}
34
+
35
+
// debugger:print packedInUnpackedWithDrop
36
+
// check:$6 = {a = -11, b = {x = -22, y = -33, z = -44}, c = -55, d = {x = -66, y = -77, z = -88}}
37
+
38
+
// debugger:print unpackedInPackedWithDrop
39
+
// check:$7 = {a = 98, b = {x = 87, y = 76, z = 65}, c = {x = 54, y = 43, z = 32}, d = 21}
40
+
41
+
// debugger:print deeplyNested
42
+
// check:$8 = {a = {a = 1, b = {x = 2, y = 3, z = 4}, c = 5, d = {x = 6, y = 7, z = 8}}, b = {a = 9, b = {x = 10, y = 11, z = 12}, c = {x = 13, y = 14, z = 15}, d = 16}, c = {a = 17, b = {x = 18, y = 19, z = 20}, c = 21, d = {x = 22, y = 23, z = 24}}, d = {a = 25, b = {x = 26, y = 27, z = 28}, c = 29, d = {x = 30, y = 31, z = 32}}, e = {a = 33, b = {x = 34, y = 35, z = 36}, c = {x = 37, y = 38, z = 39}, d = 40}, f = {a = 41, b = {x = 42, y = 43, z = 44}, c = 45, d = {x = 46, y = 47, z = 48}}}
43
+
44
+
#[packed]
45
+
structPacked{
46
+
x:i16,
47
+
y:i32,
48
+
z:i64
49
+
}
50
+
51
+
implDropforPacked{
52
+
fndrop(&self){}
53
+
}
54
+
55
+
#[packed]
56
+
structPackedInPacked{
57
+
a:i32,
58
+
b:Packed,
59
+
c:i64,
60
+
d:Packed
61
+
}
62
+
63
+
structPackedInUnpacked{
64
+
a:i32,
65
+
b:Packed,
66
+
c:i64,
67
+
d:Packed
68
+
}
69
+
70
+
structUnpacked{
71
+
x:i64,
72
+
y:i32,
73
+
z:i16
74
+
}
75
+
76
+
implDropforUnpacked{
77
+
fndrop(&self){}
78
+
}
79
+
80
+
#[packed]
81
+
structUnpackedInPacked{
82
+
a:i16,
83
+
b:Unpacked,
84
+
c:Unpacked,
85
+
d:i64
86
+
}
87
+
88
+
#[packed]
89
+
structPackedInPackedWithDrop{
90
+
a:i32,
91
+
b:Packed,
92
+
c:i64,
93
+
d:Packed
94
+
}
95
+
96
+
implDropforPackedInPackedWithDrop{
97
+
fndrop(&self){}
98
+
}
99
+
100
+
structPackedInUnpackedWithDrop{
101
+
a:i32,
102
+
b:Packed,
103
+
c:i64,
104
+
d:Packed
105
+
}
106
+
107
+
implDropforPackedInUnpackedWithDrop{
108
+
fndrop(&self){}
109
+
}
110
+
111
+
#[packed]
112
+
structUnpackedInPackedWithDrop{
113
+
a:i16,
114
+
b:Unpacked,
115
+
c:Unpacked,
116
+
d:i64
117
+
}
118
+
119
+
implDropforUnpackedInPackedWithDrop{
120
+
fndrop(&self){}
121
+
}
122
+
123
+
structDeeplyNested{
124
+
a:PackedInPacked,
125
+
b:UnpackedInPackedWithDrop,
126
+
c:PackedInUnpacked,
127
+
d:PackedInUnpackedWithDrop,
128
+
e:UnpackedInPacked,
129
+
f:PackedInPackedWithDrop
130
+
}
131
+
132
+
fnmain(){
133
+
let packed = Packed{x:123,y:234,z:345};
134
+
135
+
let packedInPacked = PackedInPacked{
136
+
a:1111,
137
+
b:Packed{x:2222,y:3333,z:4444},
138
+
c:5555,
139
+
d:Packed{x:6666,y:7777,z:8888}
140
+
};
141
+
142
+
let packedInUnpacked = PackedInUnpacked{
143
+
a: -1111,
144
+
b:Packed{x: -2222,y: -3333,z: -4444},
145
+
c: -5555,
146
+
d:Packed{x: -6666,y: -7777,z: -8888}
147
+
};
148
+
149
+
let unpackedInPacked = UnpackedInPacked{
150
+
a:987,
151
+
b:Unpacked{x:876,y:765,z:654},
152
+
c:Unpacked{x:543,y:432,z:321},
153
+
d:210
154
+
};
155
+
156
+
let packedInPackedWithDrop = PackedInPackedWithDrop{
157
+
a:11,
158
+
b:Packed{x:22,y:33,z:44},
159
+
c:55,
160
+
d:Packed{x:66,y:77,z:88}
161
+
};
162
+
163
+
let packedInUnpackedWithDrop = PackedInUnpackedWithDrop{
164
+
a: -11,
165
+
b:Packed{x: -22,y: -33,z: -44},
166
+
c: -55,
167
+
d:Packed{x: -66,y: -77,z: -88}
168
+
};
169
+
170
+
let unpackedInPackedWithDrop = UnpackedInPackedWithDrop{
0 commit comments