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.
Modules§
Structs§
- Condition
- Const
Stability - Represents the
#[rustc_const_unstable]and#[rustc_const_stable]attributes. - Default
Body Stability - Represents the
#[rustc_default_body_unstable]attribute. - Deprecation
- Partial
Const Stability - Excludes
const_stable_indirect. This is necessary because when-Zforce-unstable-if-unmarkedis set, we need to encode standalone#[rustc_const_stable_indirect]attributes - Rustc
Version - Stability
- Represents the following attributes:
Enums§
- Allowed
Through Unstable Modules - Deprecated
Since - Release in which an API is deprecated.
- Diagnostic
Attribute - Inline
Attr - Instruction
SetAttr - IntType
- Optimize
Attr - Repr
Attr - Stability
Level - The available stability levels.
- Stable
Since - Rust release in which a feature is stabilized.
- Transparency
Error - Unstable
Reason
Constants§
- VERSION_
PLACEHOLDER - The version placeholder that recently stabilized features contain inside the
sincefield of the#[stable]attribute.
Statics§
- DEFAULT_
LOCALE_ RESOURCE - Raw content of Fluent resource for this crate, generated by
fluent_messagesmacro, imported byrustc_driverto include all crates’ resources in one bundle.
Functions§
- allow_
internal_ unstable - cfg_
matches - Tests if a cfg-pattern matches the cfg set
- eval_
condition - Evaluate a cfg-like condition (with
anyandall), usingevalto evaluate individual items. - find_
body_ stability - Collects stability info from
rustc_default_body_unstableattributes inattrs. ReturnsNoneif no stability attributes are found. - find_
const_ stability - Collects stability info from
rustc_const_stable/rustc_const_unstable/rustc_promotableattributes inattrs. ReturnsNoneif no stability attributes are found. - find_
crate_ name - find_
deprecation - Finds the deprecation attribute.
Noneif none exists. - find_
repr_ attrs - Parse #[repr(…)] forms.
- find_
stability - Collects stability info from
stable/unstable/rustc_allowed_through_unstable_modulesattributes inattrs. ReturnsNoneif no stability attributes are found. - find_
transparency - is_
builtin_ attr - parse_
alignment - parse_
confusables - Read the content of a
rustc_confusablesattribute, and return the list of candidate names. - parse_
repr_ attr - parse_
version - Parse a rustc version number written inside string literal in an attribute,
like appears in
since = "1.0.0". Suffixes like “-dev” and “-nightly” are not accepted in this position, unlike when parsing CFG_RELEASE. - rustc_
allow_ const_ fn_ unstable - unmarked_
crate_ const_ stab - Calculates the const stability for a const function in a
-Zforce-unstable-if-unmarkedcrate without thestaged_apifeature.