Struct rustc_feature::unstable::Features

source ·
pub struct Features {
Show 213 fields pub declared_lang_features: Vec<(Symbol, Span, Option<Symbol>)>, pub declared_lib_features: Vec<(Symbol, Span)>, pub declared_features: FxHashSet<Symbol>, pub abi_unadjusted: bool, pub allocator_internals: bool, pub allow_internal_unsafe: bool, pub allow_internal_unstable: bool, pub anonymous_lifetime_in_impl_trait: bool, pub compiler_builtins: bool, pub const_arg_path: bool, pub custom_mir: bool, pub generic_assert: bool, pub intrinsics: bool, pub lang_items: bool, pub lifetime_capture_rules_2024: bool, pub link_cfg: bool, pub more_maybe_bounds: bool, pub multiple_supertrait_upcastable: bool, pub negative_bounds: bool, pub omit_gdb_pretty_printer_section: bool, pub pattern_complexity: bool, pub pattern_types: bool, pub prelude_import: bool, pub profiler_runtime: bool, pub rustc_attrs: bool, pub staged_api: bool, pub test_unstable_lint: bool, pub with_negative_coherence: bool, pub abi_vectorcall: bool, pub auto_traits: bool, pub box_patterns: bool, pub builtin_syntax: bool, pub doc_notable_trait: bool, pub dropck_eyepatch: bool, pub fundamental: bool, pub link_llvm_intrinsics: bool, pub linkage: bool, pub needs_panic_runtime: bool, pub panic_runtime: bool, pub rustc_allow_const_fn_unstable: bool, pub rustc_private: bool, pub rustdoc_internals: bool, pub rustdoc_missing_doc_code_examples: bool, pub start: bool, pub structural_match: bool, pub unboxed_closures: bool, pub aarch64_unstable_target_feature: bool, pub aarch64_ver_target_feature: bool, pub arm_target_feature: bool, pub avx512_target_feature: bool, pub bpf_target_feature: bool, pub csky_target_feature: bool, pub ermsb_target_feature: bool, pub hexagon_target_feature: bool, pub lahfsahf_target_feature: bool, pub loongarch_target_feature: bool, pub mips_target_feature: bool, pub powerpc_target_feature: bool, pub prfchw_target_feature: bool, pub riscv_target_feature: bool, pub rtm_target_feature: bool, pub s390x_target_feature: bool, pub sse4a_target_feature: bool, pub tbm_target_feature: bool, pub wasm_target_feature: bool, pub abi_avr_interrupt: bool, pub abi_c_cmse_nonsecure_call: bool, pub abi_msp430_interrupt: bool, pub abi_ptx: bool, pub abi_riscv_interrupt: bool, pub abi_x86_interrupt: bool, pub adt_const_params: bool, pub alloc_error_handler: bool, pub arbitrary_self_types: bool, pub asm_experimental_arch: bool, pub asm_goto: bool, pub asm_unwind: bool, pub associated_const_equality: bool, pub associated_type_defaults: bool, pub async_closure: bool, pub async_fn_track_caller: bool, pub async_for_loop: bool, pub c_variadic: bool, pub cfg_overflow_checks: bool, pub cfg_relocation_model: bool, pub cfg_sanitize: bool, pub cfg_sanitizer_cfi: bool, pub cfg_target_compact: bool, pub cfg_target_has_atomic: bool, pub cfg_target_has_atomic_equal_alignment: bool, pub cfg_target_thread_local: bool, pub cfg_ub_checks: bool, pub cfg_version: bool, pub cfi_encoding: bool, pub closure_lifetime_binder: bool, pub closure_track_caller: bool, pub cmse_nonsecure_entry: bool, pub const_async_blocks: bool, pub const_closures: bool, pub const_extern_fn: bool, pub const_for: bool, pub const_mut_refs: bool, pub const_precise_live_drops: bool, pub const_refs_to_cell: bool, pub const_refs_to_static: bool, pub const_trait_impl: bool, pub const_try: bool, pub coroutine_clone: bool, pub coroutines: bool, pub coverage_attribute: bool, pub custom_inner_attributes: bool, pub custom_test_frameworks: bool, pub decl_macro: bool, pub deprecated_safe: bool, pub deprecated_suggestion: bool, pub deref_patterns: bool, pub derive_smart_pointer: bool, pub do_not_recommend: bool, pub doc_auto_cfg: bool, pub doc_cfg: bool, pub doc_cfg_hide: bool, pub doc_masked: bool, pub dyn_star: bool, pub effects: bool, pub exhaustive_patterns: bool, pub explicit_tail_calls: bool, pub expr_fragment_specifier_2024: bool, pub extended_varargs_abi_support: bool, pub extern_types: bool, pub f128: bool, pub f16: bool, pub ffi_const: bool, pub ffi_pure: bool, pub fmt_debug: bool, pub fn_align: bool, pub fn_delegation: bool, pub freeze_impls: bool, pub gen_blocks: bool, pub generic_arg_infer: bool, pub generic_associated_types_extended: bool, pub generic_const_exprs: bool, pub generic_const_items: bool, pub global_registration: bool, pub half_open_range_patterns_in_slices: bool, pub if_let_guard: bool, pub impl_trait_in_assoc_type: bool, pub impl_trait_in_fn_trait_return: bool, pub inherent_associated_types: bool, pub inline_const_pat: bool, pub intra_doc_pointers: bool, pub large_assignments: bool, pub lazy_type_alias: bool, pub let_chains: bool, pub link_arg_attribute: bool, pub macro_metavar_expr: bool, pub macro_metavar_expr_concat: bool, pub marker_trait_attr: bool, pub min_specialization: bool, pub more_qualified_paths: bool, pub must_not_suspend: bool, pub mut_ref: bool, pub naked_functions: bool, pub native_link_modifiers_as_needed: bool, pub negative_impls: bool, pub never_patterns: bool, pub never_type: bool, pub never_type_fallback: bool, pub no_core: bool, pub no_sanitize: bool, pub non_exhaustive_omitted_patterns_lint: bool, pub non_lifetime_binders: bool, pub object_safe_for_dispatch: bool, pub offset_of_enum: bool, pub offset_of_slice: bool, pub optimize_attribute: bool, pub patchable_function_entry: bool, pub postfix_match: bool, pub proc_macro_hygiene: bool, pub ref_pat_eat_one_layer_2024: bool, pub ref_pat_eat_one_layer_2024_structural: bool, pub register_tool: bool, pub repr128: bool, pub repr_simd: bool, pub result_ffi_guarantees: bool, pub return_type_notation: bool, pub rust_cold_cc: bool, pub sha512_sm_x86: bool, pub shorter_tail_lifetimes: bool, pub simd_ffi: bool, pub specialization: bool, pub stmt_expr_attributes: bool, pub strict_provenance: bool, pub string_deref_patterns: bool, pub struct_target_features: bool, pub target_feature_11: bool, pub thread_local: bool, pub trait_alias: bool, pub trait_upcasting: bool, pub transmute_generic_consts: bool, pub transparent_unions: bool, pub trivial_bounds: bool, pub try_blocks: bool, pub type_alias_impl_trait: bool, pub type_changing_struct_update: bool, pub unnamed_fields: bool, pub unsized_const_params: bool, pub unsized_fn_params: bool, pub unsized_locals: bool, pub unsized_tuple_coercion: bool, pub used_with_arg: bool, pub x86_amx_intrinsics: bool, pub xop_target_feature: bool, pub yeet_expr: bool,
}
Expand description

A set of features to be used by later passes.

Fields§

§declared_lang_features: Vec<(Symbol, Span, Option<Symbol>)>

#![feature] attrs for language features, for error reporting. “declared” here means that the feature is actually enabled in the current crate.

§declared_lib_features: Vec<(Symbol, Span)>

#![feature] attrs for non-language (library) features. “declared” here means that the feature is actually enabled in the current crate.

§declared_features: FxHashSet<Symbol>

declared_lang_features + declared_lib_features.

§abi_unadjusted: bool

Active state of individual features (unstable only). Allows using the unadjusted ABI; perma-unstable.

§allocator_internals: bool

Allows using #![needs_allocator], an implementation detail of #[global_allocator].

§allow_internal_unsafe: bool

Allows using #[allow_internal_unsafe]. This is an attribute on macro_rules! and can’t use the attribute handling below (it has to be checked before expansion possibly makes macros disappear).

§allow_internal_unstable: bool

Allows using #[allow_internal_unstable]. This is an attribute on macro_rules! and can’t use the attribute handling below (it has to be checked before expansion possibly makes macros disappear).

§anonymous_lifetime_in_impl_trait: bool

Allows using anonymous lifetimes in argument-position impl-trait.

§compiler_builtins: bool

Allows identifying the compiler_builtins crate.

§const_arg_path: bool

Gating for a new desugaring of const arguments of usages of const parameters

§custom_mir: bool

Allows writing custom MIR

§generic_assert: bool

Outputs useful assert! messages

§intrinsics: bool

Allows using the rust-intrinsic’s “ABI”.

§lang_items: bool

Allows using #[lang = ".."] attribute for linking items to special compiler logic.

§lifetime_capture_rules_2024: bool

Changes impl Trait to capture all lifetimes in scope.

§link_cfg: bool

Allows #[link(..., cfg(..))]; perma-unstable per #37406

§more_maybe_bounds: bool

Allows using ?Trait trait bounds in more contexts.

§multiple_supertrait_upcastable: bool

Allows the multiple_supertrait_upcastable lint.

§negative_bounds: bool

Allow negative trait bounds. This is an internal-only feature for testing the trait solver!

§omit_gdb_pretty_printer_section: bool

Allows using #[omit_gdb_pretty_printer_section].

§pattern_complexity: bool

Set the maximum pattern complexity allowed (not limited by default).

§pattern_types: bool

Allows using pattern types.

§prelude_import: bool

Allows using #[prelude_import] on glob use items.

§profiler_runtime: bool

Used to identify crates that contain the profiler runtime.

§rustc_attrs: bool

Allows using rustc_* attributes (RFC 572).

§staged_api: bool

Allows using the #[stable] and #[unstable] attributes.

§test_unstable_lint: bool

Added for testing unstable lints; perma-unstable.

§with_negative_coherence: bool

Use for stable + negative coherence and strict coherence depending on trait’s rustc_strict_coherence value.

§abi_vectorcall: bool

Allows using the vectorcall ABI.

§auto_traits: bool

Allows features specific to auto traits. Renamed from optin_builtin_traits.

§box_patterns: bool

Allows using box in patterns (RFC 469).

§builtin_syntax: bool

Allows builtin # foo() syntax

§doc_notable_trait: bool

Allows #[doc(notable_trait)]. Renamed from doc_spotlight.

§dropck_eyepatch: bool

Allows using the may_dangle attribute (RFC 1327).

§fundamental: bool

Allows using the #[fundamental] attribute.

§link_llvm_intrinsics: bool

Allows using #[link_name="llvm.*"].

§linkage: bool

Allows using the #[linkage = ".."] attribute.

§needs_panic_runtime: bool

Allows declaring with #![needs_panic_runtime] that a panic runtime is needed.

§panic_runtime: bool

Allows using the #![panic_runtime] attribute.

§rustc_allow_const_fn_unstable: bool

Allows using #[rustc_allow_const_fn_unstable]. This is an attribute on const fn for the same purpose as #[allow_internal_unstable].

§rustc_private: bool

Allows using compiler’s own crates.

§rustdoc_internals: bool

Allows using internal rustdoc features like doc(keyword).

§rustdoc_missing_doc_code_examples: bool

Allows using the rustdoc::missing_doc_code_examples lint

§start: bool

Allows using #[start] on a function indicating that it is the program entrypoint.

§structural_match: bool

Allows using #[structural_match] which indicates that a type is structurally matchable. FIXME: Subsumed by trait StructuralPartialEq, cannot move to removed until a library feature with the same name exists.

§unboxed_closures: bool

Allows using the rust-call ABI.

§aarch64_unstable_target_feature: bool§aarch64_ver_target_feature: bool§arm_target_feature: bool§avx512_target_feature: bool§bpf_target_feature: bool§csky_target_feature: bool§ermsb_target_feature: bool§hexagon_target_feature: bool§lahfsahf_target_feature: bool§loongarch_target_feature: bool§mips_target_feature: bool§powerpc_target_feature: bool§prfchw_target_feature: bool§riscv_target_feature: bool§rtm_target_feature: bool§s390x_target_feature: bool§sse4a_target_feature: bool§tbm_target_feature: bool§wasm_target_feature: bool§abi_avr_interrupt: bool

Allows extern "avr-interrupt" fn() and extern "avr-non-blocking-interrupt" fn().

§abi_c_cmse_nonsecure_call: bool

Allows extern "C-cmse-nonsecure-call" fn().

§abi_msp430_interrupt: bool

Allows extern "msp430-interrupt" fn().

§abi_ptx: bool

Allows extern "ptx-*" fn().

§abi_riscv_interrupt: bool

Allows extern "riscv-interrupt-m" fn() and extern "riscv-interrupt-s" fn().

§abi_x86_interrupt: bool

Allows extern "x86-interrupt" fn().

§adt_const_params: bool

Allows additional const parameter types, such as [u8; 10] or user defined types

§alloc_error_handler: bool

Allows defining an #[alloc_error_handler].

§arbitrary_self_types: bool

Allows trait methods with arbitrary self types.

§asm_experimental_arch: bool

Enables experimental inline assembly support for additional architectures.

§asm_goto: bool

Allows using label operands in inline assembly.

§asm_unwind: bool

Allows the may_unwind option in inline assembly.

§associated_const_equality: bool

Allows users to enforce equality of associated constants TraitImpl<AssocConst=3>.

§associated_type_defaults: bool

Allows associated type defaults.

§async_closure: bool

Allows async || body closures.

§async_fn_track_caller: bool

Allows #[track_caller] on async functions.

§async_for_loop: bool

Allows for await loops.

§c_variadic: bool

Allows using C-variadics.

§cfg_overflow_checks: bool

Allows the use of #[cfg(overflow_checks) to check if integer overflow behaviour.

§cfg_relocation_model: bool

Provides the relocation model information as cfg entry

§cfg_sanitize: bool

Allows the use of #[cfg(sanitize = "option")]; set when -Zsanitizer is used.

§cfg_sanitizer_cfi: bool

Allows cfg(sanitizer_cfi_generalize_pointers) and cfg(sanitizer_cfi_normalize_integers).

§cfg_target_compact: bool

Allows cfg(target(abi = "...")).

§cfg_target_has_atomic: bool

Allows cfg(target_has_atomic_load_store = "...").

§cfg_target_has_atomic_equal_alignment: bool

Allows cfg(target_has_atomic_equal_alignment = "...").

§cfg_target_thread_local: bool

Allows cfg(target_thread_local).

§cfg_ub_checks: bool

Allows the use of #[cfg(ub_checks) to check if UB checks are enabled.

§cfg_version: bool

Allow conditional compilation depending on rust version

§cfi_encoding: bool

Allows to use the #[cfi_encoding = ""] attribute.

§closure_lifetime_binder: bool

Allows for<...> on closures and coroutines.

§closure_track_caller: bool

Allows #[track_caller] on closures and coroutines.

§cmse_nonsecure_entry: bool

Allows to use the #[cmse_nonsecure_entry] attribute.

§const_async_blocks: bool

Allows async {} expressions in const contexts.

§const_closures: bool

Allows const || {} closures in const contexts.

§const_extern_fn: bool

Allows the definition of const extern fn and const unsafe extern fn.

§const_for: bool

Allows for _ in _ loops in const contexts.

§const_mut_refs: bool

Allows using &mut in constant functions.

§const_precise_live_drops: bool

Be more precise when looking for live drops in a const context.

§const_refs_to_cell: bool

Allows references to types with interior mutability within constants

§const_refs_to_static: bool

Allows creating pointers and references to static items in constants.

§const_trait_impl: bool

Allows impl const Trait for T syntax.

§const_try: bool

Allows the ? operator in const contexts.

§coroutine_clone: bool

Allows coroutines to be cloned.

§coroutines: bool

Allows defining coroutines.

§coverage_attribute: bool

Allows function attribute #[coverage(on/off)], to control coverage instrumentation of that function.

§custom_inner_attributes: bool

Allows non-builtin attributes in inner attribute position.

§custom_test_frameworks: bool

Allows custom test frameworks with #![test_runner] and #[test_case].

§decl_macro: bool

Allows declarative macros 2.0 (macro).

§deprecated_safe: bool

Allows using #[deprecated_safe] to deprecate the safeness of a function or trait

§deprecated_suggestion: bool

Allows having using suggestion in the #[deprecated] attribute.

§deref_patterns: bool

Allows deref patterns.

§derive_smart_pointer: bool

Allows deriving SmartPointer traits

§do_not_recommend: bool

Controls errors in trait implementations.

§doc_auto_cfg: bool

Tells rustdoc to automatically generate #[doc(cfg(...))].

§doc_cfg: bool

Allows #[doc(cfg(...))].

§doc_cfg_hide: bool

Allows #[doc(cfg_hide(...))].

§doc_masked: bool

Allows #[doc(masked)].

§dyn_star: bool

Allows dyn* Trait objects.

§effects: bool

Uses generic effect parameters for ~const bounds

§exhaustive_patterns: bool

Allows exhaustive pattern matching on types that contain uninhabited types.

§explicit_tail_calls: bool

Allows explicit tail calls via become expression.

§expr_fragment_specifier_2024: bool

Uses 2024 rules for matching expr fragments in macros. Also enables expr_2021 fragment.

§extended_varargs_abi_support: bool

Allows using efiapi, sysv64 and win64 as calling convention for functions with varargs.

§extern_types: bool

Allows defining extern types.

§f128: bool

Allow using 128-bit (quad precision) floating point numbers.

§f16: bool

Allow using 16-bit (half precision) floating point numbers.

§ffi_const: bool

Allows the use of #[ffi_const] on foreign functions.

§ffi_pure: bool

Allows the use of #[ffi_pure] on foreign functions.

§fmt_debug: bool

Controlling the behavior of fmt::Debug

§fn_align: bool

Allows using #[repr(align(...))] on function items

§fn_delegation: bool

Support delegating implementation of functions to other already implemented functions.

§freeze_impls: bool

Allows impls for the Freeze trait.

§gen_blocks: bool

Allows defining gen blocks and gen fn.

§generic_arg_infer: bool

Infer generic args for both consts and types.

§generic_associated_types_extended: bool

An extension to the generic_associated_types feature, allowing incomplete features.

§generic_const_exprs: bool

Allows non-trivial generic constants which have to have wfness manually propagated to callers

§generic_const_items: bool

Allows generic parameters and where-clauses on free & associated const items.

§global_registration: bool

Allows registering static items globally, possibly across crates, to iterate over at runtime.

§half_open_range_patterns_in_slices: bool

Allows using ..=X as a patterns in slices.

§if_let_guard: bool

Allows if let guard in match arms.

§impl_trait_in_assoc_type: bool

Allows impl Trait to be used inside associated types (RFC 2515).

§impl_trait_in_fn_trait_return: bool

Allows impl Trait as output type in Fn traits in return position of functions.

§inherent_associated_types: bool

Allows associated types in inherent impls.

§inline_const_pat: bool

Allow anonymous constants from an inline const block in pattern position

§intra_doc_pointers: bool

Allows using pointer and reference in intra-doc links

§large_assignments: bool§lazy_type_alias: bool

Allow to have type alias types for inter-crate use.

§let_chains: bool

Allows if/while p && let q = r && ... chains.

§link_arg_attribute: bool

Allows using #[link(kind = "link-arg", name = "...")] to pass custom arguments to the linker.

§macro_metavar_expr: bool

Give access to additional metadata about declarative macro meta-variables.

§macro_metavar_expr_concat: bool

Provides a way to concatenate identifiers using metavariable expressions.

§marker_trait_attr: bool

Allows #[marker] on certain traits allowing overlapping implementations.

§min_specialization: bool

A minimal, sound subset of specialization intended to be used by the standard library until the soundness issues with specialization are fixed.

§more_qualified_paths: bool

Allows qualified paths in struct expressions, struct patterns and tuple struct patterns.

§must_not_suspend: bool

Allows the #[must_not_suspend] attribute.

§mut_ref: bool

Allows mut ref and mut ref mut identifier patterns.

§naked_functions: bool

Allows using #[naked] on functions.

§native_link_modifiers_as_needed: bool

Allows specifying the as-needed link modifier

§negative_impls: bool

Allow negative trait implementations.

§never_patterns: bool

Allows the ! pattern.

§never_type: bool

Allows the ! type. Does not imply ‘exhaustive_patterns’ (below) any more.

§never_type_fallback: bool

Allows diverging expressions to fall back to ! rather than ().

§no_core: bool

Allows #![no_core].

§no_sanitize: bool

Allows the use of no_sanitize attribute.

§non_exhaustive_omitted_patterns_lint: bool

Allows using the non_exhaustive_omitted_patterns lint.

§non_lifetime_binders: bool

Allows for<T> binders in where-clauses

§object_safe_for_dispatch: bool

Allows making dyn Trait well-formed even if Trait is not object safe. In that case, dyn Trait: Trait does not hold. Moreover, coercions and casts in safe Rust to dyn Trait for such a Trait is also forbidden.

§offset_of_enum: bool

Allows using enums in offset_of!

§offset_of_slice: bool

Allows using fields with slice type in offset_of!

§optimize_attribute: bool

Allows using #[optimize(X)].

§patchable_function_entry: bool

Allows specifying nop padding on functions for dynamic patching.

§postfix_match: bool

Allows postfix match expr.match { ... }

§proc_macro_hygiene: bool

Allows macro attributes on expressions, statements and non-inline modules.

§ref_pat_eat_one_layer_2024: bool

Makes & and &mut patterns eat only one layer of references in Rust 2024.

§ref_pat_eat_one_layer_2024_structural: bool

Makes & and &mut patterns eat only one layer of references in Rust 2024—structural variant

§register_tool: bool

Allows using the #[register_tool] attribute.

§repr128: bool

Allows the #[repr(i128)] attribute for enums.

§repr_simd: bool

Allows repr(simd) and importing the various simd intrinsics.

§result_ffi_guarantees: bool

Allows enums like Result<T, E> to be used across FFI, if T’s niche value can be used to describe E or vise-versa.

§return_type_notation: bool

Allows bounding the return type of AFIT/RPITIT.

§rust_cold_cc: bool

Allows extern "rust-cold".

§sha512_sm_x86: bool

Allows use of x86 SHA512, SM3 and SM4 target-features and intrinsics

§shorter_tail_lifetimes: bool

Shortern the tail expression lifetime

§simd_ffi: bool

Allows the use of SIMD types in functions declared in extern blocks.

§specialization: bool

Allows specialization of implementations (RFC 1210).

§stmt_expr_attributes: bool

Allows attributes on expressions and non-item statements.

§strict_provenance: bool

Allows lints part of the strict provenance effort.

§string_deref_patterns: bool

Allows string patterns to dereference values to match them.

§struct_target_features: bool

Allows structs to carry target_feature information.

§target_feature_11: bool

Allows the use of #[target_feature] on safe functions.

§thread_local: bool

Allows using #[thread_local] on static items.

§trait_alias: bool

Allows defining trait X = A + B; alias items.

§trait_upcasting: bool

Allows dyn upcasting trait objects via supertraits. Dyn upcasting is casting, e.g., dyn Foo -> dyn Bar where Foo: Bar.

§transmute_generic_consts: bool

Allows for transmuting between arrays with sizes that contain generic consts.

§transparent_unions: bool

Allows #[repr(transparent)] on unions (RFC 2645).

§trivial_bounds: bool

Allows inconsistent bounds in where clauses.

§try_blocks: bool

Allows using try {...} expressions.

§type_alias_impl_trait: bool

Allows impl Trait to be used inside type aliases (RFC 2515).

§type_changing_struct_update: bool

Allows creation of instances of a struct by moving fields that have not changed from prior instances of the same struct (RFC #2528)

§unnamed_fields: bool

Allows unnamed fields of struct and union type

§unsized_const_params: bool

Allows const generic parameters to be defined with types that are not Sized, e.g. fn foo<const N: [u8]>() {.

§unsized_fn_params: bool

Allows unsized fn parameters.

§unsized_locals: bool

Allows unsized rvalues at arguments and parameters.

§unsized_tuple_coercion: bool

Allows unsized tuple coercion.

§used_with_arg: bool

Allows using the #[used(linker)] (or #[used(compiler)]) attribute.

§x86_amx_intrinsics: bool

Allows use of x86 AMX target-feature attributes and intrinsics

§xop_target_feature: bool

Allows use of the xop target-feature

§yeet_expr: bool

Allows do yeet expressions

Implementations§

source§

impl Features

source

pub fn set_declared_lang_feature( &mut self, symbol: Symbol, span: Span, since: Option<Symbol>, )

source

pub fn set_declared_lib_feature(&mut self, symbol: Symbol, span: Span)

source

pub fn all_features(&self) -> [u8; 210]

This is intended for hashing the set of active features.

The expectation is that this produces much smaller code than other alternatives.

Note that the total feature count is pretty small, so this is not a huge array.

source

pub fn declared(&self, feature: Symbol) -> bool

Is the given feature explicitly declared, i.e. named in a #![feature(...)] within the code?

source

pub fn active(&self, feature: Symbol) -> bool

Is the given feature active (enabled by the user)?

Panics if the symbol doesn’t correspond to a declared feature.

source

pub fn incomplete(&self, feature: Symbol) -> bool

Some features are known to be incomplete and using them is likely to have unanticipated results, such as compiler crashes. We warn the user about these to alert them.

source

pub fn internal(&self, feature: Symbol) -> bool

Some features are internal to the compiler and standard library and should not be used in normal projects. We warn the user about these to alert them.

Trait Implementations§

source§

impl Clone for Features

source§

fn clone(&self) -> Features

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Features

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Features

source§

fn default() -> Features

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Aligned for T

source§

const ALIGN: Alignment = _

Alignment of Self.
source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<'a, T> Captures<'a> for T
where T: ?Sized,

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: 296 bytes