File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 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> {
11381138 fn print_expr_anon_const ( & mut self , anon_const : & hir:: AnonConst ) {
11391139 self . ibox ( INDENT_UNIT ) ;
11401140 self . s . word_space ( "const" ) ;
1141- self . s . word ( "{" ) ;
11421141 self . print_anon_const ( anon_const) ;
1143- self . s . word ( "}" ) ;
11441142 self . end ( )
11451143 }
11461144
Original file line number Diff line number Diff line change @@ -548,7 +548,11 @@ impl<'a> Parser<'a> {
548548
549549 fn check_inline_const ( & mut self ) -> bool {
550550 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+ } )
552556 }
553557
554558 /// 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