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

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

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

Fields

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

Implementations

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

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

pub fn process_cfg_attrs<T: HasAttrs>(&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.

pub(in config) 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.

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

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

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

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

pub(in config) fn visit_expr_attrs(
    &mut self,
    attrs: &[Attribute]
)
[src]

Visit attributes on expression and statements (but not attributes on items in blocks).

pub 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_foreign_mod(&mut self, foreign_mod: &mut ForeignMod)[src]

pub(in config) fn configure_variant_data(
    &mut self,
    vdata: &mut VariantData
)
[src]

pub fn configure_item_kind(&mut self, item: &mut ItemKind)[src]

pub fn configure_expr_kind(&mut self, expr_kind: &mut ExprKind)[src]

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

pub fn configure_pat(&mut self, pat: &mut P<Pat>)[src]

pub fn configure_fn_decl(&mut self, fn_decl: &mut FnDecl)[src]

pub fn fully_configure(&mut self, item: Annotatable) -> Annotatable[src]

Trait Implementations

impl<'a> MutVisitor for StripUnconfigured<'a>[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.