[][src]Struct rustc_ap_syntax::feature_gate::Features

pub struct Features {
    pub declared_lang_features: Vec<(Symbol, Span, Option<Symbol>)>,
    pub declared_lib_features: Vec<(Symbol, Span)>,
    pub rustc_private: bool,
    pub intrinsics: bool,
    pub lang_items: bool,
    pub staged_api: bool,
    pub allow_internal_unstable: bool,
    pub allow_internal_unsafe: bool,
    pub rustc_const_unstable: bool,
    pub link_llvm_intrinsics: bool,
    pub rustc_attrs: bool,
    pub on_unimplemented: bool,
    pub box_syntax: bool,
    pub main: bool,
    pub start: bool,
    pub fundamental: bool,
    pub unboxed_closures: bool,
    pub linkage: bool,
    pub optin_builtin_traits: bool,
    pub box_patterns: bool,
    pub prelude_import: bool,
    pub omit_gdb_pretty_printer_section: bool,
    pub abi_vectorcall: bool,
    pub structural_match: bool,
    pub dropck_eyepatch: bool,
    pub panic_runtime: bool,
    pub needs_panic_runtime: bool,
    pub compiler_builtins: bool,
    pub abi_unadjusted: bool,
    pub sanitizer_runtime: bool,
    pub profiler_runtime: bool,
    pub abi_thiscall: bool,
    pub allocator_internals: bool,
    pub test_2018_feature: bool,
    pub arm_target_feature: bool,
    pub aarch64_target_feature: bool,
    pub hexagon_target_feature: bool,
    pub powerpc_target_feature: bool,
    pub mips_target_feature: bool,
    pub avx512_target_feature: bool,
    pub mmx_target_feature: bool,
    pub sse4a_target_feature: bool,
    pub tbm_target_feature: bool,
    pub wasm_target_feature: bool,
    pub adx_target_feature: bool,
    pub cmpxchg16b_target_feature: bool,
    pub movbe_target_feature: bool,
    pub rtm_target_feature: bool,
    pub f16c_target_feature: bool,
    pub link_args: bool,
    pub non_ascii_idents: bool,
    pub plugin_registrar: bool,
    pub plugin: bool,
    pub thread_local: bool,
    pub simd_ffi: bool,
    pub custom_attribute: bool,
    pub nll: bool,
    pub slice_patterns: bool,
    pub const_fn: bool,
    pub associated_type_defaults: bool,
    pub no_core: bool,
    pub default_type_parameter_fallback: bool,
    pub repr_simd: bool,
    pub platform_intrinsics: bool,
    pub unwind_attributes: bool,
    pub no_debug: bool,
    pub stmt_expr_attributes: bool,
    pub type_ascription: bool,
    pub cfg_target_thread_local: bool,
    pub specialization: bool,
    pub naked_functions: bool,
    pub cfg_target_has_atomic: bool,
    pub exclusive_range_pattern: bool,
    pub never_type: bool,
    pub exhaustive_patterns: bool,
    pub untagged_unions: bool,
    pub link_cfg: bool,
    pub abi_ptx: bool,
    pub repr128: bool,
    pub static_nobundle: bool,
    pub abi_msp430_interrupt: bool,
    pub decl_macro: bool,
    pub abi_x86_interrupt: bool,
    pub overlapping_marker_traits: bool,
    pub allow_fail: bool,
    pub unsized_tuple_coercion: bool,
    pub generators: bool,
    pub doc_cfg: bool,
    pub doc_masked: bool,
    pub doc_spotlight: bool,
    pub external_doc: bool,
    pub non_exhaustive: bool,
    pub crate_visibility_modifier: bool,
    pub extern_types: bool,
    pub arbitrary_self_types: bool,
    pub in_band_lifetimes: bool,
    pub generic_associated_types: bool,
    pub trait_alias: bool,
    pub infer_static_outlives_requirements: bool,
    pub const_fn_union: bool,
    pub const_raw_ptr_to_usize_cast: bool,
    pub const_raw_ptr_deref: bool,
    pub const_compare_raw_pointers: bool,
    pub doc_alias: bool,
    pub trivial_bounds: bool,
    pub label_break_value: bool,
    pub doc_keyword: bool,
    pub const_transmute: bool,
    pub try_blocks: bool,
    pub alloc_error_handler: bool,
    pub abi_amdgpu_kernel: bool,
    pub const_panic: bool,
    pub marker_trait_attr: bool,
    pub proc_macro_hygiene: bool,
    pub unsized_locals: bool,
    pub custom_test_frameworks: bool,
    pub custom_inner_attributes: bool,
    pub impl_trait_in_bindings: bool,
    pub lint_reasons: bool,
    pub precise_pointer_size_matching: bool,
    pub re_rebalance_coherence: bool,
    pub ffi_returns_twice: bool,
    pub const_generics: bool,
    pub optimize_attribute: bool,
    pub c_variadic: bool,
    pub associated_type_bounds: bool,
    pub const_constructor: bool,
    pub let_chains: bool,
    pub transparent_enums: bool,
    pub transparent_unions: bool,
    pub arbitrary_enum_discriminant: bool,
    pub member_constraints: bool,
    pub async_closure: bool,
    pub cfg_doctest: bool,
    pub const_in_array_repeat_expressions: bool,
    pub type_alias_impl_trait: bool,
    pub or_patterns: bool,
    pub const_extern_fn: bool,
    pub raw_dylib: bool,
    pub track_caller: bool,
}

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_lib_features: Vec<(Symbol, Span)>

#![feature] attrs for non-language (library) features.

rustc_private: bool

Allows using compiler's own crates.

intrinsics: bool

Allows using the rust-intrinsic's "ABI".

lang_items: bool

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

staged_api: bool

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

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).

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).

rustc_const_unstable: bool

Allows using #[rustc_const_unstable(feature = "foo", ..)] which lets a function to be const when opted into with #![feature(foo)].

link_llvm_intrinsics: bool

no-tracking-issue-end Allows using #[link_name="llvm.*"].

rustc_attrs: bool

Allows using rustc_* attributes (RFC 572).

on_unimplemented: bool

Allows using #[on_unimplemented(..)] on traits.

box_syntax: bool

Allows using the box $expr syntax.

main: bool

Allows using #[main] to replace the entrypoint #[lang = "start"] calls.

start: bool

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

fundamental: bool

Allows using the #[fundamental] attribute.

unboxed_closures: bool

Allows using the rust-call ABI.

linkage: bool

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

optin_builtin_traits: bool

Allows features specific to OIBIT (auto traits).

box_patterns: bool

Allows using box in patterns (RFC 469).

prelude_import: bool

Allows using #[prelude_import] on glob use items.

omit_gdb_pretty_printer_section: bool

Allows using #[omit_gdb_pretty_printer_section].

abi_vectorcall: bool

Allows using the vectorcall ABI.

structural_match: bool

Allows using #[structural_match] which indicates that a type is structurally matchable.

dropck_eyepatch: bool

Allows using the may_dangle attribute (RFC 1327).

panic_runtime: bool

Allows using the #![panic_runtime] attribute.

needs_panic_runtime: bool

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

compiler_builtins: bool

Allows identifying the compiler_builtins crate.

abi_unadjusted: bool

Allows using the unadjusted ABI; perma-unstable.

sanitizer_runtime: bool

Allows identifying crates that contain sanitizer runtimes.

profiler_runtime: bool

Used to identify crates that contain the profiler runtime.

abi_thiscall: bool

Allows using the thiscall ABI.

allocator_internals: bool

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

test_2018_feature: bool

Added for testing E0705; perma-unstable.

arm_target_feature: boolaarch64_target_feature: boolhexagon_target_feature: boolpowerpc_target_feature: boolmips_target_feature: boolavx512_target_feature: boolmmx_target_feature: boolsse4a_target_feature: booltbm_target_feature: boolwasm_target_feature: booladx_target_feature: boolcmpxchg16b_target_feature: boolmovbe_target_feature: boolrtm_target_feature: boolf16c_target_feature: boollink_args: bool

Allows using the #[link_args] attribute.

non_ascii_idents: bool

Allows defining identifiers beyond ASCII.

plugin_registrar: bool

Allows using #[plugin_registrar] on functions.

plugin: bool

Allows using #![plugin(myplugin)].

thread_local: bool

Allows using #[thread_local] on static items.

simd_ffi: bool

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

custom_attribute: bool

Allows using custom attributes (RFC 572).

nll: bool

Allows using non lexical lifetimes (RFC 2094).

slice_patterns: bool

Allows using slice patterns.

const_fn: bool

Allows the definition of const functions with some advanced features.

associated_type_defaults: bool

Allows associated type defaults.

no_core: bool

Allows #![no_core].

default_type_parameter_fallback: bool

Allows default type parameters to influence type inference.

repr_simd: bool

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

platform_intrinsics: bool

Allows extern "platform-intrinsic" { ... }.

unwind_attributes: bool

Allows #[unwind(..)].

Permits specifying whether a function should permit unwinding or abort on unwind.

no_debug: bool

Allows #[no_debug].

stmt_expr_attributes: bool

Allows attributes on expressions and non-item statements.

type_ascription: bool

Allows the use of type ascription in expressions.

cfg_target_thread_local: bool

Allows cfg(target_thread_local).

specialization: bool

Allows specialization of implementations (RFC 1210).

naked_functions: bool

Allows using #[naked] on functions.

cfg_target_has_atomic: bool

Allows cfg(target_has_atomic = "...").

exclusive_range_pattern: bool

Allows X..Y patterns.

never_type: bool

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

exhaustive_patterns: bool

Allows exhaustive pattern matching on types that contain uninhabited types.

untagged_unions: bool

Allows untagged unions union U { ... }.

link_cfg: bool

Allows #[link(..., cfg(..))].

abi_ptx: bool

Allows extern "ptx-*" fn().

repr128: bool

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

static_nobundle: bool

Allows #[link(kind="static-nobundle"...)].

abi_msp430_interrupt: bool

Allows extern "msp430-interrupt" fn().

decl_macro: bool

Allows declarative macros 2.0 (macro).

abi_x86_interrupt: bool

Allows extern "x86-interrupt" fn().

overlapping_marker_traits: bool

Allows overlapping impls of marker traits.

allow_fail: bool

Allows a test to fail without failing the whole suite.

unsized_tuple_coercion: bool

Allows unsized tuple coercion.

generators: bool

Allows defining generators.

doc_cfg: bool

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

doc_masked: bool

Allows #[doc(masked)].

doc_spotlight: bool

Allows #[doc(spotlight)].

external_doc: bool

Allows #[doc(include = "some-file")].

non_exhaustive: bool

Allows future-proofing enums/structs with the #[non_exhaustive] attribute (RFC 2008).

crate_visibility_modifier: bool

Allows using crate as visibility modifier, synonymous with pub(crate).

extern_types: bool

Allows defining extern types.

arbitrary_self_types: bool

Allows trait methods with arbitrary self types.

in_band_lifetimes: bool

Allows in-band quantification of lifetime bindings (e.g., fn foo(x: &'a u8) -> &'a u8).

generic_associated_types: bool

Allows associated types to be generic, e.g., type Foo<T>; (RFC 1598).

trait_alias: bool

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

infer_static_outlives_requirements: bool

Allows infering 'static outlives requirements (RFC 2093).

const_fn_union: bool

Allows accessing fields of unions inside const functions.

const_raw_ptr_to_usize_cast: bool

Allows casting raw pointers to usize during const eval.

const_raw_ptr_deref: bool

Allows dereferencing raw pointers during const eval.

const_compare_raw_pointers: bool

Allows comparing raw pointers during const eval.

doc_alias: bool

Allows #[doc(alias = "...")].

trivial_bounds: bool

Allows inconsistent bounds in where clauses.

label_break_value: bool

Allows 'a: { break 'a; }.

doc_keyword: bool

Allows using #[doc(keyword = "...")].

const_transmute: bool

Allows reinterpretation of the bits of a value of one type as another type during const eval.

try_blocks: bool

Allows using try {...} expressions.

alloc_error_handler: bool

Allows defining an #[alloc_error_handler].

abi_amdgpu_kernel: bool

Allows using the amdgpu-kernel ABI.

const_panic: bool

Allows panicking during const eval (producing compile-time errors).

marker_trait_attr: bool

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

proc_macro_hygiene: bool

Allows macro invocations on modules expressions and statements and procedural macros to expand to non-items.

unsized_locals: bool

Allows unsized rvalues at arguments and parameters.

custom_test_frameworks: bool

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

custom_inner_attributes: bool

Allows non-builtin attributes in inner attribute position.

impl_trait_in_bindings: bool

Allows impl Trait in bindings (let, const, static).

lint_reasons: bool

Allows using reason in lint attributes and the #[expect(lint)] lint check.

precise_pointer_size_matching: bool

Allows exhaustive integer pattern matching on usize and isize.

re_rebalance_coherence: bool

Allows relaxing the coherence rules such that impl<T> ForeignTrait<LocalType> for ForeignType<T> is permitted.

ffi_returns_twice: bool

Allows using #[ffi_returns_twice] on foreign functions.

const_generics: bool

Allows const generic types (e.g. struct Foo<const N: usize>(...);).

optimize_attribute: bool

Allows using #[optimize(X)].

c_variadic: bool

Allows using C-variadics.

associated_type_bounds: bool

Allows the user of associated type bounds.

const_constructor: bool

Allows calling constructor functions in const fn.

let_chains: bool

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

transparent_enums: bool

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

transparent_unions: bool

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

arbitrary_enum_discriminant: bool

Allows explicit discriminants on non-unit enum variants.

member_constraints: bool

Allows impl Trait with multiple unrelated lifetimes.

async_closure: bool

Allows async || body closures.

cfg_doctest: bool

Allows the use of #[cfg(doctest)]; set when rustdoc is collecting doctests.

const_in_array_repeat_expressions: bool

Allows [x; N] where x is a constant (RFC 2203).

type_alias_impl_trait: bool

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

or_patterns: bool

Allows the use of or-patterns (e.g., 0 | 1).

const_extern_fn: bool

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

raw_dylib: booltrack_caller: bool

Enable accurate caller location reporting during panic (RFC 2091).

Methods

impl Features[src]

pub fn new() -> Features[src]

pub fn walk_feature_fields<F>(&self, f: F) where
    F: FnMut(&str, bool), 
[src]

Trait Implementations

impl Clone for Features[src]

Auto Trait Implementations

impl !Send for Features

impl !Sync for Features

impl Unpin for Features

impl UnwindSafe for Features

impl RefUnwindSafe for Features

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]

impl<E> SpecializationError for E[src]