Struct rustc_expand::config::StripUnconfigured[−][src]

pub struct StripUnconfigured<'a> {
    pub sess: &'a Session,
    pub features: Option<&'a Features>,
    pub modified: bool,
}

A folder that strips out items that do not belong in the current configuration.

Fields

sess: &'a Sessionfeatures: Option<&'a Features>modified: bool

Implementations

impl<'a> StripUnconfigured<'a>[src]

pub fn configure<T: AstLike>(&mut self, node: T) -> Option<T>[src]

fn configure_krate_attrs(
    &mut self,
    attrs: Vec<Attribute>
) -> Option<Vec<Attribute>>
[src]

fn process_cfg_attrs<T: AstLike>(&mut self, node: &mut T)[src]

Parse and expand all cfg_attr attributes into a list of attributes that are within each cfg_attr that has a true configuration predicate.

Gives compiler warnings if any cfg_attr does not contain any attributes and is in the original source code. Gives compiler errors if the syntax of any cfg_attr is incorrect.

fn process_cfg_attr(&mut self, attr: Attribute) -> Vec<Attribute>[src]

Parse and expand a single cfg_attr attribute into a list of attributes when the configuration predicate is true, or otherwise expand into an empty list of attributes.

Gives a compiler warning when the cfg_attr contains no attributes and is in the original source file. Gives a compiler error if the syntax of the attribute is incorrect.

fn parse_cfg_attr(
    &self,
    attr: &Attribute
) -> Option<(MetaItem, Vec<(AttrItem, Span)>)>
[src]

fn error_malformed_cfg_attr_missing(&self, span: Span)[src]

fn in_cfg(&self, attrs: &[Attribute]) -> bool[src]

Determines if a node with the given attributes should be included in this configuration.

pub(crate) fn maybe_emit_expr_attr_err(&self, attr: &Attribute)[src]

If attributes are not allowed on expressions, emit an error for attr

pub fn configure_expr(&mut self, expr: &mut P<Expr>)[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for StripUnconfigured<'a>

impl<'a> !Send for StripUnconfigured<'a>

impl<'a> !Sync for StripUnconfigured<'a>

impl<'a> Unpin for StripUnconfigured<'a>

impl<'a> !UnwindSafe for StripUnconfigured<'a>

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, 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.