Crate rustc_feature

Source
Expand description

§Feature gates

This crate declares the set of past and present unstable features in the compiler. Feature gate checking itself is done in rustc_ast_passes/src/feature_gate.rs at the moment.

Features are enabled in programs via the crate-level attributes of #![feature(...)] with a comma-separated list of features.

For the purpose of future feature-tracking, once a feature gate is added, even if it is stabilized or removed, do not remove it. Instead, move the symbol to the accepted or removed modules respectively.

Modules§

accepted 🔒
List of the accepted feature gates.
builtin_attrs 🔒
Built-in attributes and cfg flag gating.
removed 🔒
List of the removed feature gates.
unstable 🔒
List of the unstable feature gates.

Macros§

template
A convenience macro for constructing attribute templates. E.g., template!(Word, List: "description") means that the attribute supports forms #[attr] and #[attr(description)].

Structs§

AttributeTemplate
A template that the attribute input must match. Only top-level shape (#[attr] vs #[attr(...)] vs #[attr = ...]) is considered now.
BuiltinAttribute
EnabledLangFeature
Information about an enabled language feature.
EnabledLibFeature
Information about an enabled library feature.
Feature
Features
A set of features to be used by later passes.

Enums§

AttributeDuplicates
How to handle multiple duplicate attributes on the same item.
AttributeGate
AttributeSafety
AttributeType
GateIssue
UnstableFeatures

Constants§

INCOMPATIBLE_FEATURES
Some features are not allowed to be used together at the same time, if the two are present, produce an error.

Statics§

ACCEPTED_LANG_FEATURES
Formerly unstable features that have now been accepted (stabilized).
BUILTIN_ATTRIBUTES
Attributes that have a special meaning to rustc or rustdoc.
BUILTIN_ATTRIBUTE_MAP
REMOVED_LANG_FEATURES
Formerly unstable features that have now been removed.
UNSTABLE_LANG_FEATURES
Unstable language features that are being implemented or being considered for acceptance (stabilization) or removal.

Functions§

encode_cross_crate
Whether this builtin attribute is encoded cross crate. This means it can be used cross crate.
find_feature_issue
find_gated_cfg
Find a gated cfg determined by the predicate which is given the cfg’s name.
find_lang_feature_issue 🔒
is_builtin_attr_name
is_stable_diagnostic_attribute
is_valid_for_get_attr
to_nonzero 🔒

Type Aliases§

GatedCfg