53
53
// cdb-command: dx niche128_none
54
54
// cdb-check: niche128_none : None [Type: enum2$<core::option::Option<core::num::nonzero::NonZeroI128> >]
55
55
56
+ // cdb-command: dx wrapping_niche128_dataful
57
+ // cdb-check: wrapping_niche128_dataful : X [Type: enum2$<msvc_pretty_enums::Wrapping128Niche>]
58
+ // cdb-check: [+0x000] __0 [Type: msvc_pretty_enums::Wrapping128]
59
+
60
+ // cdb-command: dx wrapping_niche128_none1
61
+ // cdb-check: wrapping_niche128_none1 : Y [Type: enum2$<msvc_pretty_enums::Wrapping128Niche>]
62
+ // cdb-check: [+0x000] __0 [Type: msvc_pretty_enums::Wrapping128]
63
+
64
+ // cdb-command: dx wrapping_niche128_none2
65
+ // cdb-check: wrapping_niche128_none2 : Z [Type: enum2$<msvc_pretty_enums::Wrapping128Niche>]
66
+ // cdb-check: [+0x000] __0 [Type: msvc_pretty_enums::Wrapping128]
67
+
56
68
// cdb-command: dx niche_w_fields_1_some,d
57
69
// cdb-check: niche_w_fields_1_some,d : A [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields1>]
58
70
// cdb-check: [+0x[...]] __0 : 0x[...] : 77 [Type: unsigned char *]
64
76
65
77
// cdb-command: dx niche_w_fields_2_some,d
66
78
// 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>]
67
80
// cdb-check: [+0x[...]] __0 : 800 [Type: core::num::nonzero::NonZeroU32]
68
81
// cdb-check: [+0x[...]] __1 : 900 [Type: unsigned __int64]
69
82
105
118
// cdb-check: niche_w_fields_std_result_err,d : Err [Type: enum2$<core::result::Result<alloc::boxed::Box<slice$<u8>,alloc::alloc::Global>,u64> >]
106
119
// cdb-check: [+0x[...]] __0 : 789 [Type: unsigned __int64]
107
120
121
+ #![ feature( rustc_attrs) ]
122
+
108
123
use std:: num:: { NonZeroI128 , NonZeroU32 } ;
109
124
110
125
pub enum CStyleEnum {
@@ -141,6 +156,18 @@ enum NicheLayoutWithFields3 {
141
156
F ,
142
157
}
143
158
159
+ #[ rustc_layout_scalar_valid_range_start( 340282366920938463463374607431768211454 ) ]
160
+ #[ rustc_layout_scalar_valid_range_end( 1 ) ]
161
+ #[ repr( transparent) ]
162
+ struct Wrapping128 ( u128 ) ;
163
+
164
+ // #[rustc_layout(debug)]
165
+ enum Wrapping128Niche {
166
+ X ( Wrapping128 ) ,
167
+ Y ,
168
+ Z ,
169
+ }
170
+
144
171
fn main ( ) {
145
172
let a = Some ( CStyleEnum :: Low ) ;
146
173
let b = Option :: < CStyleEnum > :: None ;
@@ -157,6 +184,11 @@ fn main() {
157
184
let niche128_some = Some ( NonZeroI128 :: new ( 123456 ) . unwrap ( ) ) ;
158
185
let niche128_none: Option < NonZeroI128 > = None ;
159
186
187
+ let wrapping_niche128_dataful =
188
+ unsafe { Wrapping128Niche :: X ( Wrapping128 ( 340282366920938463463374607431768211454 ) ) } ;
189
+ let wrapping_niche128_none1 = Wrapping128Niche :: Y ;
190
+ let wrapping_niche128_none2 = Wrapping128Niche :: Z ;
191
+
160
192
let niche_w_fields_1_some = NicheLayoutWithFields1 :: A ( & 77 , 7 ) ;
161
193
let niche_w_fields_1_none = NicheLayoutWithFields1 :: B ( 99 ) ;
162
194
0 commit comments