2019-08-20 11:50:33 -05:00
|
|
|
//! List of the active feature gates.
|
|
|
|
|
2019-09-05 21:56:45 -05:00
|
|
|
use super::{State, Feature};
|
|
|
|
|
2019-08-20 11:50:33 -05:00
|
|
|
use crate::edition::Edition;
|
|
|
|
use crate::symbol::{Symbol, sym};
|
2019-09-05 21:56:45 -05:00
|
|
|
|
2019-08-20 11:50:33 -05:00
|
|
|
use syntax_pos::Span;
|
|
|
|
|
|
|
|
macro_rules! set {
|
|
|
|
($field: ident) => {{
|
|
|
|
fn f(features: &mut Features, _: Span) {
|
|
|
|
features.$field = true;
|
|
|
|
}
|
|
|
|
f as fn(&mut Features, Span)
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! declare_features {
|
2019-08-24 10:47:26 -05:00
|
|
|
($(
|
|
|
|
$(#[doc = $doc:tt])* (active, $feature:ident, $ver:expr, $issue:expr, $edition:expr),
|
|
|
|
)+) => {
|
2019-08-20 11:50:33 -05:00
|
|
|
/// Represents active features that are currently being implemented or
|
|
|
|
/// currently being considered for addition/removal.
|
|
|
|
pub const ACTIVE_FEATURES:
|
2019-08-24 10:47:26 -05:00
|
|
|
&[Feature] =
|
|
|
|
&[$(
|
|
|
|
// (sym::$feature, $ver, $issue, $edition, set!($feature))
|
|
|
|
Feature {
|
|
|
|
state: State::Active { set: set!($feature) },
|
|
|
|
name: sym::$feature,
|
|
|
|
since: $ver,
|
|
|
|
issue: $issue,
|
|
|
|
edition: $edition,
|
|
|
|
description: concat!($($doc,)*),
|
|
|
|
}
|
|
|
|
),+];
|
2019-08-20 11:50:33 -05:00
|
|
|
|
|
|
|
/// A set of features to be used by later passes.
|
|
|
|
#[derive(Clone)]
|
|
|
|
pub struct Features {
|
2019-09-05 21:56:45 -05:00
|
|
|
/// `#![feature]` attrs for language features, for error reporting.
|
2019-08-20 11:50:33 -05:00
|
|
|
pub declared_lang_features: Vec<(Symbol, Span, Option<Symbol>)>,
|
2019-09-05 21:56:45 -05:00
|
|
|
/// `#![feature]` attrs for non-language (library) features.
|
2019-08-20 11:50:33 -05:00
|
|
|
pub declared_lib_features: Vec<(Symbol, Span)>,
|
2019-08-24 10:47:26 -05:00
|
|
|
$(
|
|
|
|
$(#[doc = $doc])*
|
|
|
|
pub $feature: bool
|
|
|
|
),+
|
2019-08-20 11:50:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Features {
|
|
|
|
pub fn new() -> Features {
|
|
|
|
Features {
|
|
|
|
declared_lang_features: Vec::new(),
|
|
|
|
declared_lib_features: Vec::new(),
|
|
|
|
$($feature: false),+
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn walk_feature_fields<F>(&self, mut f: F)
|
|
|
|
where F: FnMut(&str, bool)
|
|
|
|
{
|
|
|
|
$(f(stringify!($feature), self.$feature);)+
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-08-24 10:50:21 -05:00
|
|
|
impl Feature {
|
2019-09-05 21:56:45 -05:00
|
|
|
/// Sets this feature in `Features`. Panics if called on a non-active feature.
|
2019-08-24 10:50:21 -05:00
|
|
|
pub fn set(&self, features: &mut Features, span: Span) {
|
|
|
|
match self.state {
|
|
|
|
State::Active { set } => set(features, span),
|
2019-09-05 21:56:45 -05:00
|
|
|
_ => panic!("called `set` on feature `{}` which is not `active`", self.name)
|
2019-08-24 10:50:21 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-20 11:50:33 -05:00
|
|
|
// If you change this, please modify `src/doc/unstable-book` as well.
|
|
|
|
//
|
|
|
|
// Don't ever remove anything from this list; move them to `removed.rs`.
|
|
|
|
//
|
|
|
|
// The version numbers here correspond to the version in which the current status
|
|
|
|
// was set. This is most important for knowing when a particular feature became
|
|
|
|
// stable (active).
|
|
|
|
//
|
|
|
|
// Note that the features are grouped into internal/user-facing and then
|
2019-08-24 10:47:26 -05:00
|
|
|
// sorted by version inside those groups. This is enforced with tidy.
|
2019-08-20 11:50:33 -05:00
|
|
|
//
|
|
|
|
// N.B., `tools/tidy/src/features.rs` parses this information directly out of the
|
|
|
|
// source, so take care when modifying it.
|
|
|
|
|
|
|
|
declare_features! (
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// feature-group-start: internal feature gates
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// no-tracking-issue-start
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using compiler's own crates.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, rustc_private, "1.0.0", Some(27812), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `rust-intrinsic`'s "ABI".
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, intrinsics, "1.0.0", None, None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[lang = ".."]` attribute for linking items to special compiler logic.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, lang_items, "1.0.0", None, None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `#[stable]` and `#[unstable]` attributes.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, staged_api, "1.0.0", None, None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// 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).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, allow_internal_unstable, "1.0.0", None, None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// 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).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, allow_internal_unsafe, "1.0.0", None, None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[rustc_const_unstable(feature = "foo", ..)]` which
|
|
|
|
/// lets a function to be `const` when opted into with `#![feature(foo)]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, rustc_const_unstable, "1.0.0", None, None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// no-tracking-issue-end
|
2019-08-20 11:50:33 -05:00
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[link_name="llvm.*"]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, link_llvm_intrinsics, "1.0.0", Some(29602), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `rustc_*` attributes (RFC 572).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, rustc_attrs, "1.0.0", Some(29642), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[on_unimplemented(..)]` on traits.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, on_unimplemented, "1.0.0", Some(29628), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `box $expr` syntax.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, box_syntax, "1.0.0", Some(49733), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[main]` to replace the entrypoint `#[lang = "start"]` calls.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, main, "1.0.0", Some(29634), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[start]` on a function indicating that it is the program entrypoint.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, start, "1.0.0", Some(29633), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `#[fundamental]` attribute.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, fundamental, "1.0.0", Some(29635), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `rust-call` ABI.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, unboxed_closures, "1.0.0", Some(29625), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `#[linkage = ".."]` attribute.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, linkage, "1.0.0", Some(29603), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows features specific to OIBIT (auto traits).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, optin_builtin_traits, "1.0.0", Some(13231), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `box` in patterns (RFC 469).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, box_patterns, "1.0.0", Some(29641), None),
|
|
|
|
|
|
|
|
// no-tracking-issue-start
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[prelude_import]` on glob `use` items.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, prelude_import, "1.2.0", None, None),
|
|
|
|
|
|
|
|
// no-tracking-issue-end
|
|
|
|
|
|
|
|
// no-tracking-issue-start
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[omit_gdb_pretty_printer_section]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, omit_gdb_pretty_printer_section, "1.5.0", None, None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `vectorcall` ABI.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, abi_vectorcall, "1.7.0", None, None),
|
|
|
|
|
|
|
|
// no-tracking-issue-end
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[structural_match]` which indicates that a type is structurally matchable.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, structural_match, "1.8.0", Some(31434), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `may_dangle` attribute (RFC 1327).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, dropck_eyepatch, "1.10.0", Some(34761), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `#![panic_runtime]` attribute.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, panic_runtime, "1.10.0", Some(32837), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows declaring with `#![needs_panic_runtime]` that a panic runtime is needed.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, needs_panic_runtime, "1.10.0", Some(32837), None),
|
|
|
|
|
|
|
|
// no-tracking-issue-start
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows identifying the `compiler_builtins` crate.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, compiler_builtins, "1.13.0", None, None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `unadjusted` ABI; perma-unstable.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, abi_unadjusted, "1.16.0", None, None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows identifying crates that contain sanitizer runtimes.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, sanitizer_runtime, "1.17.0", None, None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Used to identify crates that contain the profiler runtime.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, profiler_runtime, "1.18.0", None, None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `thiscall` ABI.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, abi_thiscall, "1.19.0", None, None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#![needs_allocator]`, an implementation detail of `#[global_allocator]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, allocator_internals, "1.20.0", None, None),
|
|
|
|
|
|
|
|
// no-tracking-issue-end
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Added for testing E0705; perma-unstable.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, test_2018_feature, "1.31.0", Some(0), Some(Edition::Edition2018)),
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// feature-group-end: internal feature gates
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// feature-group-start: actual feature gates (target features)
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// FIXME: Document these and merge with the list below.
|
|
|
|
|
|
|
|
// Unstable `#[target_feature]` directives.
|
|
|
|
(active, arm_target_feature, "1.27.0", Some(44839), None),
|
|
|
|
(active, aarch64_target_feature, "1.27.0", Some(44839), None),
|
|
|
|
(active, hexagon_target_feature, "1.27.0", Some(44839), None),
|
|
|
|
(active, powerpc_target_feature, "1.27.0", Some(44839), None),
|
|
|
|
(active, mips_target_feature, "1.27.0", Some(44839), None),
|
|
|
|
(active, avx512_target_feature, "1.27.0", Some(44839), None),
|
|
|
|
(active, mmx_target_feature, "1.27.0", Some(44839), None),
|
|
|
|
(active, sse4a_target_feature, "1.27.0", Some(44839), None),
|
|
|
|
(active, tbm_target_feature, "1.27.0", Some(44839), None),
|
|
|
|
(active, wasm_target_feature, "1.30.0", Some(44839), None),
|
|
|
|
(active, adx_target_feature, "1.32.0", Some(44839), None),
|
|
|
|
(active, cmpxchg16b_target_feature, "1.32.0", Some(44839), None),
|
|
|
|
(active, movbe_target_feature, "1.34.0", Some(44839), None),
|
|
|
|
(active, rtm_target_feature, "1.35.0", Some(44839), None),
|
|
|
|
(active, f16c_target_feature, "1.36.0", Some(44839), None),
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// feature-group-end: actual feature gates (target features)
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// feature-group-start: actual feature gates
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `#[link_args]` attribute.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, link_args, "1.0.0", Some(29596), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows defining identifiers beyond ASCII.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, non_ascii_idents, "1.0.0", Some(55467), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[plugin_registrar]` on functions.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, plugin_registrar, "1.0.0", Some(29597), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#![plugin(myplugin)]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, plugin, "1.0.0", Some(29597), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[thread_local]` on `static` items.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, thread_local, "1.0.0", Some(29594), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows the use of SIMD types in functions declared in `extern` blocks.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, simd_ffi, "1.0.0", Some(27731), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using custom attributes (RFC 572).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, custom_attribute, "1.0.0", Some(29642), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using non lexical lifetimes (RFC 2094).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, nll, "1.0.0", Some(43234), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using slice patterns.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, slice_patterns, "1.0.0", Some(62254), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows the definition of `const` functions with some advanced features.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, const_fn, "1.2.0", Some(57563), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows associated type defaults.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, associated_type_defaults, "1.2.0", Some(29661), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `#![no_core]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, no_core, "1.3.0", Some(29639), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows default type parameters to influence type inference.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, default_type_parameter_fallback, "1.3.0", Some(27336), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `repr(simd)` and importing the various simd intrinsics.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, repr_simd, "1.4.0", Some(27731), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `extern "platform-intrinsic" { ... }`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, platform_intrinsics, "1.4.0", Some(27731), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `#[unwind(..)]`.
|
|
|
|
///
|
|
|
|
/// Permits specifying whether a function should permit unwinding or abort on unwind.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, unwind_attributes, "1.4.0", Some(58760), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `#[no_debug]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, no_debug, "1.5.0", Some(29721), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows attributes on expressions and non-item statements.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, stmt_expr_attributes, "1.6.0", Some(15701), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows the use of type ascription in expressions.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, type_ascription, "1.6.0", Some(23416), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `cfg(target_thread_local)`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, cfg_target_thread_local, "1.7.0", Some(29594), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows specialization of implementations (RFC 1210).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, specialization, "1.7.0", Some(31844), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[naked]` on functions.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, naked_functions, "1.9.0", Some(32408), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `cfg(target_has_atomic = "...")`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, cfg_target_has_atomic, "1.9.0", Some(32976), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `X..Y` patterns.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, exclusive_range_pattern, "1.11.0", Some(37854), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows the `!` type. Does not imply 'exhaustive_patterns' (below) any more.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, never_type, "1.13.0", Some(35121), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows exhaustive pattern matching on types that contain uninhabited types.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, exhaustive_patterns, "1.13.0", Some(51085), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows untagged unions `union U { ... }`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, untagged_unions, "1.13.0", Some(32836), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `#[link(..., cfg(..))]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, link_cfg, "1.14.0", Some(37406), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `extern "ptx-*" fn()`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, abi_ptx, "1.15.0", Some(38788), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows the `#[repr(i128)]` attribute for enums.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, repr128, "1.16.0", Some(35118), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `#[link(kind="static-nobundle"...)]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, static_nobundle, "1.16.0", Some(37403), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `extern "msp430-interrupt" fn()`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, abi_msp430_interrupt, "1.16.0", Some(38487), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows declarative macros 2.0 (`macro`).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, decl_macro, "1.17.0", Some(39412), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `extern "x86-interrupt" fn()`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, abi_x86_interrupt, "1.17.0", Some(40180), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows overlapping impls of marker traits.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, overlapping_marker_traits, "1.18.0", Some(29864), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows a test to fail without failing the whole suite.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, allow_fail, "1.19.0", Some(46488), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows unsized tuple coercion.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, unsized_tuple_coercion, "1.20.0", Some(42877), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows defining generators.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, generators, "1.21.0", Some(43122), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `#[doc(cfg(...))]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, doc_cfg, "1.21.0", Some(43781), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `#[doc(masked)]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, doc_masked, "1.21.0", Some(44027), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `#[doc(spotlight)]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, doc_spotlight, "1.22.0", Some(45040), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `#[doc(include = "some-file")]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, external_doc, "1.22.0", Some(44732), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows future-proofing enums/structs with the `#[non_exhaustive]` attribute (RFC 2008).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, non_exhaustive, "1.22.0", Some(44109), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `crate` as visibility modifier, synonymous with `pub(crate)`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, crate_visibility_modifier, "1.23.0", Some(53120), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows defining `extern type`s.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, extern_types, "1.23.0", Some(43467), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows trait methods with arbitrary self types.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, arbitrary_self_types, "1.23.0", Some(44874), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows in-band quantification of lifetime bindings (e.g., `fn foo(x: &'a u8) -> &'a u8`).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, in_band_lifetimes, "1.23.0", Some(44524), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows associated types to be generic, e.g., `type Foo<T>;` (RFC 1598).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, generic_associated_types, "1.23.0", Some(44265), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows defining `trait X = A + B;` alias items.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, trait_alias, "1.24.0", Some(41517), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows infering `'static` outlives requirements (RFC 2093).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, infer_static_outlives_requirements, "1.26.0", Some(54185), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows accessing fields of unions inside `const` functions.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, const_fn_union, "1.27.0", Some(51909), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows casting raw pointers to `usize` during const eval.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, const_raw_ptr_to_usize_cast, "1.27.0", Some(51910), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows dereferencing raw pointers during const eval.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, const_raw_ptr_deref, "1.27.0", Some(51911), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows comparing raw pointers during const eval.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, const_compare_raw_pointers, "1.27.0", Some(53020), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `#[doc(alias = "...")]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, doc_alias, "1.27.0", Some(50146), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows inconsistent bounds in where clauses.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, trivial_bounds, "1.28.0", Some(48214), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `'a: { break 'a; }`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, label_break_value, "1.28.0", Some(48594), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[doc(keyword = "...")]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, doc_keyword, "1.28.0", Some(51315), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows reinterpretation of the bits of a value of one type as another
|
|
|
|
/// type during const eval.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, const_transmute, "1.29.0", Some(53605), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `try {...}` expressions.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, try_blocks, "1.29.0", Some(31436), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows defining an `#[alloc_error_handler]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, alloc_error_handler, "1.29.0", Some(51540), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using the `amdgpu-kernel` ABI.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, abi_amdgpu_kernel, "1.29.0", Some(51575), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows panicking during const eval (producing compile-time errors).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, const_panic, "1.30.0", Some(51999), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `#[marker]` on certain traits allowing overlapping implementations.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, marker_trait_attr, "1.30.0", Some(29864), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows macro invocations on modules expressions and statements and
|
|
|
|
/// procedural macros to expand to non-items.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, proc_macro_hygiene, "1.30.0", Some(54727), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows unsized rvalues at arguments and parameters.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, unsized_locals, "1.30.0", Some(48055), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows custom test frameworks with `#![test_runner]` and `#[test_case]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, custom_test_frameworks, "1.30.0", Some(50297), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows non-builtin attributes in inner attribute position.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, custom_inner_attributes, "1.30.0", Some(54726), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `impl Trait` in bindings (`let`, `const`, `static`).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, impl_trait_in_bindings, "1.30.0", Some(63065), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `reason` in lint attributes and the `#[expect(lint)]` lint check.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, lint_reasons, "1.31.0", Some(54503), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows exhaustive integer pattern matching on `usize` and `isize`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, precise_pointer_size_matching, "1.32.0", Some(56354), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows relaxing the coherence rules such that
|
2019-09-05 21:56:45 -05:00
|
|
|
/// `impl<T> ForeignTrait<LocalType> for ForeignType<T>` is permitted.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, re_rebalance_coherence, "1.32.0", Some(55437), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[ffi_returns_twice]` on foreign functions.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, ffi_returns_twice, "1.34.0", Some(58314), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows const generic types (e.g. `struct Foo<const N: usize>(...);`).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, const_generics, "1.34.0", Some(44580), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using `#[optimize(X)]`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, optimize_attribute, "1.34.0", Some(54882), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows using C-variadics.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, c_variadic, "1.34.0", Some(44930), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows the user of associated type bounds.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, associated_type_bounds, "1.34.0", Some(52662), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows calling constructor functions in `const fn`.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, const_constructor, "1.37.0", Some(61456), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `if/while p && let q = r && ...` chains.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, let_chains, "1.37.0", Some(53667), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows #[repr(transparent)] on enums (RFC 2645).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, transparent_enums, "1.37.0", Some(60405), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows #[repr(transparent)] on unions (RFC 2645).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, transparent_unions, "1.37.0", Some(60405), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows explicit discriminants on non-unit enum variants.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, arbitrary_enum_discriminant, "1.37.0", Some(60553), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `impl Trait` with multiple unrelated lifetimes.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, member_constraints, "1.37.0", Some(61977), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `async || body` closures.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, async_closure, "1.37.0", Some(62290), None),
|
|
|
|
|
2019-09-05 21:56:45 -05:00
|
|
|
/// Allows the use of `#[cfg(doctest)]`; set when rustdoc is collecting doctests.
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, cfg_doctest, "1.37.0", Some(62210), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `[x; N]` where `x` is a constant (RFC 2203).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, const_in_array_repeat_expressions, "1.37.0", Some(49147), None),
|
|
|
|
|
2019-08-24 10:47:26 -05:00
|
|
|
/// Allows `impl Trait` to be used inside type aliases (RFC 2515).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, type_alias_impl_trait, "1.38.0", Some(63063), None),
|
|
|
|
|
2019-09-05 21:56:45 -05:00
|
|
|
/// Allows the use of or-patterns (e.g., `0 | 1`).
|
2019-08-20 11:50:33 -05:00
|
|
|
(active, or_patterns, "1.38.0", Some(54883), None),
|
|
|
|
|
2019-09-29 18:22:18 -05:00
|
|
|
/// Allows the definition of `const extern fn` and `const unsafe extern fn`.
|
|
|
|
(active, const_extern_fn, "1.40.0", Some(64926), None),
|
|
|
|
|
2019-08-27 09:42:44 -05:00
|
|
|
// Allows the use of raw-dylibs (RFC 2627).
|
2019-10-06 17:52:35 -05:00
|
|
|
(active, raw_dylib, "1.40.0", Some(58713), None),
|
2019-08-27 09:42:44 -05:00
|
|
|
|
2019-07-19 19:55:58 -05:00
|
|
|
/// Enable accurate caller location reporting during panic (RFC 2091).
|
2019-10-02 23:32:59 -05:00
|
|
|
(active, track_caller, "1.40.0", Some(47809), None),
|
2019-07-19 19:55:58 -05:00
|
|
|
|
2019-01-08 15:14:04 -06:00
|
|
|
/// Non-object safe trait objects safe to use but cannot be created in safe rust
|
|
|
|
(active, object_safe_for_dispatch, "1.40.0", Some(43561), None),
|
|
|
|
|
2019-10-24 10:29:29 -05:00
|
|
|
/// Allows using the `efiapi` ABI.
|
|
|
|
(active, abi_efiapi, "1.40.0", Some(1), None),
|
|
|
|
|
2019-08-20 11:50:33 -05:00
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// feature-group-end: actual feature gates
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
);
|
|
|
|
|
|
|
|
/// 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.
|
|
|
|
pub const INCOMPLETE_FEATURES: &[Symbol] = &[
|
|
|
|
sym::impl_trait_in_bindings,
|
|
|
|
sym::generic_associated_types,
|
|
|
|
sym::const_generics,
|
|
|
|
sym::or_patterns,
|
|
|
|
sym::let_chains,
|
2019-09-18 09:40:08 -05:00
|
|
|
sym::raw_dylib,
|
2019-10-03 00:09:18 -05:00
|
|
|
sym::track_caller,
|
2019-08-20 11:50:33 -05:00
|
|
|
];
|