File tree 2 files changed +9
-3
lines changed
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> {
5250
5250
// FIXME(const_generics): to distinguish between idents for types and consts,
5251
5251
// we should introduce a GenericArg::Ident in the AST and distinguish when
5252
5252
// 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
+ }
5256
5260
} else {
5257
5261
self . parse_literal_maybe_minus ( ) ?
5258
5262
} ;
Original file line number Diff line number Diff line change @@ -7,4 +7,6 @@ trait IsZeroTrait<const IS_ZERO: bool>{}
7
7
8
8
impl IsZeroTrait < { 0u8 == 0u8 } > for ( ) { }
9
9
10
+ impl IsZeroTrait < true > for ( ( ) , ) { }
11
+
10
12
fn main ( ) { }
You can’t perform that action at this time.
0 commit comments