Trait rustc_ast::ast_like::AstLike[][src]

pub trait AstLike: Sized + Debug {

    fn attrs(&self) -> &[Attribute]
Notable traits for &'_ mut [u8]
impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
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.

Required methods

Implementations on Foreign Types