Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 82a609f

Browse files
committedMar 20, 2024
Shrink the comment on TokenTree.
It uses very old language that is more confusing today than helpful, including references to `SubstNt` that no longer exists. The comment above `TokenStream` is better, and suffices for a basic understanding of these types.
1 parent a94bb2a commit 82a609f

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed
 

‎compiler/rustc_ast/src/tokenstream.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,7 @@ use smallvec::{smallvec, SmallVec};
2828
use std::borrow::Cow;
2929
use std::{cmp, fmt, iter};
3030

31-
/// When the main Rust parser encounters a syntax-extension invocation, it
32-
/// parses the arguments to the invocation as a token tree. This is a very
33-
/// loose structure, such that all sorts of different AST fragments can
34-
/// be passed to syntax extensions using a uniform type.
35-
///
36-
/// If the syntax extension is an MBE macro, it will attempt to match its
37-
/// LHS token tree against the provided token tree, and if it finds a
38-
/// match, will transcribe the RHS token tree, splicing in any captured
39-
/// `macro_parser::matched_nonterminals` into the `SubstNt`s it finds.
40-
///
41-
/// The RHS of an MBE macro is the only place `SubstNt`s are substituted.
42-
/// Nothing special happens to misnamed or misplaced `SubstNt`s.
31+
/// Part of a `TokenStream`.
4332
#[derive(Debug, Clone, PartialEq, Encodable, Decodable, HashStable_Generic)]
4433
pub enum TokenTree {
4534
/// A single token. Should never be `OpenDelim` or `CloseDelim`, because

0 commit comments

Comments
 (0)
Please sign in to comment.