Trait rustc_ast::ast_traits::HasAttrs
source · pub trait HasAttrs {
const SUPPORTS_CUSTOM_INNER_ATTRS: bool;
// Required methods
fn attrs(&self) -> &[Attribute];
fn visit_attrs(&mut self, f: impl FnOnce(&mut AttrVec));
}
Expand description
A trait for AST nodes having (or not having) attributes.
Required Associated Constants§
sourceconst SUPPORTS_CUSTOM_INNER_ATTRS: bool
const SUPPORTS_CUSTOM_INNER_ATTRS: bool
This is true
if this HasAttrs
might support ‘custom’ (proc-macro) inner
attributes. Attributes like #![cfg]
and #![cfg_attr]
are not
considered ‘custom’ attributes.
If this is false
, then this HasAttrs
definitely does
not support ‘custom’ inner attributes, which enables some optimizations
during token collection.
Required Methods§
Object Safety§
This trait is not object safe.