[−][src]Struct rustc_ap_rustc_feature::Features
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_attrs: bool
Allows using rustc_*
attributes (RFC 572).
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).
link_llvm_intrinsics: bool
no-tracking-issue-end
Allows using #[link_name="llvm.*"]
.
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.
FIXME: Subsumed by trait StructuralPartialEq
, cannot move to removed until a library
feature with the same name exists.
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.
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.
no_niche: bool
Allows #[repr(no_niche)]
(an implementation detail of rustc
,
it is not on path for eventual stabilization).
arm_target_feature: bool
aarch64_target_feature: bool
hexagon_target_feature: bool
powerpc_target_feature: bool
mips_target_feature: bool
avx512_target_feature: bool
mmx_target_feature: bool
sse4a_target_feature: bool
tbm_target_feature: bool
wasm_target_feature: bool
adx_target_feature: bool
cmpxchg16b_target_feature: bool
movbe_target_feature: bool
rtm_target_feature: bool
f16c_target_feature: bool
link_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.
nll: bool
Allows using non lexical lifetimes (RFC 2094).
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.
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).
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.
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 union
s to implement Drop
. Moreover, union
s may now include fields
that don't implement Copy
as long as they don't have any drop glue.
This is checked recursively. On encountering type variable where no progress can be made,
T: Copy
is used as a substitute for "no drop glue".
NOTE: A limited form of union U { ... }
was accepted in 1.19.0.
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()
.
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)]
.
external_doc: bool
Allows #[doc(include = "some-file")]
.
crate_visibility_modifier: bool
Allows using crate
as visibility modifier, synonymous with pub(crate)
.
extern_types: bool
Allows defining extern type
s.
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 inferring '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 = "...")]
.
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
.
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.
let_chains: bool
Allows if/while p && let q = r && ...
chains.
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.
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: bool
Allows the use of raw-dylibs (RFC 2627).
track_caller: bool
Allows #[track_caller]
to be used which provides
accurate caller location reporting during panic (RFC 2091).
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.
abi_efiapi: bool
Allows using the efiapi
ABI.
raw_ref_op: bool
Allows &raw const $place_expr
and &raw mut $place_expr
expressions.
never_type_fallback: bool
Allows diverging expressions to fall back to !
rather than ()
.
register_attr: bool
Allows using the #[register_attr]
attribute.
register_tool: bool
Allows using the #[register_tool]
attribute.
const_if_match: bool
Allows the use of if
and match
in constants.
cfg_sanitize: bool
Allows the use of #[cfg(sanitize = "option")]
; set when -Zsanitizer is used.
half_open_range_patterns: bool
Allows using ..X
, ..=X
, ...X
, and X..
as a pattern.
const_mut_refs: bool
Allows using &mut
in constant functions.
const_loop: bool
Allows the use of loop
and while
in constants.
bindings_after_at: bool
Allows bindings in the subpattern of a binding pattern.
For example, you can write x @ Some(y)
.
move_ref_pattern: bool
Allows patterns with concurrent by-move and by-ref bindings.
For example, you can write Foo(a, ref b)
where a
is by-move and b
is by-ref.
const_trait_impl: bool
Allows impl const Trait for T
syntax.
const_trait_bound_opt_out: bool
Allows T: ?const Trait
syntax in bounds.
no_sanitize: bool
Allows the use of no_sanitize
attribute.
const_eval_limit: bool
negative_impls: bool
Allow negative trait implementations.
Methods
impl Features
[src]
pub fn walk_feature_fields(&self, f: impl FnMut(&str, bool))
[src]
pub fn enabled(&self, feature: Symbol) -> bool
[src]
Is the given feature enabled?
Panics if the symbol doesn't correspond to a declared feature.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Features
impl !Send for Features
impl !Sync for Features
impl Unpin for Features
impl UnwindSafe for Features
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<E> SpecializationError for E
[src]
default fn not_found<S, T>(
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
[src]
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,