File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -5250,9 +5250,13 @@ impl<'a> Parser<'a> {
52505250                    // FIXME(const_generics): to distinguish between idents for types and consts, 
52515251                    // we should introduce a GenericArg::Ident in the AST and distinguish when 
52525252                    // lowering to the HIR. For now, idents for const args are not permitted. 
5253-                     return  Err ( 
5254-                         self . fatal ( "identifiers may currently not be used for const generics" ) 
5255-                     ) ; 
5253+                     if  self . token . is_keyword ( kw:: True )  || self . token . is_keyword ( kw:: False )  { 
5254+                         self . parse_literal_maybe_minus ( ) ?
5255+                     }  else  { 
5256+                         return  Err ( 
5257+                             self . fatal ( "identifiers may currently not be used for const generics" ) 
5258+                         ) ; 
5259+                     } 
52565260                }  else  { 
52575261                    self . parse_literal_maybe_minus ( ) ?
52585262                } ; 
Original file line number Diff line number Diff line change @@ -7,4 +7,6 @@ trait IsZeroTrait<const IS_ZERO: bool>{}
77
88impl  IsZeroTrait < { 0u8  == 0u8 } >  for  ( )  { } 
99
10+ impl  IsZeroTrait < true >  for  ( ( ) , )  { } 
11+ 
1012fn  main ( )  { } 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments