File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -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+ pattern_type ! ( u128 is 340282366920938463463374607431768211454 ..=u128 :: MAX | 0 ..=1 ) ,
276+ ) ;
277277
278278enum Wrapping128Niche {
279279 X ( Wrapping128 ) ,
@@ -325,8 +325,11 @@ 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 = unsafe {
329+ Wrapping128Niche :: X ( Wrapping128 ( unsafe {
330+ std:: mem:: transmute ( 340282366920938463463374607431768211454 )
331+ } ) )
332+ } ;
330333 let wrapping_niche128_none1 = Wrapping128Niche :: Y ;
331334 let wrapping_niche128_none2 = Wrapping128Niche :: Z ;
332335
You can’t perform that action at this time.
0 commit comments