Crate rustc_attr[][src]

Expand description

Functions and types dealing with attributes and meta items.

FIXME(Centril): For now being, much of the logic is still in rustc_ast::attr. The goal is to move the definition of MetaItem and things that don’t need to be in syntax to this crate.

Re-exports

pub use IntType::*;
pub use ReprAttr::*;
pub use StabilityLevel::*;

Modules

builtin

Parsing and validation of builtin attributes

Structs

ConstStability

Represents the #[rustc_const_unstable] and #[rustc_const_stable] attributes.

Deprecation
MarkedAttrs
Stability

Represents the following attributes:

Enums

InlineAttr
InstructionSetAttr
IntType
OptimizeAttr
ReprAttr
StabilityLevel

The available stability levels.

TransparencyError
UnwindAttr

Functions

allow_internal_unstable
cfg_matches

Tests if a cfg-pattern matches the cfg set

eval_condition

Evaluate a cfg-like condition (with any and all), using eval to evaluate individual items.

find_crate_name
find_deprecation

Finds the deprecation attribute. None if none exists.

find_repr_attrs

Parse #[repr(…)] forms.

find_stability

Collects stability info from all stability attributes in attrs. Returns None if no stability attributes are found.

find_transparency
find_unwind_attr

Determine what #[unwind] attribute is present in attrs, if any.

is_builtin_attr
list_contains_name
mk_attr
mk_attr_from_item
mk_attr_inner

Returns an inner attribute with the given value and span.

mk_attr_outer

Returns an outer attribute with the given value and span.

mk_doc_comment
mk_list_item
mk_name_value_item
mk_name_value_item_str
mk_nested_word_item
mk_word_item
parse_alignment
rustc_allow_const_fn_unstable