Auto merge of #85359 - lrh2000:reserved-prefixes, r=nikomatsakis
Reserve prefixed identifiers and literals (RFC 3101) This PR denies any identifiers immediately followed by one of three tokens `"`, `'` or `#`, which is stricter than the requirements of RFC 3101 but may be necessary according to the discussion at [Zulip]. [Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/268952-edition-2021/topic/reserved.20prefixes/near/238470099 The tracking issue #84599 says we'll add a feature gate named `reserved_prefixes`, but I don't think I can do this because it is impossible for the lexer to know whether a feature is enabled or not. I guess determining the behavior by the edition information should be enough. Fixes #84599
This commit is contained in:
commit
e8cb1a4a56
16 changed files with 518 additions and 9 deletions
|
|
@ -413,7 +413,7 @@ impl<'a> Classifier<'a> {
|
|||
},
|
||||
c => c,
|
||||
},
|
||||
TokenKind::RawIdent => Class::Ident,
|
||||
TokenKind::RawIdent | TokenKind::UnknownPrefix => Class::Ident,
|
||||
TokenKind::Lifetime { .. } => Class::Lifetime,
|
||||
};
|
||||
// Anything that didn't return above is the simple case where we the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue