@@ -275,7 +275,7 @@ $EndFeature, "
275
275
```
276
276
" ) ,
277
277
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
278
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
278
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
279
279
#[ inline]
280
280
pub const fn count_ones( self ) -> u32 { ( self as $UnsignedT) . count_ones( ) }
281
281
}
@@ -291,7 +291,7 @@ Basic usage:
291
291
" , $Feature, "assert_eq!(" , stringify!( $SelfT) , "::max_value().count_zeros(), 1);" , $EndFeature, "
292
292
```" ) ,
293
293
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
294
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
294
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
295
295
#[ inline]
296
296
pub const fn count_zeros( self ) -> u32 {
297
297
( !self ) . count_ones( )
@@ -312,7 +312,7 @@ assert_eq!(n.leading_zeros(), 0);",
312
312
$EndFeature, "
313
313
```" ) ,
314
314
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
315
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
315
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
316
316
#[ inline]
317
317
pub const fn leading_zeros( self ) -> u32 {
318
318
( self as $UnsignedT) . leading_zeros( )
@@ -333,7 +333,7 @@ assert_eq!(n.trailing_zeros(), 2);",
333
333
$EndFeature, "
334
334
```" ) ,
335
335
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
336
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
336
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
337
337
#[ inline]
338
338
pub const fn trailing_zeros( self ) -> u32 {
339
339
( self as $UnsignedT) . trailing_zeros( )
@@ -404,7 +404,7 @@ let m = n.swap_bytes();
404
404
assert_eq!(m, " , $swapped, ");
405
405
```" ) ,
406
406
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
407
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
407
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
408
408
#[ inline]
409
409
pub const fn swap_bytes( self ) -> Self {
410
410
( self as $UnsignedT) . swap_bytes( ) as Self
@@ -454,7 +454,7 @@ if cfg!(target_endian = \"big\") {
454
454
$EndFeature, "
455
455
```" ) ,
456
456
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
457
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
457
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
458
458
#[ inline]
459
459
pub const fn from_be( x: Self ) -> Self {
460
460
#[ cfg( target_endian = "big" ) ]
@@ -488,7 +488,7 @@ if cfg!(target_endian = \"little\") {
488
488
$EndFeature, "
489
489
```" ) ,
490
490
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
491
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
491
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
492
492
#[ inline]
493
493
pub const fn from_le( x: Self ) -> Self {
494
494
#[ cfg( target_endian = "little" ) ]
@@ -522,7 +522,7 @@ if cfg!(target_endian = \"big\") {
522
522
$EndFeature, "
523
523
```" ) ,
524
524
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
525
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
525
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
526
526
#[ inline]
527
527
pub const fn to_be( self ) -> Self { // or not to be?
528
528
#[ cfg( target_endian = "big" ) ]
@@ -556,7 +556,7 @@ if cfg!(target_endian = \"little\") {
556
556
$EndFeature, "
557
557
```" ) ,
558
558
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
559
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
559
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
560
560
#[ inline]
561
561
pub const fn to_le( self ) -> Self {
562
562
#[ cfg( target_endian = "little" ) ]
@@ -2234,10 +2234,13 @@ Basic usage:
2234
2234
assert_eq!(n.count_ones(), 3);" , $EndFeature, "
2235
2235
```" ) ,
2236
2236
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2237
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
2237
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
2238
2238
#[ inline]
2239
2239
pub const fn count_ones( self ) -> u32 {
2240
+ #[ cfg( stage0) ]
2240
2241
unsafe { intrinsics:: ctpop( self as $ActualT) as u32 }
2242
+ #[ cfg( not( stage0) ) ]
2243
+ { intrinsics:: ctpop( self as $ActualT) as u32 }
2241
2244
}
2242
2245
}
2243
2246
@@ -2252,7 +2255,7 @@ Basic usage:
2252
2255
" , $Feature, "assert_eq!(" , stringify!( $SelfT) , "::max_value().count_zeros(), 0);" , $EndFeature, "
2253
2256
```" ) ,
2254
2257
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2255
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
2258
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
2256
2259
#[ inline]
2257
2260
pub const fn count_zeros( self ) -> u32 {
2258
2261
( !self ) . count_ones( )
@@ -2272,10 +2275,13 @@ Basic usage:
2272
2275
assert_eq!(n.leading_zeros(), 2);" , $EndFeature, "
2273
2276
```" ) ,
2274
2277
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2275
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
2278
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
2276
2279
#[ inline]
2277
2280
pub const fn leading_zeros( self ) -> u32 {
2281
+ #[ cfg( stage0) ]
2278
2282
unsafe { intrinsics:: ctlz( self as $ActualT) as u32 }
2283
+ #[ cfg( not( stage0) ) ]
2284
+ { intrinsics:: ctlz( self as $ActualT) as u32 }
2279
2285
}
2280
2286
}
2281
2287
@@ -2293,10 +2299,13 @@ Basic usage:
2293
2299
assert_eq!(n.trailing_zeros(), 3);" , $EndFeature, "
2294
2300
```" ) ,
2295
2301
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2296
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
2302
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
2297
2303
#[ inline]
2298
2304
pub const fn trailing_zeros( self ) -> u32 {
2305
+ #[ cfg( stage0) ]
2299
2306
unsafe { intrinsics:: cttz( self ) as u32 }
2307
+ #[ cfg( not( stage0) ) ]
2308
+ { intrinsics:: cttz( self ) as u32 }
2300
2309
}
2301
2310
}
2302
2311
@@ -2370,10 +2379,13 @@ let m = n.swap_bytes();
2370
2379
assert_eq!(m, " , $swapped, ");
2371
2380
```" ) ,
2372
2381
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2373
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
2382
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
2374
2383
#[ inline]
2375
2384
pub const fn swap_bytes( self ) -> Self {
2385
+ #[ cfg( stage0) ]
2376
2386
unsafe { intrinsics:: bswap( self as $ActualT) as Self }
2387
+ #[ cfg( not( stage0) ) ]
2388
+ { intrinsics:: bswap( self as $ActualT) as Self }
2377
2389
}
2378
2390
}
2379
2391
@@ -2393,10 +2405,13 @@ let m = n.reverse_bits();
2393
2405
assert_eq!(m, " , $reversed, ");
2394
2406
```" ) ,
2395
2407
#[ unstable( feature = "reverse_bits" , issue = "48763" ) ]
2396
- #[ rustc_const_unstable( feature = "const_int_conversion" ) ]
2408
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_conversion" ) ) ]
2397
2409
#[ inline]
2398
2410
pub const fn reverse_bits( self ) -> Self {
2411
+ #[ cfg( stage0) ]
2399
2412
unsafe { intrinsics:: bitreverse( self as $ActualT) as Self }
2413
+ #[ cfg( not( stage0) ) ]
2414
+ { intrinsics:: bitreverse( self as $ActualT) as Self }
2400
2415
}
2401
2416
}
2402
2417
@@ -2420,7 +2435,7 @@ if cfg!(target_endian = \"big\") {
2420
2435
}" , $EndFeature, "
2421
2436
```" ) ,
2422
2437
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2423
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
2438
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
2424
2439
#[ inline]
2425
2440
pub const fn from_be( x: Self ) -> Self {
2426
2441
#[ cfg( target_endian = "big" ) ]
@@ -2454,7 +2469,7 @@ if cfg!(target_endian = \"little\") {
2454
2469
}" , $EndFeature, "
2455
2470
```" ) ,
2456
2471
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2457
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
2472
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
2458
2473
#[ inline]
2459
2474
pub const fn from_le( x: Self ) -> Self {
2460
2475
#[ cfg( target_endian = "little" ) ]
@@ -2488,7 +2503,7 @@ if cfg!(target_endian = \"big\") {
2488
2503
}" , $EndFeature, "
2489
2504
```" ) ,
2490
2505
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2491
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
2506
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
2492
2507
#[ inline]
2493
2508
pub const fn to_be( self ) -> Self { // or not to be?
2494
2509
#[ cfg( target_endian = "big" ) ]
@@ -2522,7 +2537,7 @@ if cfg!(target_endian = \"little\") {
2522
2537
}" , $EndFeature, "
2523
2538
```" ) ,
2524
2539
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2525
- #[ rustc_const_unstable( feature = "const_int_ops" ) ]
2540
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_ops" ) ) ]
2526
2541
#[ inline]
2527
2542
pub const fn to_le( self ) -> Self {
2528
2543
#[ cfg( target_endian = "little" ) ]
@@ -2957,8 +2972,8 @@ $EndFeature, "
2957
2972
unsafe {
2958
2973
intrinsics:: overflowing_mul( self , rhs)
2959
2974
}
2960
- #[ cfg( not( stage0) ) ]
2961
- intrinsics:: overflowing_mul( self , rhs)
2975
+ #[ cfg( not( stage0) ) ]
2976
+ intrinsics:: overflowing_mul( self , rhs)
2962
2977
}
2963
2978
2964
2979
doc_comment! {
0 commit comments