File tree 3 files changed +17
-3
lines changed
3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -1138,9 +1138,7 @@ impl<'a> State<'a> {
1138
1138
fn print_expr_anon_const ( & mut self , anon_const : & hir:: AnonConst ) {
1139
1139
self . ibox ( INDENT_UNIT ) ;
1140
1140
self . s . word_space ( "const" ) ;
1141
- self . s . word ( "{" ) ;
1142
1141
self . print_anon_const ( anon_const) ;
1143
- self . s . word ( "}" ) ;
1144
1142
self . end ( )
1145
1143
}
1146
1144
Original file line number Diff line number Diff line change @@ -548,7 +548,11 @@ impl<'a> Parser<'a> {
548
548
549
549
fn check_inline_const ( & mut self ) -> bool {
550
550
self . check_keyword ( kw:: Const )
551
- && self . look_ahead ( 1 , |t| t == & token:: OpenDelim ( DelimToken :: Brace ) )
551
+ && self . look_ahead ( 1 , |t| match t. kind {
552
+ token:: Interpolated ( ref nt) => matches ! ( * * nt, token:: NtBlock ( ..) ) ,
553
+ token:: OpenDelim ( DelimToken :: Brace ) => true ,
554
+ _ => false ,
555
+ } )
552
556
}
553
557
554
558
/// Checks to see if the next token is either `+` or `+=`.
Original file line number Diff line number Diff line change
1
+ // run-pass
2
+
3
+ #![ allow( incomplete_features) ]
4
+ #![ feature( inline_const) ]
5
+ macro_rules! do_const_block{
6
+ ( $val: block) => { const $val }
7
+ }
8
+
9
+ fn main ( ) {
10
+ let s = do_const_block ! ( { 22 } ) ;
11
+ assert_eq ! ( s, 22 ) ;
12
+ }
You can’t perform that action at this time.
0 commit comments