Split inline const to two feature gates

This commit is contained in:
Gary Guo 2021-11-22 16:25:28 +00:00
parent cebd2dda1d
commit 6d61d87b22
21 changed files with 67 additions and 31 deletions

View file

@ -1095,8 +1095,12 @@ impl<'a> Parser<'a> {
}
/// Parses inline const expressions.
fn parse_const_block(&mut self, span: Span) -> PResult<'a, P<Expr>> {
self.sess.gated_spans.gate(sym::inline_const, span);
fn parse_const_block(&mut self, span: Span, pat: bool) -> PResult<'a, P<Expr>> {
if pat {
self.sess.gated_spans.gate(sym::inline_const_pat, span);
} else {
self.sess.gated_spans.gate(sym::inline_const, span);
}
self.eat_keyword(kw::Const);
let blk = self.parse_block()?;
let anon_const = AnonConst {