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-unmarked
is set, we need to encode standalone#[rustc_const_stable_indirect]
attributes - Rustc
Version - Stability
- Represents the following attributes:
Enums§
- 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
since
field of the#[stable]
attribute.
Statics§
- DEFAULT_
LOCALE_ RESOURCE - Raw content of Fluent resource for this crate, generated by
fluent_messages
macro, imported byrustc_driver
to 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
any
andall
), usingeval
to evaluate individual items. - find_
body_ stability - Collects stability info from
rustc_default_body_unstable
attributes inattrs
. ReturnsNone
if no stability attributes are found. - find_
const_ stability - Collects stability info from
rustc_const_stable
/rustc_const_unstable
/rustc_promotable
attributes inattrs
. ReturnsNone
if no stability attributes are found. - 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
stable
/unstable
/rustc_allowed_through_unstable_modules
attributes inattrs
. ReturnsNone
if no stability attributes are found. - find_
transparency - is_
builtin_ attr - parse_
alignment - parse_
confusables - Read the content of a
rustc_confusables
attribute, 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-unmarked
crate without thestaged_api
feature.