[][src]Struct syntax::config::StripUnconfigured

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

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

Fields

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

Methods

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: T) -> 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 warnigns 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 fn in_cfg(&mut self, attrs: &[Attribute]) -> bool
[src]

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

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: ForeignMod) -> ForeignMod
[src]

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

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

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

pub fn configure_stmt(&mut self, stmt: Stmt) -> Option<Stmt>
[src]

pub fn configure_struct_expr_field(&mut self, field: Field) -> Option<Field>
[src]

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

pub fn disallow_cfg_on_generic_param(&mut self, param: &GenericParam)
[src]

Trait Implementations

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

fn fold_crate(&mut self, c: Crate) -> Crate
[src]

fn fold_meta_items(&mut self, meta_items: Vec<MetaItem>) -> Vec<MetaItem>
[src]

fn fold_meta_list_item(&mut self, list_item: NestedMetaItem) -> NestedMetaItem
[src]

fn fold_meta_item(&mut self, meta_item: MetaItem) -> MetaItem
[src]

fn fold_use_tree(&mut self, use_tree: UseTree) -> UseTree
[src]

fn fold_foreign_item(&mut self, ni: ForeignItem) -> SmallVec<[ForeignItem; 1]>
[src]

fn fold_foreign_item_simple(&mut self, ni: ForeignItem) -> ForeignItem
[src]

fn fold_item_simple(&mut self, i: Item) -> Item
[src]

fn fold_fn_header(&mut self, header: FnHeader) -> FnHeader
[src]

fn fold_struct_field(&mut self, sf: StructField) -> StructField
[src]

fn fold_fn_decl(&mut self, d: P<FnDecl>) -> P<FnDecl>
[src]

fn fold_asyncness(&mut self, a: IsAsync) -> IsAsync
[src]

fn fold_block(&mut self, b: P<Block>) -> P<Block>
[src]

fn fold_arm(&mut self, a: Arm) -> Arm
[src]

fn fold_guard(&mut self, g: Guard) -> Guard
[src]

fn fold_anon_const(&mut self, c: AnonConst) -> AnonConst
[src]

fn fold_range_end(&mut self, re: RangeEnd) -> RangeEnd
[src]

fn fold_exprs(&mut self, es: Vec<P<Expr>>) -> Vec<P<Expr>>
[src]

fn fold_generic_arg(&mut self, arg: GenericArg) -> GenericArg
[src]

fn fold_ty(&mut self, t: P<Ty>) -> P<Ty>
[src]

fn fold_lifetime(&mut self, l: Lifetime) -> Lifetime
[src]

fn fold_ty_binding(&mut self, t: TypeBinding) -> TypeBinding
[src]

fn fold_mod(&mut self, m: Mod) -> Mod
[src]

fn fold_global_asm(&mut self, ga: P<GlobalAsm>) -> P<GlobalAsm>
[src]

fn fold_variant(&mut self, v: Variant) -> Variant
[src]

fn fold_ident(&mut self, i: Ident) -> Ident
[src]

fn fold_usize(&mut self, i: usize) -> usize
[src]

fn fold_path(&mut self, p: Path) -> Path
[src]

fn fold_qpath(&mut self, qs: Option<QSelf>, p: Path) -> (Option<QSelf>, Path)
[src]

fn fold_generic_args(&mut self, p: GenericArgs) -> GenericArgs
[src]

fn fold_angle_bracketed_parameter_data(
    &mut self,
    p: AngleBracketedArgs
) -> AngleBracketedArgs
[src]

fn fold_parenthesized_parameter_data(
    &mut self,
    p: ParenthesisedArgs
) -> ParenthesisedArgs
[src]

fn fold_local(&mut self, l: P<Local>) -> P<Local>
[src]

fn fold_macro_def(&mut self, def: MacroDef) -> MacroDef
[src]

fn fold_label(&mut self, label: Label) -> Label
[src]

fn fold_attribute(&mut self, at: Attribute) -> Option<Attribute>
[src]

fn fold_arg(&mut self, a: Arg) -> Arg
[src]

fn fold_generics(&mut self, generics: Generics) -> Generics
[src]

fn fold_trait_ref(&mut self, p: TraitRef) -> TraitRef
[src]

fn fold_poly_trait_ref(&mut self, p: PolyTraitRef) -> PolyTraitRef
[src]

fn fold_variant_data(&mut self, vdata: VariantData) -> VariantData
[src]

fn fold_generic_param(&mut self, param: GenericParam) -> GenericParam
[src]

fn fold_generic_params(
    &mut self,
    params: Vec<GenericParam>
) -> Vec<GenericParam>
[src]

fn fold_tt(&mut self, tt: TokenTree) -> TokenTree
[src]

fn fold_tts(&mut self, tts: TokenStream) -> TokenStream
[src]

fn fold_token(&mut self, t: Token) -> Token
[src]

fn fold_interpolated(&mut self, nt: Nonterminal) -> Nonterminal
[src]

fn fold_opt_bounds(&mut self, b: Option<GenericBounds>) -> Option<GenericBounds>
[src]

fn fold_bounds(&mut self, b: GenericBounds) -> GenericBounds
[src]

fn fold_param_bound(&mut self, tpb: GenericBound) -> GenericBound
[src]

fn fold_mt(&mut self, mt: MutTy) -> MutTy
[src]

fn fold_field(&mut self, field: Field) -> Field
[src]

fn fold_where_clause(&mut self, where_clause: WhereClause) -> WhereClause
[src]

fn fold_where_predicate(
    &mut self,
    where_predicate: WherePredicate
) -> WherePredicate
[src]

fn fold_vis(&mut self, vis: Visibility) -> Visibility
[src]

fn new_id(&mut self, i: NodeId) -> NodeId
[src]

fn new_span(&mut self, sp: Span) -> Span
[src]

Auto Trait Implementations

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

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

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<E> SpecializationError for E
[src]

impl<T> Erased for T
[src]

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

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

impl<T> Erased for T