pre-expansion gate const_generics

This commit is contained in:
Mazdak Farrokhzad 2019-09-21 18:58:17 +02:00
parent 04c661ba02
commit 49cbfa1a6f
9 changed files with 37 additions and 26 deletions

View file

@ -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,