Skip to main content

features

Macro features 

Source
macro_rules! features {
    (
        // Target or target family name, for use in diagnostic messages
        @TARGET: $target:ident;
        // Cfg for which this macro should be allowed
        @CFG: $cfg:meta;
        // Name like `is_*_feature_detected`
        @MACRO_NAME: $macro_name:ident;
        // Docs and stability attributes
        @MACRO_ATTRS: $(#[$macro_attrs:meta])*
        // Synonyms, with possible deprecation
        $(@BIND_FEATURE_NAME: $bind_feature:tt; $feature_impl:tt; $(#[$deprecate_attr:meta];)?)*
        // Features that exist but can't be detected at runtime, so emit an error.
        $(@NO_RUNTIME_DETECTION: $nort_feature:tt; )*
        // List of features
        $(@FEATURE: #[$stability_attr:meta] $feature:ident: $feature_lit:tt;
            // Skip verifying that the feature is known by `cfg!`, which also skips emitting `true`
            // if the feature is enabled at compile time.
            $(without cfg check: $feature_cfg_check:tt;)?
            // If this feature is always enabled by some other feature, we can avoid the cost of
            // checking them separately by instead only checking the root features.
            $(implied by target_features: [$($target_feature_lit:tt),*];)?
            // Doc comment for the feature.
            $(#[$feature_comment:meta])*)*
    ) => { ... };
}
🔬This is a nightly-only experimental API. (stdarch_internal)
Expand description

Create the is_*_feature_detected macro for an architecture.