Struct rustc_expand::config::StripUnconfigured [−][src]
A folder that strips out items that do not belong in the current configuration.
Fields
sess: &'a Sessionfeatures: Option<&'a Features>modified: boolImplementations
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]
&mut self,
attrs: Vec<Attribute>
) -> Option<Vec<Attribute>>
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]
&self,
attr: &Attribute
) -> Option<(MetaItem, Vec<(AttrItem, Span)>)>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,