TokenStream in rustc_ast::tokenstream - Rust (original) (raw)

Struct TokenStream

Source

pub struct TokenStream(pub(crate) Arc<Vec<TokenTree>>);

Expand description

A TokenStream is an abstract sequence of tokens, organized into TokenTrees.

Source§

Source

Source

Source

Source

Source

Source

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.

Source

Source

Source

Push tt onto the end of the stream, possibly gluing it to the last token. Uses make_mut to maximize efficiency.

Source

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.

Source

Desugar doc comments like /// foo in the stream into #[doc = r"foo"]. Modifies the TokenStream via Arc::make_mut, but as little as possible.

Source

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