about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser/generics.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-10-25 06:18:09 +0200
committerGitHub <noreply@github.com>2019-10-25 06:18:09 +0200
commitd6a18b6baf40b48abce2de5747d187a7bbad293d (patch)
treec633afa2e2d4a69ce731623362fad60a23e526bb /src/libsyntax/parse/parser/generics.rs
parentfb602c7e4f5f01203c63e9c6939efa8c8f7c962a (diff)
parent15a6c09b6e8a977f2c6f5a73de01a20d00b37930 (diff)
downloadrust-d6a18b6baf40b48abce2de5747d187a7bbad293d.tar.gz
rust-d6a18b6baf40b48abce2de5747d187a7bbad293d.zip
Rollup merge of #65742 - Centril:gate-pre-expansion-subset, r=davidtwco
Pre-expansion gate most of the things

This is a subset of https://github.com/rust-lang/rust/pull/64672. A crater run has already been done and this PR implements conclusions according to https://github.com/rust-lang/rust/pull/64672#issuecomment-542703363.

r? @davidtwco
cc @petrochenkov
Diffstat (limited to 'src/libsyntax/parse/parser/generics.rs')
-rw-r--r--src/libsyntax/parse/parser/generics.rs4
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,