TokenStream in rustc_ast::tokenstream - Rust (original) (raw)
Struct TokenStream
pub struct TokenStream(pub(crate) Arc<Vec<TokenTree>>);Expand description
A TokenStream is an abstract sequence of tokens, organized into TokenTrees.
Create a token stream containing a single token with alone spacing. The spacing used for the final token in a constructed stream doesn’t matter because it’s never used. In practice we arbitrarily useSpacing::Alone.
Push tt onto the end of the stream, possibly gluing it to the last token. Uses make_mut to maximize efficiency.
Push stream onto the end of the stream, possibly gluing the first token tree to the last token. (No other token trees will be glued.) Uses make_mut to maximize efficiency.
Desugar doc comments like /// foo in the stream into #[doc = r"foo"]. Modifies the TokenStream via Arc::make_mut, but as little as possible.
Given a TokenStream with a Stream of only two arguments, return a new TokenStreamseparating the two arguments with a comma for diagnostic suggestions.
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes