Skip to main content

Module attr_wrapper

Module attr_wrapper 

Source

Re-exportsยง

use std::borrow::Cow; ๐Ÿ”’
use std::mem; ๐Ÿ”’
use rustc_ast::token::Token; ๐Ÿ”’
use rustc_ast::tokenstream::AttrsTarget; ๐Ÿ”’
use rustc_ast::tokenstream::LazyTokenStream; ๐Ÿ”’
use rustc_ast::tokenstream::NodeRange; ๐Ÿ”’
use rustc_ast::tokenstream::ParserRange; ๐Ÿ”’
use rustc_ast::tokenstream::Spacing; ๐Ÿ”’
use rustc_ast::tokenstream::TokenCursor; ๐Ÿ”’
use rustc_ast as ast; ๐Ÿ”’
use rustc_ast::AttrKind; ๐Ÿ”’
use rustc_ast::AttrVec; ๐Ÿ”’
use rustc_ast::Attribute; ๐Ÿ”’
use rustc_ast::HasTokens; ๐Ÿ”’
use rustc_data_structures::fx::FxHashSet; ๐Ÿ”’
use rustc_errors::PResult; ๐Ÿ”’
use rustc_session::parse::ParseSess; ๐Ÿ”’
use rustc_span::DUMMY_SP; ๐Ÿ”’
use rustc_span::sym; ๐Ÿ”’
use thin_vec::ThinVec; ๐Ÿ”’
use super::Capturing; ๐Ÿ”’
use super::ForceCollect; ๐Ÿ”’
use super::Parser; ๐Ÿ”’
use super::Trailing; ๐Ÿ”’

Structsยง

AttrWrapper ๐Ÿ”’
A wrapper type to ensure that the parser handles outer attributes correctly. When we parse outer attributes, we need to ensure that we capture tokens for the attribute target. This allows us to perform cfg-expansion on a token stream before we invoke a derive proc-macro.
CollectPos ๐Ÿ”’

Enumsยง

UsePreAttrPos ๐Ÿ”’

Functionsยง

has_cfg_or_cfg_attr ๐Ÿ”’
Returns true if attrs contains a cfg or cfg_attr attribute
needs_tokens ๐Ÿ”’