diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-21 18:58:17 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-24 00:32:03 +0200 |
| commit | 49cbfa1a6f6469ddbc0e88161e52104cc87aea9b (patch) | |
| tree | af0abae0cbf18a6f7a19ae19e912bd5b7bee0805 /src/libsyntax/parse/parser/generics.rs | |
| parent | 04c661ba021730bc13d33c6d55cb9aad05026f36 (diff) | |
| download | rust-49cbfa1a6f6469ddbc0e88161e52104cc87aea9b.tar.gz rust-49cbfa1a6f6469ddbc0e88161e52104cc87aea9b.zip | |
pre-expansion gate const_generics
Diffstat (limited to 'src/libsyntax/parse/parser/generics.rs')
| -rw-r--r-- | src/libsyntax/parse/parser/generics.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser/generics.rs b/src/libsyntax/parse/parser/generics.rs index bfcb0042a75..51caae69c86 100644 --- a/src/libsyntax/parse/parser/generics.rs +++ b/src/libsyntax/parse/parser/generics.rs @@ -55,11 +55,15 @@ impl<'a> Parser<'a> { } fn parse_const_param(&mut self, preceding_attrs: Vec<Attribute>) -> PResult<'a, GenericParam> { + let lo = self.token.span; + self.expect_keyword(kw::Const)?; let ident = self.parse_ident()?; self.expect(&token::Colon)?; let ty = self.parse_ty()?; + self.sess.gated_spans.const_generics.borrow_mut().push(lo.to(self.prev_span)); + Ok(GenericParam { ident, id: ast::DUMMY_NODE_ID, |
