55
55
56
56
// cdb-command: dx wrapping_niche128_dataful
57
57
// cdb-check: wrapping_niche128_dataful : X [Type: enum2$<msvc_pretty_enums::Wrapping128Niche>]
58
- // cdb-check: [+0x000 ] __0 [Type: msvc_pretty_enums::Wrapping128]
58
+ // cdb-check: [+0x[...] ] __0 [Type: msvc_pretty_enums::Wrapping128]
59
59
60
60
// cdb-command: dx wrapping_niche128_none1
61
61
// cdb-check: wrapping_niche128_none1 : Y [Type: enum2$<msvc_pretty_enums::Wrapping128Niche>]
62
- // cdb-check: [+0x000 ] __0 [Type: msvc_pretty_enums::Wrapping128]
62
+ // cdb-check: [+0x[...] ] __0 [Type: msvc_pretty_enums::Wrapping128]
63
63
64
64
// cdb-command: dx wrapping_niche128_none2
65
65
// cdb-check: wrapping_niche128_none2 : Z [Type: enum2$<msvc_pretty_enums::Wrapping128Niche>]
66
- // cdb-check: [+0x000] __0 [Type: msvc_pretty_enums::Wrapping128]
66
+ // cdb-check: [+0x[...]] __0 [Type: msvc_pretty_enums::Wrapping128]
67
+
68
+ // cdb-command: dx direct_tag_128_a,d
69
+ // cdb-check: direct_tag_128_a,d : A [Type: enum2$<msvc_pretty_enums::DirectTag128>]
70
+ // cdb-check: [+0x[...]] __0 : 42 [Type: unsigned int]
71
+
72
+ // cdb-command: dx direct_tag_128_b,d
73
+ // cdb-check: direct_tag_128_b,d : B [Type: enum2$<msvc_pretty_enums::DirectTag128>]
74
+ // cdb-check: [+0x[...]] __0 : 137 [Type: unsigned int]
67
75
68
76
// cdb-command: dx niche_w_fields_1_some,d
69
77
// cdb-check: niche_w_fields_1_some,d : A [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields1>]
76
84
77
85
// cdb-command: dx niche_w_fields_2_some,d
78
86
// cdb-check: niche_w_fields_2_some,d : A [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields2>]
79
- // cdb-check: [<Raw View>] [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields2>]
80
87
// cdb-check: [+0x[...]] __0 : 800 [Type: core::num::nonzero::NonZeroU32]
81
88
// cdb-check: [+0x[...]] __1 : 900 [Type: unsigned __int64]
82
89
118
125
// cdb-check: niche_w_fields_std_result_err,d : Err [Type: enum2$<core::result::Result<alloc::boxed::Box<slice$<u8>,alloc::alloc::Global>,u64> >]
119
126
// cdb-check: [+0x[...]] __0 : 789 [Type: unsigned __int64]
120
127
128
+ // cdb-command: dx -r2 arbitrary_discr1,d
129
+ // cdb-check: arbitrary_discr1,d : Abc [Type: enum2$<msvc_pretty_enums::ArbitraryDiscr>]
130
+ // cdb-check: [+0x[...]] __0 : 1234 [Type: unsigned int]
131
+
132
+ // cdb-command: dx -r2 arbitrary_discr2,d
133
+ // cdb-check: arbitrary_discr2,d : Def [Type: enum2$<msvc_pretty_enums::ArbitraryDiscr>]
134
+ // cdb-check: [+0x[...]] __0 : 5678 [Type: unsigned int]
135
+
121
136
#![ feature( rustc_attrs) ]
137
+ #![ feature( repr128) ]
138
+ #![ feature( arbitrary_enum_discriminant) ]
122
139
123
140
use std:: num:: { NonZeroI128 , NonZeroU32 } ;
124
141
@@ -168,6 +185,18 @@ enum Wrapping128Niche {
168
185
Z ,
169
186
}
170
187
188
+ #[ repr( i128 ) ]
189
+ enum DirectTag128 {
190
+ A ( u32 ) ,
191
+ B ( u32 ) ,
192
+ }
193
+
194
+ #[ repr( u32 ) ]
195
+ enum ArbitraryDiscr {
196
+ Abc ( u32 ) = 1000 ,
197
+ Def ( u32 ) = 5000_000 ,
198
+ }
199
+
171
200
fn main ( ) {
172
201
let a = Some ( CStyleEnum :: Low ) ;
173
202
let b = Option :: < CStyleEnum > :: None ;
@@ -189,6 +218,9 @@ fn main() {
189
218
let wrapping_niche128_none1 = Wrapping128Niche :: Y ;
190
219
let wrapping_niche128_none2 = Wrapping128Niche :: Z ;
191
220
221
+ let direct_tag_128_a = DirectTag128 :: A ( 42 ) ;
222
+ let direct_tag_128_b = DirectTag128 :: B ( 137 ) ;
223
+
192
224
let niche_w_fields_1_some = NicheLayoutWithFields1 :: A ( & 77 , 7 ) ;
193
225
let niche_w_fields_1_none = NicheLayoutWithFields1 :: B ( 99 ) ;
194
226
@@ -205,6 +237,9 @@ fn main() {
205
237
let niche_w_fields_std_result_ok: Result < Box < [ u8 ] > , u64 > = Ok ( vec ! [ 1 , 2 , 3 ] . into ( ) ) ;
206
238
let niche_w_fields_std_result_err: Result < Box < [ u8 ] > , u64 > = Err ( 789 ) ;
207
239
240
+ let arbitrary_discr1 = ArbitraryDiscr :: Abc ( 1234 ) ;
241
+ let arbitrary_discr2 = ArbitraryDiscr :: Def ( 5678 ) ;
242
+
208
243
zzz ( ) ; // #break
209
244
}
210
245
0 commit comments