rust/compiler/rustc_feature/src/accepted.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

401 lines
23 KiB
Rust
Raw Normal View History

//! List of the accepted feature gates.
use super::{to_nonzero, Feature};
use rustc_span::symbol::sym;
macro_rules! declare_features {
($(
2023-12-10 09:34:13 -08:00
$(#[doc = $doc:tt])* (accepted, $feature:ident, $ver:expr, $issue:expr),
)+) => {
/// Formerly unstable features that have now been accepted (stabilized).
pub const ACCEPTED_FEATURES: &[Feature] = &[
$(Feature {
name: sym::$feature,
since: $ver,
issue: to_nonzero($issue),
}),+
];
}
}
#[rustfmt::skip]
declare_features! (
// -------------------------------------------------------------------------
// feature-group-start: for testing purposes
// -------------------------------------------------------------------------
/// A temporary feature gate used to enable parser extensions needed
/// to bootstrap fix for #5723.
2023-12-10 09:34:13 -08:00
(accepted, issue_5723_bootstrap, "1.0.0", None),
/// These are used to test this portion of the compiler,
/// they don't actually mean anything.
2023-12-10 09:34:13 -08:00
(accepted, test_accepted_feature, "1.0.0", None),
// !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!!
// Features are listed in alphabetical order. Tidy will fail if you don't keep it this way.
// !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!!
// -------------------------------------------------------------------------
// feature-group-end: for testing purposes
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
// feature-group-start: accepted features
// -------------------------------------------------------------------------
2022-02-10 16:43:45 +00:00
/// Allows `#[target_feature(...)]` on aarch64 platforms
2023-12-10 09:34:13 -08:00
(accepted, aarch64_target_feature, "1.61.0", Some(44839)),
/// Allows using the `efiapi` ABI.
2023-12-10 09:34:13 -08:00
(accepted, abi_efiapi, "1.68.0", Some(65815)),
/// Allows the sysV64 ABI to be specified on all platforms
/// instead of just the platforms on which it is the C ABI.
2023-12-10 09:34:13 -08:00
(accepted, abi_sysv64, "1.24.0", Some(36167)),
2023-08-06 23:20:53 +02:00
/// Allows using the `thiscall` ABI.
2023-12-10 09:34:13 -08:00
(accepted, abi_thiscall, "1.73.0", None),
/// Allows using ADX intrinsics from `core::arch::{x86, x86_64}`.
2023-12-10 09:34:13 -08:00
(accepted, adx_target_feature, "1.61.0", Some(44839)),
/// Allows explicit discriminants on non-unit enum variants.
2023-12-10 09:34:13 -08:00
(accepted, arbitrary_enum_discriminant, "1.66.0", Some(60553)),
2022-10-17 22:38:37 +01:00
/// Allows using `sym` operands in inline assembly.
2023-12-10 09:34:13 -08:00
(accepted, asm_sym, "1.66.0", Some(93333)),
/// Allows the definition of associated constants in `trait` or `impl` blocks.
2023-12-10 09:34:13 -08:00
(accepted, associated_consts, "1.20.0", Some(29646)),
2024-03-05 18:23:01 +00:00
/// Allows the user of associated type bounds.
2024-04-28 09:28:27 -04:00
(accepted, associated_type_bounds, "1.79.0", Some(52662)),
/// Allows using associated `type`s in `trait`s.
2023-12-10 09:34:13 -08:00
(accepted, associated_types, "1.0.0", None),
/// Allows free and inherent `async fn`s, `async` blocks, and `<expr>.await` expressions.
2023-12-10 09:34:13 -08:00
(accepted, async_await, "1.39.0", Some(50547)),
2023-09-13 16:04:42 +00:00
/// Allows async functions to be declared, implemented, and used in traits.
2023-12-10 09:34:13 -08:00
(accepted, async_fn_in_trait, "1.75.0", Some(91611)),
/// Allows all literals in attribute lists and values of key-value pairs.
2023-12-10 09:34:13 -08:00
(accepted, attr_literals, "1.30.0", Some(34981)),
/// Allows overloading augmented assignment operations like `a += b`.
2023-12-10 09:34:13 -08:00
(accepted, augmented_assignments, "1.8.0", Some(28235)),
/// Allows mixing bind-by-move in patterns and references to those identifiers in guards.
2023-12-10 09:34:13 -08:00
(accepted, bind_by_move_pattern_guards, "1.39.0", Some(15287)),
/// Allows bindings in the subpattern of a binding pattern.
/// For example, you can write `x @ Some(y)`.
2023-12-10 09:34:13 -08:00
(accepted, bindings_after_at, "1.56.0", Some(65490)),
/// Allows empty structs and enum variants with braces.
2023-12-10 09:34:13 -08:00
(accepted, braced_empty_structs, "1.8.0", Some(29720)),
2023-11-01 09:16:34 +09:00
/// Allows `c"foo"` literals.
2024-02-03 16:37:58 -05:00
(accepted, c_str_literals, "1.77.0", Some(105723)),
/// Allows `#[cfg_attr(predicate, multiple, attributes, here)]`.
2023-12-10 09:34:13 -08:00
(accepted, cfg_attr_multi, "1.33.0", Some(54881)),
/// Allows the use of `#[cfg(doctest)]`, set when rustdoc is collecting doctests.
2023-12-10 09:34:13 -08:00
(accepted, cfg_doctest, "1.40.0", Some(62210)),
/// Enables `#[cfg(panic = "...")]` config key.
2023-12-10 09:34:13 -08:00
(accepted, cfg_panic, "1.60.0", Some(77443)),
2024-01-04 19:06:37 +00:00
/// Allows `cfg(target_abi = "...")`.
(accepted, cfg_target_abi, "1.78.0", Some(80970)),
/// Allows `cfg(target_feature = "...")`.
2023-12-10 09:34:13 -08:00
(accepted, cfg_target_feature, "1.27.0", Some(29717)),
/// Allows `cfg(target_vendor = "...")`.
2023-12-10 09:34:13 -08:00
(accepted, cfg_target_vendor, "1.33.0", Some(29718)),
/// Allows implementing `Clone` for closures where possible (RFC 2132).
2023-12-10 09:34:13 -08:00
(accepted, clone_closures, "1.26.0", Some(44490)),
/// Allows coercing non capturing closures to function pointers.
2023-12-10 09:34:13 -08:00
(accepted, closure_to_fn_coercion, "1.19.0", Some(39817)),
2023-02-05 19:27:35 -05:00
/// Allows using the CMPXCHG16B target feature.
2023-12-10 09:34:13 -08:00
(accepted, cmpxchg16b_target_feature, "1.69.0", Some(44839)),
/// Allows use of the `#[collapse_debuginfo]` attribute.
2024-04-28 09:28:27 -04:00
(accepted, collapse_debuginfo, "1.79.0", Some(100758)),
/// Allows usage of the `compile_error!` macro.
2023-12-10 09:34:13 -08:00
(accepted, compile_error, "1.20.0", Some(40872)),
/// Allows `impl Trait` in function return types.
2023-12-10 09:34:13 -08:00
(accepted, conservative_impl_trait, "1.26.0", Some(34511)),
/// Allows calling constructor functions in `const fn`.
2023-12-10 09:34:13 -08:00
(accepted, const_constructor, "1.40.0", Some(61456)),
/// Allows using and casting function pointers in a `const fn`.
2023-12-10 09:34:13 -08:00
(accepted, const_fn_fn_ptr_basics, "1.61.0", Some(57563)),
/// Allows trait bounds in `const fn`.
2023-12-10 09:34:13 -08:00
(accepted, const_fn_trait_bound, "1.61.0", Some(93706)),
/// Allows calling `transmute` in const fn
2023-12-10 09:34:13 -08:00
(accepted, const_fn_transmute, "1.56.0", Some(53605)),
/// Allows accessing fields of unions inside `const` functions.
2023-12-10 09:34:13 -08:00
(accepted, const_fn_union, "1.56.0", Some(51909)),
/// Allows unsizing coercions in `const fn`.
2023-12-10 09:34:13 -08:00
(accepted, const_fn_unsize, "1.54.0", Some(64992)),
2021-12-11 00:12:57 +00:00
/// Allows const generics to have default values (e.g. `struct Foo<const N: usize = 3>(...);`).
2023-12-10 09:34:13 -08:00
(accepted, const_generics_defaults, "1.59.0", Some(44580)),
/// Allows the use of `if` and `match` in constants.
2023-12-10 09:34:13 -08:00
(accepted, const_if_match, "1.46.0", Some(49146)),
2022-02-11 18:04:44 -08:00
/// Allows argument and return position `impl Trait` in a `const fn`.
2023-12-10 09:34:13 -08:00
(accepted, const_impl_trait, "1.61.0", Some(77463)),
/// Allows indexing into constant arrays.
2023-12-10 09:34:13 -08:00
(accepted, const_indexing, "1.26.0", Some(29947)),
/// Allows let bindings, assignments and destructuring in `const` functions and constants.
/// As long as control flow is not implemented in const eval, `&&` and `||` may not be used
/// at the same time as let bindings.
2023-12-10 09:34:13 -08:00
(accepted, const_let, "1.33.0", Some(48821)),
/// Allows the use of `loop` and `while` in constants.
2023-12-10 09:34:13 -08:00
(accepted, const_loop, "1.46.0", Some(52000)),
/// Allows panicking during const eval (producing compile-time errors).
2023-12-10 09:34:13 -08:00
(accepted, const_panic, "1.57.0", Some(51999)),
/// Allows dereferencing raw pointers during const eval.
2023-12-10 09:34:13 -08:00
(accepted, const_raw_ptr_deref, "1.58.0", Some(51911)),
/// Allows implementing `Copy` for closures where possible (RFC 2132).
2023-12-10 09:34:13 -08:00
(accepted, copy_closures, "1.26.0", Some(44490)),
/// Allows `crate` in paths.
2023-12-10 09:34:13 -08:00
(accepted, crate_in_paths, "1.30.0", Some(45477)),
/// Allows users to provide classes for fenced code block using `class:classname`.
2024-06-10 14:50:54 +02:00
(accepted, custom_code_classes_in_docs, "1.80.0", Some(79483)),
/// Allows using `#[debugger_visualizer]` attribute.
2023-12-10 09:34:13 -08:00
(accepted, debugger_visualizer, "1.71.0", Some(95939)),
/// Allows rustc to inject a default alloc_error_handler
2023-12-10 09:34:13 -08:00
(accepted, default_alloc_error_handler, "1.68.0", Some(66741)),
/// Allows using assigning a default type to type parameters in algebraic data type definitions.
2023-12-10 09:34:13 -08:00
(accepted, default_type_params, "1.0.0", None),
/// Allows `#[deprecated]` attribute.
2023-12-10 09:34:13 -08:00
(accepted, deprecated, "1.9.0", Some(29935)),
2022-02-28 15:33:50 -05:00
/// Allows `#[derive(Default)]` and `#[default]` on enums.
2023-12-10 09:34:13 -08:00
(accepted, derive_default_enum, "1.62.0", Some(86985)),
2021-11-03 02:50:57 -04:00
/// Allows the use of destructuring assignments.
2023-12-10 09:34:13 -08:00
(accepted, destructuring_assignment, "1.59.0", Some(71126)),
Stabilize the `#[diagnostic]` namespace and `#[diagnostic::on_unimplemented]` attribute This PR stabilizes the `#[diagnostic]` attribute namespace and a minimal option of the `#[diagnostic::on_unimplemented]` attribute. The `#[diagnostic]` attribute namespace is meant to provide a home for attributes that allow users to influence error messages emitted by the compiler. The compiler is not guaranteed to use any of this hints, however it should accept any (non-)existing attribute in this namespace and potentially emit lint-warnings for unused attributes and options. This is meant to allow discarding certain attributes/options in the future to allow fundamental changes to the compiler without the need to keep then non-meaningful options working. The `#[diagnostic::on_unimplemented]` attribute is allowed to appear on a trait definition. This allows crate authors to hint the compiler to emit a specific error message if a certain trait is not implemented. For the `#[diagnostic::on_unimplemented]` attribute the following options are implemented: * `message` which provides the text for the top level error message * `label` which provides the text for the label shown inline in the broken code in the error message * `note` which provides additional notes. The `note` option can appear several times, which results in several note messages being emitted. If any of the other options appears several times the first occurrence of the relevant option specifies the actually used value. Any other occurrence generates an lint warning. For any other non-existing option a lint-warning is generated. All three options accept a text as argument. This text is allowed to contain format parameters referring to generic argument or `Self` by name via the `{Self}` or `{NameOfGenericArgument}` syntax. For any non-existing argument a lint warning is generated. Tracking issue: #111996
2024-01-12 14:22:06 +01:00
/// Allows using the `#[diagnostic]` attribute tool namespace
(accepted, diagnostic_namespace, "1.78.0", Some(111996)),
/// Allows `#[doc(alias = "...")]`.
2023-12-10 09:34:13 -08:00
(accepted, doc_alias, "1.48.0", Some(50146)),
/// Allows `..` in tuple (struct) patterns.
2023-12-10 09:34:13 -08:00
(accepted, dotdot_in_tuple_patterns, "1.14.0", Some(33627)),
/// Allows `..=` in patterns (RFC 1192).
2023-12-10 09:34:13 -08:00
(accepted, dotdoteq_in_patterns, "1.26.0", Some(28237)),
/// Allows `Drop` types in constants (RFC 1440).
2023-12-10 09:34:13 -08:00
(accepted, drop_types_in_const, "1.22.0", Some(33156)),
/// Allows using `dyn Trait` as a syntax for trait objects.
2023-12-10 09:34:13 -08:00
(accepted, dyn_trait, "1.27.0", Some(44662)),
2024-04-27 20:35:32 -04:00
/// Allows `X..Y` patterns.
2024-06-10 14:50:54 +02:00
(accepted, exclusive_range_pattern, "1.80.0", Some(37854)),
/// Allows integer match exhaustiveness checking (RFC 2591).
2023-12-10 09:34:13 -08:00
(accepted, exhaustive_integer_patterns, "1.33.0", Some(50907)),
/// Allows explicit generic arguments specification with `impl Trait` present.
2023-12-10 09:34:13 -08:00
(accepted, explicit_generic_args_with_impl_trait, "1.63.0", Some(83701)),
/// Allows arbitrary expressions in key-value attributes at parse time.
2023-12-10 09:34:13 -08:00
(accepted, extended_key_value_attributes, "1.54.0", Some(78835)),
/// Allows resolving absolute paths as paths from other crates.
2023-12-10 09:34:13 -08:00
(accepted, extern_absolute_paths, "1.30.0", Some(44660)),
/// Allows `extern crate foo as bar;`. This puts `bar` into extern prelude.
2023-12-10 09:34:13 -08:00
(accepted, extern_crate_item_prelude, "1.31.0", Some(55599)),
/// Allows `extern crate self as foo;`.
/// This puts local crate root into extern prelude under name `foo`.
2023-12-10 09:34:13 -08:00
(accepted, extern_crate_self, "1.34.0", Some(56409)),
/// Allows access to crate names passed via `--extern` through prelude.
2023-12-10 09:34:13 -08:00
(accepted, extern_prelude, "1.30.0", Some(44660)),
2022-12-30 23:56:18 -05:00
/// Allows using F16C intrinsics from `core::arch::{x86, x86_64}`.
2023-12-10 09:34:13 -08:00
(accepted, f16c_target_feature, "1.68.0", Some(44839)),
/// Allows field shorthands (`x` meaning `x: x`) in struct literal expressions.
2023-12-10 09:34:13 -08:00
(accepted, field_init_shorthand, "1.17.0", Some(37340)),
/// Allows `#[must_use]` on functions, and introduces must-use operators (RFC 1940).
2023-12-10 09:34:13 -08:00
(accepted, fn_must_use, "1.27.0", Some(43302)),
/// Allows capturing variables in scope using format_args!
2023-12-10 09:34:13 -08:00
(accepted, format_args_capture, "1.58.0", Some(67984)),
2022-05-04 10:22:19 -04:00
/// Allows associated types to be generic, e.g., `type Foo<T>;` (RFC 1598).
2023-12-10 09:34:13 -08:00
(accepted, generic_associated_types, "1.65.0", Some(44265)),
/// Allows attributes on lifetime/type formal parameters in generics (RFC 1327).
2023-12-10 09:34:13 -08:00
(accepted, generic_param_attrs, "1.27.0", Some(48848)),
/// Allows the `#[global_allocator]` attribute.
2023-12-10 09:34:13 -08:00
(accepted, global_allocator, "1.28.0", Some(27389)),
// FIXME: explain `globs`.
2023-12-10 09:34:13 -08:00
(accepted, globs, "1.0.0", None),
2022-09-24 17:22:04 +02:00
/// Allows using `..=X` as a pattern.
2023-12-10 09:34:13 -08:00
(accepted, half_open_range_patterns, "1.66.0", Some(67264)),
/// Allows using the `u128` and `i128` types.
2023-12-10 09:34:13 -08:00
(accepted, i128_type, "1.26.0", Some(35118)),
/// Allows the use of `if let` expressions.
2023-12-10 09:34:13 -08:00
(accepted, if_let, "1.0.0", None),
/// Allows top level or-patterns (`p | q`) in `if let` and `while let`.
2023-12-10 09:34:13 -08:00
(accepted, if_while_or_patterns, "1.33.0", Some(48215)),
/// Allows lifetime elision in `impl` headers. For example:
/// + `impl<I:Iterator> Iterator for &mut Iterator`
/// + `impl Debug for Foo<'_>`
2023-12-10 09:34:13 -08:00
(accepted, impl_header_lifetime_elision, "1.31.0", Some(15872)),
2023-09-08 03:00:59 +00:00
/// Allows referencing `Self` and projections in impl-trait.
2023-12-10 09:34:13 -08:00
(accepted, impl_trait_projections, "1.74.0", Some(103532)),
2024-01-30 18:41:43 +00:00
/// Allows using imported `main` function
2024-04-28 09:28:27 -04:00
(accepted, imported_main, "1.79.0", Some(28937)),
/// Allows using `a..=b` and `..=b` as inclusive range syntaxes.
2023-12-10 09:34:13 -08:00
(accepted, inclusive_range_syntax, "1.26.0", Some(28237)),
/// Allows inferring outlives requirements (RFC 2093).
2023-12-10 09:34:13 -08:00
(accepted, infer_outlives_requirements, "1.30.0", Some(44493)),
2024-04-19 16:17:02 +01:00
/// Allow anonymous constants from an inline `const` block
2024-04-28 09:28:27 -04:00
(accepted, inline_const, "1.79.0", Some(76001)),
/// Allows irrefutable patterns in `if let` and `while let` statements (RFC 2086).
2023-12-10 09:34:13 -08:00
(accepted, irrefutable_let_patterns, "1.33.0", Some(44495)),
/// Allows `#[instruction_set(_)]` attribute.
2023-12-10 09:34:13 -08:00
(accepted, isa_attribute, "1.67.0", Some(74727)),
/// Allows some increased flexibility in the name resolution rules,
/// especially around globs and shadowing (RFC 1560).
2023-12-10 09:34:13 -08:00
(accepted, item_like_imports, "1.15.0", Some(35120)),
Stabilize `#![feature(label_break_value)]` # Stabilization proposal The feature was implemented in https://github.com/rust-lang/rust/pull/50045 by est31 and has been in nightly since 2018-05-16 (over 4 years now). There are [no open issues][issue-label] other than the tracking issue. There is a strong consensus that `break` is the right keyword and we should not use `return`. There have been several concerns raised about this feature on the tracking issue (other than the one about tests, which has been fixed, and an interaction with try blocks, which has been fixed). 1. nrc's original comment about cost-benefit analysis: https://github.com/rust-lang/rust/issues/48594#issuecomment-422235234 2. joshtriplett's comments about seeing use cases: https://github.com/rust-lang/rust/issues/48594#issuecomment-422281176 3. withoutboats's comments that Rust does not need more control flow constructs: https://github.com/rust-lang/rust/issues/48594#issuecomment-450050630 Many different examples of code that's simpler using this feature have been provided: - A lexer by rpjohnst which must repeat code without label-break-value: https://github.com/rust-lang/rust/issues/48594#issuecomment-422502014 - A snippet by SergioBenitez which avoids using a new function and adding several new return points to a function: https://github.com/rust-lang/rust/issues/48594#issuecomment-427628251. This particular case would also work if `try` blocks were stabilized (at the cost of making the code harder to optimize). - Several examples by JohnBSmith: https://github.com/rust-lang/rust/issues/48594#issuecomment-434651395 - Several examples by Centril: https://github.com/rust-lang/rust/issues/48594#issuecomment-440154733 - An example by petrochenkov where this is used in the compiler itself to avoid duplicating error checking code: https://github.com/rust-lang/rust/issues/48594#issuecomment-443557569 - Amanieu recently provided another example related to complex conditions, where try blocks would not have helped: https://github.com/rust-lang/rust/issues/48594#issuecomment-1184213006 Additionally, petrochenkov notes that this is strictly more powerful than labelled loops due to macros which accidentally exit a loop instead of being consumed by the macro matchers: https://github.com/rust-lang/rust/issues/48594#issuecomment-450246249 nrc later resolved their concern, mostly because of the aforementioned macro problems. joshtriplett suggested that macros could be able to generate IR directly (https://github.com/rust-lang/rust/issues/48594#issuecomment-451685983) but there are no open RFCs, and the design space seems rather speculative. joshtriplett later resolved his concerns, due to a symmetry between this feature and existing labelled break: https://github.com/rust-lang/rust/issues/48594#issuecomment-632960804 withoutboats has regrettably left the language team. joshtriplett later posted that the lang team would consider starting an FCP given a stabilization report: https://github.com/rust-lang/rust/issues/48594#issuecomment-1111269353 [issue-label]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AF-label_break_value+ ## Report + Feature gate: - https://github.com/rust-lang/rust/blob/d695a497bbf4b20d2580b75075faa80230d41667/src/test/ui/feature-gates/feature-gate-label_break_value.rs + Diagnostics: - https://github.com/rust-lang/rust/blob/6b2d3d5f3cd1e553d87b5496632132565b6779d3/compiler/rustc_parse/src/parser/diagnostics.rs#L2629 - https://github.com/rust-lang/rust/blob/f65bf0b2bb1a99f73095c01a118f3c37d3ee614c/compiler/rustc_resolve/src/diagnostics.rs#L749 - https://github.com/rust-lang/rust/blob/f65bf0b2bb1a99f73095c01a118f3c37d3ee614c/compiler/rustc_resolve/src/diagnostics.rs#L1001 - https://github.com/rust-lang/rust/blob/111df9e6eda1d752233482c1309d00d20a4bbf98/compiler/rustc_passes/src/loops.rs#L254 - https://github.com/rust-lang/rust/blob/d695a497bbf4b20d2580b75075faa80230d41667/compiler/rustc_parse/src/parser/expr.rs#L2079 - https://github.com/rust-lang/rust/blob/d695a497bbf4b20d2580b75075faa80230d41667/compiler/rustc_parse/src/parser/expr.rs#L1569 + Tests: - https://github.com/rust-lang/rust/blob/master/src/test/ui/label/label_break_value_continue.rs - https://github.com/rust-lang/rust/blob/master/src/test/ui/label/label_break_value_unlabeled_break.rs - https://github.com/rust-lang/rust/blob/master/src/test/ui/label/label_break_value_illegal_uses.rs - https://github.com/rust-lang/rust/blob/master/src/test/ui/lint/unused_labels.rs - https://github.com/rust-lang/rust/blob/master/src/test/ui/run-pass/for-loop-while/label_break_value.rs ## Interactions with other features Labels follow the hygiene of local variables. label-break-value is permitted within `try` blocks: ```rust let _: Result<(), ()> = try { 'foo: { Err(())?; break 'foo; } }; ``` label-break-value is disallowed within closures, generators, and async blocks: ```rust 'a: { || break 'a //~^ ERROR use of unreachable label `'a` //~| ERROR `break` inside of a closure } ``` label-break-value is disallowed on [_BlockExpression_]; it can only occur as a [_LoopExpression_]: ```rust fn labeled_match() { match false 'b: { //~ ERROR block label not supported here _ => {} } } macro_rules! m { ($b:block) => { 'lab: $b; //~ ERROR cannot use a `block` macro fragment here unsafe $b; //~ ERROR cannot use a `block` macro fragment here |x: u8| -> () $b; //~ ERROR cannot use a `block` macro fragment here } } fn foo() { m!({}); } ``` [_BlockExpression_]: https://doc.rust-lang.org/nightly/reference/expressions/block-expr.html [_LoopExpression_]: https://doc.rust-lang.org/nightly/reference/expressions/loop-expr.html
2022-07-14 08:30:38 -05:00
/// Allows `'a: { break 'a; }`.
2023-12-10 09:34:13 -08:00
(accepted, label_break_value, "1.65.0", Some(48594)),
2022-08-30 14:46:35 +02:00
/// Allows `let...else` statements.
2023-12-10 09:34:13 -08:00
(accepted, let_else, "1.65.0", Some(87335)),
/// Allows `break {expr}` with a value inside `loop`s.
2023-12-10 09:34:13 -08:00
(accepted, loop_break_value, "1.19.0", Some(37339)),
/// Allows use of `?` as the Kleene "at most one" operator in macros.
2023-12-10 09:34:13 -08:00
(accepted, macro_at_most_once_rep, "1.32.0", Some(48075)),
/// Allows macro attributes to observe output of `#[derive]`.
2023-12-10 09:34:13 -08:00
(accepted, macro_attributes_in_derive_output, "1.57.0", Some(81119)),
/// Allows use of the `:lifetime` macro fragment specifier.
2023-12-10 09:34:13 -08:00
(accepted, macro_lifetime_matcher, "1.27.0", Some(34303)),
/// Allows use of the `:literal` macro fragment specifier (RFC 1576).
2023-12-10 09:34:13 -08:00
(accepted, macro_literal_matcher, "1.32.0", Some(35625)),
/// Allows `macro_rules!` items.
2023-12-10 09:34:13 -08:00
(accepted, macro_rules, "1.0.0", None),
/// Allows use of the `:vis` macro fragment specifier
2023-12-10 09:34:13 -08:00
(accepted, macro_vis_matcher, "1.30.0", Some(41022)),
/// Allows macro invocations in `extern {}` blocks.
2023-12-10 09:34:13 -08:00
(accepted, macros_in_extern, "1.40.0", Some(49476)),
/// Allows '|' at beginning of match arms (RFC 1925).
2023-12-10 09:34:13 -08:00
(accepted, match_beginning_vert, "1.25.0", Some(44101)),
/// Allows default match binding modes (RFC 2005).
2023-12-10 09:34:13 -08:00
(accepted, match_default_bindings, "1.26.0", Some(42640)),
/// Allows `impl Trait` with multiple unrelated lifetimes.
2023-12-10 09:34:13 -08:00
(accepted, member_constraints, "1.54.0", Some(61997)),
/// Allows the definition of `const fn` functions.
2023-12-10 09:34:13 -08:00
(accepted, min_const_fn, "1.31.0", Some(53555)),
/// The smallest useful subset of const generics.
2023-12-10 09:34:13 -08:00
(accepted, min_const_generics, "1.51.0", Some(74878)),
/// Allows calling `const unsafe fn` inside `unsafe` blocks in `const fn` functions.
2023-12-10 09:34:13 -08:00
(accepted, min_const_unsafe_fn, "1.33.0", Some(55607)),
/// Allows using `Self` and associated types in struct expressions and patterns.
2023-12-10 09:34:13 -08:00
(accepted, more_struct_aliases, "1.16.0", Some(37544)),
2023-02-05 19:27:35 -05:00
/// Allows using the MOVBE target feature.
2023-12-10 09:34:13 -08:00
(accepted, movbe_target_feature, "1.70.0", Some(44839)),
/// 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.
2023-12-10 09:34:13 -08:00
(accepted, move_ref_pattern, "1.49.0", Some(68354)),
/// Allows specifying modifiers in the link attribute: `#[link(modifiers = "...")]`
2023-12-10 09:34:13 -08:00
(accepted, native_link_modifiers, "1.61.0", Some(81490)),
/// Allows specifying the bundle link modifier
2023-12-10 09:34:13 -08:00
(accepted, native_link_modifiers_bundle, "1.63.0", Some(81490)),
/// Allows specifying the verbatim link modifier
2023-12-10 09:34:13 -08:00
(accepted, native_link_modifiers_verbatim, "1.67.0", Some(81490)),
/// Allows specifying the whole-archive link modifier
2023-12-10 09:34:13 -08:00
(accepted, native_link_modifiers_whole_archive, "1.61.0", Some(81490)),
2022-04-01 13:13:25 -04:00
/// Allows using non lexical lifetimes (RFC 2094).
2023-12-10 09:34:13 -08:00
(accepted, nll, "1.63.0", Some(43234)),
/// Allows using `#![no_std]`.
2023-12-10 09:34:13 -08:00
(accepted, no_std, "1.6.0", None),
/// Allows defining identifiers beyond ASCII.
2023-12-10 09:34:13 -08:00
(accepted, non_ascii_idents, "1.53.0", Some(55467)),
/// Allows future-proofing enums/structs with the `#[non_exhaustive]` attribute (RFC 2008).
2023-12-10 09:34:13 -08:00
(accepted, non_exhaustive, "1.40.0", Some(44109)),
/// Allows `foo.rs` as an alternative to `foo/mod.rs`.
2023-12-10 09:34:13 -08:00
(accepted, non_modrs_mods, "1.30.0", Some(44660)),
/// Allows the use of or-patterns (e.g., `0 | 1`).
2023-12-10 09:34:13 -08:00
(accepted, or_patterns, "1.53.0", Some(54883)),
/// Allows using `+bundle,+whole-archive` link modifiers with native libs.
2023-12-10 09:34:13 -08:00
(accepted, packed_bundled_libs, "1.74.0", Some(108081)),
/// Allows annotating functions conforming to `fn(&PanicInfo) -> !` with `#[panic_handler]`.
/// This defines the behavior of panics.
2023-12-10 09:34:13 -08:00
(accepted, panic_handler, "1.30.0", Some(44489)),
/// Allows attributes in formal function parameters.
2023-12-10 09:34:13 -08:00
(accepted, param_attrs, "1.39.0", Some(60406)),
/// Allows parentheses in patterns.
2023-12-10 09:34:13 -08:00
(accepted, pattern_parentheses, "1.31.0", Some(51087)),
/// Allows procedural macros in `proc-macro` crates.
2023-12-10 09:34:13 -08:00
(accepted, proc_macro, "1.29.0", Some(38356)),
/// Allows multi-segment paths in attributes and derives.
2023-12-10 09:34:13 -08:00
(accepted, proc_macro_path_invoc, "1.30.0", Some(38356)),
/// Allows `pub(restricted)` visibilities (RFC 1422).
2023-12-10 09:34:13 -08:00
(accepted, pub_restricted, "1.18.0", Some(32409)),
/// Allows use of the postfix `?` operator in expressions.
2023-12-10 09:34:13 -08:00
(accepted, question_mark, "1.13.0", Some(31436)),
/// Allows the use of raw-dylibs (RFC 2627).
2023-12-10 09:34:13 -08:00
(accepted, raw_dylib, "1.71.0", Some(58713)),
/// Allows keywords to be escaped for use as identifiers.
2023-12-10 09:34:13 -08:00
(accepted, raw_identifiers, "1.30.0", Some(48589)),
/// Allows relaxing the coherence rules such that
/// `impl<T> ForeignTrait<LocalType> for ForeignType<T>` is permitted.
2023-12-10 09:34:13 -08:00
(accepted, re_rebalance_coherence, "1.41.0", Some(55437)),
/// Allows numeric fields in struct expressions and patterns.
2023-12-10 09:34:13 -08:00
(accepted, relaxed_adts, "1.19.0", Some(35626)),
/// Lessens the requirements for structs to implement `Unsize`.
2023-12-10 09:34:13 -08:00
(accepted, relaxed_struct_unsize, "1.58.0", Some(81793)),
/// Allows `repr(align(16))` struct attribute (RFC 1358).
2023-12-10 09:34:13 -08:00
(accepted, repr_align, "1.25.0", Some(33626)),
/// Allows using `#[repr(align(X))]` on enums with equivalent semantics
/// to wrapping an enum in a wrapper struct with `#[repr(align(X))]`.
2023-12-10 09:34:13 -08:00
(accepted, repr_align_enum, "1.37.0", Some(57996)),
/// Allows `#[repr(packed(N))]` attribute on structs.
2023-12-10 09:34:13 -08:00
(accepted, repr_packed, "1.33.0", Some(33158)),
/// Allows `#[repr(transparent)]` attribute on newtype structs.
2023-12-10 09:34:13 -08:00
(accepted, repr_transparent, "1.28.0", Some(43036)),
2023-09-13 16:04:42 +00:00
/// Allows return-position `impl Trait` in traits.
2023-12-10 09:34:13 -08:00
(accepted, return_position_impl_trait_in_trait, "1.75.0", Some(91611)),
/// Allows code like `let x: &'static u32 = &42` to work (RFC 1414).
2023-12-10 09:34:13 -08:00
(accepted, rvalue_static_promotion, "1.21.0", Some(38865)),
/// Allows `Self` in type definitions (RFC 2300).
2023-12-10 09:34:13 -08:00
(accepted, self_in_typedefs, "1.32.0", Some(49303)),
/// Allows `Self` struct constructor (RFC 2302).
2023-12-10 09:34:13 -08:00
(accepted, self_struct_ctor, "1.32.0", Some(51994)),
2019-12-30 00:16:16 +01:00
/// Allows using subslice patterns, `[a, .., b]` and `[a, xs @ .., b]`.
2023-12-10 09:34:13 -08:00
(accepted, slice_patterns, "1.42.0", Some(62254)),
/// Allows use of `&foo[a..b]` as a slicing syntax.
2023-12-10 09:34:13 -08:00
(accepted, slicing_syntax, "1.0.0", None),
/// Allows elision of `'static` lifetimes in `static`s and `const`s.
2023-12-10 09:34:13 -08:00
(accepted, static_in_const, "1.17.0", Some(35897)),
/// Allows the definition recursive static items.
2023-12-10 09:34:13 -08:00
(accepted, static_recursion, "1.17.0", Some(29719)),
/// Allows attributes on struct literal fields.
2023-12-10 09:34:13 -08:00
(accepted, struct_field_attributes, "1.20.0", Some(38814)),
/// Allows struct variants `Foo { baz: u8, .. }` in enums (RFC 418).
2023-12-10 09:34:13 -08:00
(accepted, struct_variant, "1.0.0", None),
/// Allows `#[target_feature(...)]`.
2023-12-10 09:34:13 -08:00
(accepted, target_feature, "1.27.0", None),
/// Allows `fn main()` with return types which implements `Termination` (RFC 1937).
2023-12-10 09:34:13 -08:00
(accepted, termination_trait, "1.26.0", Some(43301)),
/// Allows `#[test]` functions where the return type implements `Termination` (RFC 1937).
2023-12-10 09:34:13 -08:00
(accepted, termination_trait_test, "1.27.0", Some(48854)),
/// Allows attributes scoped to tools.
2023-12-10 09:34:13 -08:00
(accepted, tool_attributes, "1.30.0", Some(44690)),
/// Allows scoped lints.
2023-12-10 09:34:13 -08:00
(accepted, tool_lints, "1.31.0", Some(44690)),
/// Allows `#[track_caller]` to be used which provides
/// accurate caller location reporting during panic (RFC 2091).
2023-12-10 09:34:13 -08:00
(accepted, track_caller, "1.46.0", Some(47809)),
/// Allows #[repr(transparent)] on univariant enums (RFC 2645).
2023-12-10 09:34:13 -08:00
(accepted, transparent_enums, "1.42.0", Some(60405)),
/// Allows indexing tuples.
2023-12-10 09:34:13 -08:00
(accepted, tuple_indexing, "1.0.0", None),
/// Allows paths to enum variants on type aliases including `Self`.
2023-12-10 09:34:13 -08:00
(accepted, type_alias_enum_variants, "1.37.0", Some(49683)),
/// Allows macros to appear in the type position.
2023-12-10 09:34:13 -08:00
(accepted, type_macros, "1.13.0", Some(27245)),
/// Allows using type privacy lints (`private_interfaces`, `private_bounds`, `unnameable_types`).
2024-04-28 09:28:27 -04:00
(accepted, type_privacy_lints, "1.79.0", Some(48054)),
/// Allows `const _: TYPE = VALUE`.
2023-12-10 09:34:13 -08:00
(accepted, underscore_const_names, "1.37.0", Some(54912)),
/// Allows `use path as _;` and `extern crate c as _;`.
2023-12-10 09:34:13 -08:00
(accepted, underscore_imports, "1.33.0", Some(48216)),
/// Allows `'_` placeholder lifetimes.
2023-12-10 09:34:13 -08:00
(accepted, underscore_lifetimes, "1.26.0", Some(44524)),
/// Allows `use x::y;` to search `x` in the current scope.
2023-12-10 09:34:13 -08:00
(accepted, uniform_paths, "1.32.0", Some(53130)),
/// Allows `impl Trait` in function arguments.
2023-12-10 09:34:13 -08:00
(accepted, universal_impl_trait, "1.26.0", Some(34511)),
/// Allows arbitrary delimited token streams in non-macro attributes.
2023-12-10 09:34:13 -08:00
(accepted, unrestricted_attribute_tokens, "1.34.0", Some(55208)),
/// The `unsafe_op_in_unsafe_fn` lint (allowed by default): no longer treat an unsafe function as an unsafe block.
2023-12-10 09:34:13 -08:00
(accepted, unsafe_block_in_unsafe_fn, "1.52.0", Some(71668)),
/// Allows importing and reexporting macros with `use`,
/// enables macro modularization in general.
2023-12-10 09:34:13 -08:00
(accepted, use_extern_macros, "1.30.0", Some(35896)),
/// Allows nested groups in `use` items (RFC 2128).
2023-12-10 09:34:13 -08:00
(accepted, use_nested_groups, "1.25.0", Some(44494)),
/// Allows `#[used]` to preserve symbols (see llvm.compiler.used).
2023-12-10 09:34:13 -08:00
(accepted, used, "1.30.0", Some(40289)),
/// Allows the use of `while let` expressions.
2023-12-10 09:34:13 -08:00
(accepted, while_let, "1.0.0", None),
/// Allows `#![windows_subsystem]`.
2023-12-10 09:34:13 -08:00
(accepted, windows_subsystem, "1.18.0", Some(37499)),
// !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!!
// Features are listed in alphabetical order. Tidy will fail if you don't keep it this way.
// !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!!
// -------------------------------------------------------------------------
// feature-group-end: accepted features
// -------------------------------------------------------------------------
);