Trait rustc_ast::ast_like::AstLike [−][src]
pub trait AstLike: Sized + Debug {
const SUPPORTS_CUSTOM_INNER_ATTRS: bool;
fn attrs(&self) -> &[Attribute];
fn visit_attrs(&mut self, f: impl FnOnce(&mut Vec<Attribute>));
fn tokens_mut(&mut self) -> Option<&mut Option<LazyTokenStream>>;
}Expand description
An AstLike represents an AST node (or some wrapper around
and AST node) which stores some combination of attributes
and tokens.
Associated Constants
This is true if this AstLike might support ‘custom’ (proc-macro) inner
attributes. Attributes like #![cfg] and #![cfg_attr] are not
considered ‘custom’ attributes
If this is false, then this AstLike definitely does
not support ‘custom’ inner attributes, which enables some optimizations
during token collection.