Skip to content

Commit

Permalink
Add a comment on TokenKind::Interpolated.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed May 4, 2022
1 parent 99f5945 commit baa18c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,15 @@ pub enum TokenKind {
/// treat regular and interpolated lifetime identifiers in the same way.
Lifetime(Symbol),

/// An embedded AST node, as produced by a macro. This only exists for
/// historical reasons. We'd like to get rid of it, for multiple reasons.
/// - It's conceptually very strange. Saying a token can contain an AST
/// node is like saying, in natural language, that a word can contain a
/// sentence.
/// - It requires special handling in a bunch of places in the parser.
/// - It prevents `Token` from implementing `Copy`.
/// It adds complexity and likely slows things down. Please don't add new
/// occurrences of this token kind!
Interpolated(Lrc<Nonterminal>),

/// A doc comment token.
Expand Down

0 comments on commit baa18c0

Please sign in to comment.