[−][src]Enum rustc_ast::token::Nonterminal

pub enum Nonterminal {
    NtItem(P<Item>),
    NtBlock(P<Block>),
    NtStmt(Stmt),
    NtPat(P<Pat>),
    NtExpr(P<Expr>),
    NtTy(P<Ty>),
    NtIdent(Ident, bool),
    NtLifetime(Ident),
    NtLiteral(P<Expr>),
    NtMeta(P<AttrItem>),
    NtPath(Path),
    NtVis(Visibility),
    NtTT(TokenTree),
}

For interpolation during macro expansion.

Variants

NtItem(P<Item>)
NtBlock(P<Block>)
NtStmt(Stmt)
NtPat(P<Pat>)
NtExpr(P<Expr>)
NtTy(P<Ty>)
NtIdent(Ident, bool)
NtLifetime(Ident)
NtLiteral(P<Expr>)
NtMeta(P<AttrItem>)

Stuff inside brackets for attributes

NtPath(Path)
NtVis(Visibility)
NtTT(TokenTree)

Implementations

impl Nonterminal[src]

pub(in token) fn span(
    &self
) -> Span
[src]

pub fn pretty_printing_compatibility_hack(&self) -> bool[src]

This nonterminal looks like some specific enums from proc-macro-hack and procedural-masquerade crates. We need to maintain some special pretty-printing behavior for them due to incorrect asserts in old versions of those crates and their wide use in the ecosystem. See issue #73345 for more details. FIXME(#73933): Remove this eventually.

pub fn ident_name_compatibility_hack(
    &self,
    orig_span: Span,
    source_map: &SourceMap
) -> Option<(Ident, bool)>
[src]

Trait Implementations

impl Clone for Nonterminal[src]

impl Debug for Nonterminal[src]

impl<__D: Decoder> Decodable<__D> for Nonterminal[src]

impl<__E: Encoder> Encodable<__E> for Nonterminal[src]

impl<CTX> HashStable<CTX> for Nonterminal where
    CTX: HashStableContext, 
[src]

impl PartialEq<Nonterminal> for Nonterminal[src]

Auto Trait Implementations

impl !RefUnwindSafe for Nonterminal

impl !Send for Nonterminal

impl !Sync for Nonterminal

impl Unpin for Nonterminal

impl !UnwindSafe for Nonterminal

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.