5353// cdb-command: dx niche128_none
5454// cdb-check: niche128_none : None [Type: enum2$<core::option::Option<core::num::nonzero::NonZeroI128> >]
5555
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+
5668// cdb-command: dx niche_w_fields_1_some,d
5769// cdb-check: niche_w_fields_1_some,d : A [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields1>]
5870// cdb-check: [+0x[...]] __0 : 0x[...] : 77 [Type: unsigned char *]
6476
6577// cdb-command: dx niche_w_fields_2_some,d
6678// 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>]
6780// cdb-check: [+0x[...]] __0 : 800 [Type: core::num::nonzero::NonZeroU32]
6881// cdb-check: [+0x[...]] __1 : 900 [Type: unsigned __int64]
6982
105118// cdb-check: niche_w_fields_std_result_err,d : Err [Type: enum2$<core::result::Result<alloc::boxed::Box<slice$<u8>,alloc::alloc::Global>,u64> >]
106119// cdb-check: [+0x[...]] __0 : 789 [Type: unsigned __int64]
107120
121+ #![ feature( rustc_attrs) ]
122+
108123use std:: num:: { NonZeroI128 , NonZeroU32 } ;
109124
110125pub enum CStyleEnum {
@@ -141,6 +156,18 @@ enum NicheLayoutWithFields3 {
141156 F ,
142157}
143158
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+
144171fn main ( ) {
145172 let a = Some ( CStyleEnum :: Low ) ;
146173 let b = Option :: < CStyleEnum > :: None ;
@@ -157,6 +184,11 @@ fn main() {
157184 let niche128_some = Some ( NonZeroI128 :: new ( 123456 ) . unwrap ( ) ) ;
158185 let niche128_none: Option < NonZeroI128 > = None ;
159186
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+
160192 let niche_w_fields_1_some = NicheLayoutWithFields1 :: A ( & 77 , 7 ) ;
161193 let niche_w_fields_1_none = NicheLayoutWithFields1 :: B ( 99 ) ;
162194
0 commit comments