Struct rustc_ap_rustc_parse::parser::AttrWrapper[][src]

pub struct AttrWrapper { /* fields omitted */ }

A wrapper type to ensure that the parser handles outer attributes correctly. When we parse outer attributes, we need to ensure that we capture tokens for the attribute target. This allows us to perform cfg-expansion on a token stream before we invoke a derive proc-macro.

This wrapper prevents direct access to the underlying Vec<ast::Attribute>. Parsing code can only get access to the underlying attributes by passing an AttrWrapper to collect_tokens_trailing_tokens. This makes it difficult to accidentally construct an AST node (which stores a Vec<ast::Attribute>) without first collecting tokens.

This struct has its own module, to ensure that the parser code cannot directly access the attrs field

Implementations

impl AttrWrapper[src]

pub fn empty() -> AttrWrapper[src]

pub fn new(attrs: Vec<Attribute>) -> AttrWrapper[src]

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

Trait Implementations

impl Clone for AttrWrapper[src]

impl Debug for AttrWrapper[src]

Auto Trait Implementations

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<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

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

impl<T> Instrument for T[src]

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

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

type Error = !

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,