File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 232232
233233//@ cdb-command: dx c_style_i128_d
234234//@ cdb-check: c_style_i128_d : D [Type: enum2$<msvc_pretty_enums::CStyleI128>]
235- #![ feature( rustc_attrs ) ]
235+ #![ feature( pattern_types , pattern_type_macro ) ]
236236
237237use std:: num:: NonZero ;
238238
@@ -270,10 +270,10 @@ enum NicheLayoutWithFields3 {
270270 F ,
271271}
272272
273- #[ rustc_layout_scalar_valid_range_start( 340282366920938463463374607431768211454 ) ]
274- #[ rustc_layout_scalar_valid_range_end( 1 ) ]
275273#[ repr( transparent) ]
276- struct Wrapping128 ( u128 ) ;
274+ struct Wrapping128 (
275+ std:: pat:: pattern_type!( i128 is -2 ..=1 ) ,
276+ ) ;
277277
278278enum Wrapping128Niche {
279279 X ( Wrapping128 ) ,
@@ -325,8 +325,9 @@ fn main() {
325325 let niche128_some = NonZero :: new ( 123456i128 ) ;
326326 let niche128_none: Option < NonZero < i128 > > = None ;
327327
328- let wrapping_niche128_untagged =
329- unsafe { Wrapping128Niche :: X ( Wrapping128 ( 340282366920938463463374607431768211454 ) ) } ;
328+ let wrapping_niche128_untagged = Wrapping128Niche :: X ( Wrapping128 ( unsafe {
329+ std:: mem:: transmute ( 340282366920938463463374607431768211454_u128 )
330+ } ) ) ;
330331 let wrapping_niche128_none1 = Wrapping128Niche :: Y ;
331332 let wrapping_niche128_none2 = Wrapping128Niche :: Z ;
332333
You can’t perform that action at this time.
0 commit comments