Gate against auto traits pre-expansion
This commit is contained in:
parent
5333b878c8
commit
7815641be0
5 changed files with 29 additions and 1 deletions
|
@ -813,7 +813,12 @@ impl<'a> Parser<'a> {
|
|||
fn parse_item_trait(&mut self, attrs: &mut AttrVec, lo: Span) -> PResult<'a, ItemInfo> {
|
||||
let unsafety = self.parse_unsafety(Case::Sensitive);
|
||||
// Parse optional `auto` prefix.
|
||||
let is_auto = if self.eat_keyword(kw::Auto) { IsAuto::Yes } else { IsAuto::No };
|
||||
let is_auto = if self.eat_keyword(kw::Auto) {
|
||||
self.sess.gated_spans.gate(sym::auto_traits, self.prev_token.span);
|
||||
IsAuto::Yes
|
||||
} else {
|
||||
IsAuto::No
|
||||
};
|
||||
|
||||
self.expect_keyword(kw::Trait)?;
|
||||
let ident = self.parse_ident()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue