File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11/// A simple static assertion macro. The first argument should be a unique
22/// ALL_CAPS identifier that describes the condition.
33#[ macro_export]
4- #[ allow_internal_unstable( type_ascription) ]
4+ #[ allow_internal_unstable( type_ascription, underscore_const_names ) ]
55macro_rules! static_assert {
6- ( $name : ident : $ test: expr) => {
6+ ( $test: expr) => {
77 // Use the bool to access an array such that if the bool is false, the access
88 // is out-of-bounds.
99 #[ allow( dead_code) ]
10- static $name : ( ) = [ ( ) ] [ !( $test: bool ) as usize ] ;
10+ const _ : ( ) = [ ( ) ] [ !( $test: bool ) as usize ] ;
1111 }
1212}
1313
Original file line number Diff line number Diff line change @@ -544,14 +544,14 @@ impl Qualif for IsNotImplicitlyPromotable {
544544// Ensure the `IDX` values are sequential (`0..QUALIF_COUNT`).
545545macro_rules! static_assert_seq_qualifs {
546546 ( $i: expr => $first: ident $( , $rest: ident) * ) => {
547- static_assert!( SEQ_QUALIFS : {
547+ static_assert!( {
548548 static_assert_seq_qualifs!( $i + 1 => $( $rest) ,* ) ;
549549
550550 $first:: IDX == $i
551551 } ) ;
552552 } ;
553553 ( $i: expr =>) => {
554- static_assert!( SEQ_QUALIFS : QUALIF_COUNT == $i) ;
554+ static_assert!( QUALIF_COUNT == $i) ;
555555 } ;
556556}
557557static_assert_seq_qualifs ! (
You can’t perform that action at this time.
0 commit comments