[−][src]Struct rustc_ap_syntax::feature_gate::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_private: boolAllows using compiler's own crates.
intrinsics: boolAllows using the rust-intrinsic's "ABI".
lang_items: boolAllows using #[lang = ".."] attribute for linking items to special compiler logic.
staged_api: boolAllows using the #[stable] and #[unstable] attributes.
allow_internal_unstable: boolAllows 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: boolAllows 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: boolAllows using #[rustc_const_unstable(feature = "foo", ..)] which
lets a function to be const when opted into with #![feature(foo)].
link_llvm_intrinsics: boolno-tracking-issue-end
Allows using #[link_name="llvm.*"].
rustc_attrs: boolAllows using rustc_* attributes (RFC 572).
box_syntax: boolAllows using the box $expr syntax.
main: boolAllows using #[main] to replace the entrypoint #[lang = "start"] calls.
start: boolAllows using #[start] on a function indicating that it is the program entrypoint.
fundamental: boolAllows using the #[fundamental] attribute.
unboxed_closures: boolAllows using the rust-call ABI.
linkage: boolAllows using the #[linkage = ".."] attribute.
optin_builtin_traits: boolAllows features specific to OIBIT (auto traits).
box_patterns: boolAllows using box in patterns (RFC 469).
prelude_import: boolAllows using #[prelude_import] on glob use items.
omit_gdb_pretty_printer_section: boolAllows using #[omit_gdb_pretty_printer_section].
abi_vectorcall: boolAllows using the vectorcall ABI.
structural_match: boolAllows using #[structural_match] which indicates that a type is structurally matchable.
dropck_eyepatch: boolAllows using the may_dangle attribute (RFC 1327).
panic_runtime: boolAllows using the #![panic_runtime] attribute.
needs_panic_runtime: boolAllows declaring with #![needs_panic_runtime] that a panic runtime is needed.
compiler_builtins: boolAllows identifying the compiler_builtins crate.
abi_unadjusted: boolAllows using the unadjusted ABI; perma-unstable.
sanitizer_runtime: boolAllows identifying crates that contain sanitizer runtimes.
profiler_runtime: boolUsed to identify crates that contain the profiler runtime.
abi_thiscall: boolAllows using the thiscall ABI.
allocator_internals: boolAllows using #![needs_allocator], an implementation detail of #[global_allocator].
test_2018_feature: boolAdded 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: boolAllows using the #[link_args] attribute.
non_ascii_idents: boolAllows defining identifiers beyond ASCII.
plugin_registrar: boolAllows using #[plugin_registrar] on functions.
plugin: boolAllows using #![plugin(myplugin)].
thread_local: boolAllows using #[thread_local] on static items.
simd_ffi: boolAllows the use of SIMD types in functions declared in extern blocks.
nll: boolAllows using non lexical lifetimes (RFC 2094).
slice_patterns: boolAllows using slice patterns.
const_fn: boolAllows the definition of const functions with some advanced features.
associated_type_defaults: boolAllows associated type defaults.
no_core: boolAllows #![no_core].
default_type_parameter_fallback: boolAllows default type parameters to influence type inference.
repr_simd: boolAllows repr(simd) and importing the various simd intrinsics.
platform_intrinsics: boolAllows extern "platform-intrinsic" { ... }.
unwind_attributes: boolAllows #[unwind(..)].
Permits specifying whether a function should permit unwinding or abort on unwind.
no_debug: boolAllows #[no_debug].
stmt_expr_attributes: boolAllows attributes on expressions and non-item statements.
type_ascription: boolAllows the use of type ascription in expressions.
cfg_target_thread_local: boolAllows cfg(target_thread_local).
specialization: boolAllows specialization of implementations (RFC 1210).
naked_functions: boolAllows using #[naked] on functions.
cfg_target_has_atomic: boolAllows cfg(target_has_atomic = "...").
exclusive_range_pattern: boolAllows X..Y patterns.
never_type: boolAllows the ! type. Does not imply 'exhaustive_patterns' (below) any more.
exhaustive_patterns: boolAllows exhaustive pattern matching on types that contain uninhabited types.
untagged_unions: boolAllows unions to implement Drop. Moreover, unions 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: boolAllows #[link(..., cfg(..))].
abi_ptx: boolAllows extern "ptx-*" fn().
repr128: boolAllows the #[repr(i128)] attribute for enums.
static_nobundle: boolAllows #[link(kind="static-nobundle"...)].
abi_msp430_interrupt: boolAllows extern "msp430-interrupt" fn().
decl_macro: boolAllows declarative macros 2.0 (macro).
abi_x86_interrupt: boolAllows extern "x86-interrupt" fn().
overlapping_marker_traits: boolAllows overlapping impls of marker traits.
allow_fail: boolAllows a test to fail without failing the whole suite.
unsized_tuple_coercion: boolAllows unsized tuple coercion.
generators: boolAllows defining generators.
doc_cfg: boolAllows #[doc(cfg(...))].
doc_masked: boolAllows #[doc(masked)].
doc_spotlight: boolAllows #[doc(spotlight)].
external_doc: boolAllows #[doc(include = "some-file")].
crate_visibility_modifier: boolAllows using crate as visibility modifier, synonymous with pub(crate).
extern_types: boolAllows defining extern types.
arbitrary_self_types: boolAllows trait methods with arbitrary self types.
in_band_lifetimes: boolAllows in-band quantification of lifetime bindings (e.g., fn foo(x: &'a u8) -> &'a u8).
generic_associated_types: boolAllows associated types to be generic, e.g., type Foo<T>; (RFC 1598).
trait_alias: boolAllows defining trait X = A + B; alias items.
infer_static_outlives_requirements: boolAllows infering 'static outlives requirements (RFC 2093).
const_fn_union: boolAllows accessing fields of unions inside const functions.
const_raw_ptr_to_usize_cast: boolAllows casting raw pointers to usize during const eval.
const_raw_ptr_deref: boolAllows dereferencing raw pointers during const eval.
const_compare_raw_pointers: boolAllows comparing raw pointers during const eval.
doc_alias: boolAllows #[doc(alias = "...")].
trivial_bounds: boolAllows inconsistent bounds in where clauses.
label_break_value: boolAllows 'a: { break 'a; }.
doc_keyword: boolAllows using #[doc(keyword = "...")].
const_transmute: boolAllows reinterpretation of the bits of a value of one type as another type during const eval.
try_blocks: boolAllows using try {...} expressions.
alloc_error_handler: boolAllows defining an #[alloc_error_handler].
abi_amdgpu_kernel: boolAllows using the amdgpu-kernel ABI.
const_panic: boolAllows panicking during const eval (producing compile-time errors).
marker_trait_attr: boolAllows #[marker] on certain traits allowing overlapping implementations.
proc_macro_hygiene: boolAllows macro invocations on modules expressions and statements and procedural macros to expand to non-items.
unsized_locals: boolAllows unsized rvalues at arguments and parameters.
custom_test_frameworks: boolAllows custom test frameworks with #![test_runner] and #[test_case].
custom_inner_attributes: boolAllows non-builtin attributes in inner attribute position.
impl_trait_in_bindings: boolAllows impl Trait in bindings (let, const, static).
lint_reasons: boolAllows using reason in lint attributes and the #[expect(lint)] lint check.
precise_pointer_size_matching: boolAllows exhaustive integer pattern matching on usize and isize.
ffi_returns_twice: boolAllows using #[ffi_returns_twice] on foreign functions.
const_generics: boolAllows const generic types (e.g. struct Foo<const N: usize>(...);).
optimize_attribute: boolAllows using #[optimize(X)].
c_variadic: boolAllows using C-variadics.
associated_type_bounds: boolAllows the user of associated type bounds.
let_chains: boolAllows if/while p && let q = r && ... chains.
transparent_enums: boolAllows #[repr(transparent)] on enums (RFC 2645).
transparent_unions: boolAllows #[repr(transparent)] on unions (RFC 2645).
arbitrary_enum_discriminant: boolAllows explicit discriminants on non-unit enum variants.
member_constraints: boolAllows impl Trait with multiple unrelated lifetimes.
async_closure: boolAllows async || body closures.
const_in_array_repeat_expressions: boolAllows [x; N] where x is a constant (RFC 2203).
type_alias_impl_trait: boolAllows impl Trait to be used inside type aliases (RFC 2515).
or_patterns: boolAllows the use of or-patterns (e.g., 0 | 1).
const_extern_fn: boolAllows the definition of const extern fn and const unsafe extern fn.
raw_dylib: boolAllows the use of raw-dylibs (RFC 2627).
track_caller: boolAllows #[track_caller] to be used which provides
accurate caller location reporting during panic (RFC 2091).
object_safe_for_dispatch: boolAllows 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: boolAllows using the efiapi ABI.
register_attr: boolAllows using the #[register_attr] attribute.
register_tool: boolAllows using the #[register_attr] attribute.
Methods
impl Features[src]
pub fn new() -> Features[src]
pub fn walk_feature_fields<F>(&self, f: F) where
F: FnMut(&str, bool), [src]
F: FnMut(&str, bool),
Trait Implementations
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]
U: From<T>,
impl<T> From<T> for T[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
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<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,