rustc_target::target_features

Type Alias StabilityUncomputed

Source
pub type StabilityUncomputed = Stability<AllowToggleUncomputed>;
Expand description

Stability where allow_toggle has not been computed yet.

Aliased Type§

enum StabilityUncomputed {
    Stable {
        allow_toggle: fn(_: &Target, _: bool) -> Result<(), &'static str>,
    },
    Unstable {
        nightly_feature: Symbol,
        allow_toggle: fn(_: &Target, _: bool) -> Result<(), &'static str>,
    },
    Forbidden {
        reason: &'static str,
    },
}

Variants§

§

Stable

This target feature is stable, it can be used in #[target_feature] and #[cfg(target_feature)].

Fields

§allow_toggle: fn(_: &Target, _: bool) -> Result<(), &'static str>

When enabling/disabling the feature via -Ctarget-feature or #[target_feature], determine if that is allowed.

§

Unstable

This target feature is unstable. It is only present in #[cfg(target_feature)] on nightly and using it in #[target_feature] requires enabling the given nightly feature.

Fields

§nightly_feature: Symbol

This must be a language feature, or else rustc will ICE when reporting a missing feature gate!

§allow_toggle: fn(_: &Target, _: bool) -> Result<(), &'static str>

See Stable::allow_toggle comment above.

§

Forbidden

This feature can not be set via -Ctarget-feature or #[target_feature], it can only be set in the target spec. It is never set in cfg(target_feature). Used in particular for features that change the floating-point ABI.

Fields

§reason: &'static str

Implementations§

Source§

impl StabilityUncomputed

Source

pub fn compute_toggleability(&self, target: &Target) -> StabilityComputed

Source

pub fn toggle_allowed( &self, target: &Target, enable: bool, ) -> Result<(), &'static str>

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 24 bytes

Size for each variant:

  • Stable: 12 bytes
  • Unstable: 12 bytes
  • Forbidden: 20 bytes