.. default-domain:: spec
.. informational-page::
This page describes the changes that have been applied to the FLS itself to address changes and new features introduced in each Rust release. Every item listed in the "Language" section of the release note is reproduced here, along with the change that has been applied due to it.
Caution!
This page is not an exhaustive list of all of the changes in a release, just the language changes that had an impact to the FLS. See the release notes for a full list of changes.
- Stabilize if let guards on match arms
- irrefutable_let_patterns lint no longer lints on let chains
- Lints are outside the scope of the FLS.
- Support importing path-segment keywords with renaming
- Stabilize ppc inline assembly
- The target is outside the scope of the FLS.
- const-eval: be more consistent in the behavior of padding during typed copies
- Const blocks are no longer evaluated to determine if expressions involving fallible operations can implicitly be constant-promoted
- Make operational semantics of pattern matching independent of crate and module
- Impls and impl items inherit dead_code lint level of the corresponding traits and trait items
- Lints are outside the scope of the FLS.
- Stabilize additional 29 RISC-V target features including large portions of the RVA22U64 / RVA23U64 profiles
- The target is outside the scope of the FLS.
- Add warn-by-default unused_visibilities lint for visibility on const _ declarations
- Lints are outside the scope of the FLS.
- Update to Unicode 17
- Changed paragraph: :p:`fls_jpecw46eh061`
- Avoid incorrect lifetime errors for closures
- The mechanics of the borrow checker are outside the scope of the FLS.
- Don’t try to recover keyword as non-keyword identifier
- Bug fix in the compiler without visible ramifications.
- Fix clippy::panicking_unwrap false-positive on field access with implicit deref
- Lints are outside the scope of the FLS.
- Revert “Update wasm-related dependencies in CI”
- The target is outside the scope of the FLS.
- Stabilize several s390x vector-related target features and the is_s390x_feature_detected! macro
- The target is outside the scope of the FLS.
- Stabilize declaration of C-style variadic functions for the system ABI
- Changed paragraph: :p:`fls_8m7pc3riokst`
- New paragraphs:
- Emit error when using some keyword as a cfg predicate
- This bug was not documented in the FLS.
- Stabilize asm_cfg
- Changed syntax:
- New syntax:
- New glossary entry: inline assembly argument
- New paragraphs:
- During const-evaluation, support copying pointers byte-by-byte
- Already covered by the classification of [constant expression]s.
- LUB coercions now correctly handle function item types, and functions with differing safeties
- Allow const items that contain mutable references to static (which is *very* unsafe, but not *always* UB)
- Add warn-by-default const_item_interior_mutations lint to warn against calls which mutate interior mutable const items
- Lints are outside the scope of the FLS.
- Add warn-by-default function_casts_as_integer lint
- Lints are outside the scope of the FLS.
- Deduplicate historically reused paragraph IDs in the glossary.
- Corrected glossary discriminant type paragraph ID:
- old reused ID:
fls_t4yeovFm83Wo- new unique ID:fls_kqdvWGi9cglm - Corrected glossary local trait paragraph ID:
- old reused ID:
fls_I9JaKZelMiby- new unique ID:fls_H5vkbMFvzrFs
- Corrected glossary discriminant type paragraph ID:
- old reused ID:
- Document MaybeUninit representation and validity
- This is not a language change.
- Allow "&raw [mut | const]" for union field in safe code
- This lifted restriction was not documented in the FLS.
- Prefer item bounds of associated types over where-bounds for auto-traits and Sized
- This entry is a fix for a regression which existed only in the development versions of the Rust toolchain. These toolchains are outside the scope of the FLS.
- Do not materialize X in "[X; 0]" when X is unsizing a const
- This behavior was not documented in the FLS.
- Support combining #[track_caller] and #[no_mangle] (requires every declaration specifying #[track_caller] as well)
- This lifted restriction was not documented in the FLS.
- Make never type lints never_type_fallback_flowing_into_unsafe and dependency_on_unit_never_type_fallback deny-by-default
- Lints are outside the scope of the FLS.
- Allow specifying multiple bounds for same associated item, except in trait objects
- This lifted restriction was not documented in the FLS.
- Slightly strengthen higher-ranked region handling in coherence
- The lifted restriction was not documented in the FLS.
- The unused_must_use lint no longer warns on "Result<(), Uninhabited>" (for instance, "Result<(), !>"), or "ControlFlow<Uninhabited, ()>". This avoids having to check for an error that can never happen.
- Lints are outside the scope of the FLS.
This release has no language changes.
- Lower pattern bindings in the order they're written and base drop order on primary bindings' order
- Changed paragraphs:
- :p:`fls_g07zq3n55094`
- :p:`fls_8luyomzppck`
- :p:`fls_kv533rntni1x`
- :p:`fls_62626ws222op`
- :p:`fls_q0z46h1gnzez`
- :p:`fls_1r0vm6rg13o9`
- :p:`fls_am5h8r887bz5`
- :p:`fls_eppmiloh7bgg`
- :p:`fls_gwc08xayno7q`
- :p:`fls_19iygu12s315`
- :p:`fls_r307spfk6cs9`
- :p:`fls_qhdofvbso3gl`
- :p:`fls_drb114dtvlpt`
- :p:`fls_uxysntb3u03j`
- :p:`fls_vstdqifqipbh`
- New paragraphs:
- Removed paragraph: :p:`fls_67ajub7d2b4c`
- Changed paragraphs:
- Stabilize declaration of C-style variadic functions for 'sysv64', 'win64', 'efiapi', and 'aapcs' ABIs.
This brings these ABIs in line with the C ABI: variadic functions can be declared in extern blocks but not defined.
- Changed paragraphs:
- New paragraphs:
- :p:`fls_OR85NVifPwjr`
- :p:`fls_4s2IdfYDzPrX`
- :p:`fls_ZJJppPfiJRou`
- :p:`fls_jOyZh9ujWWHQ`
- :p:`fls_Xdr0bFwxhWiB`
- :p:`fls_DpTFEHZAABdD`
- :p:`fls_eHPWHrvs7ETl`
- :p:`fls_mjCrvmikm58M`
- :p:`fls_4EUb9zFatZ97`
- :p:`fls_4B4B5FIqAes9`
- :p:`fls_b7FTlWfnX2OI`
- :p:`fls_o4uSLPo00KUg`
- :p:`fls_UippZpUyYpHl`
- :p:`fls_CIyK8BYzzo26`
- :p:`fls_ccFdnlX5HIYk`
- :p:`fls_xrCRprWS13R1`
- :p:`fls_JHlqXjn4Sf07`
- Add dangling_pointers_from_locals lint to warn against dangling pointers from local variables
- Lints are outside the scope of the FLS.
- Upgrade semicolon_in_expressions_from_macros from warn to deny
- Lints are outside the scope of the FLS.
- Stabilize LoongArch32 inline assembly
- The target is outside the scope of the FLS
- Add warn-by-default integer_to_ptr_transmutes lint against integer-to-pointer transmutes
- Lints are outside the scope of the FLS.
- Stabilize 'sse4a' and 'tbm' target features
- Changed syntax: :s:`Feature`
- New paragraphs:
- Add 'target_env = "macabi"' and 'target_env = "sim"' cfgs as replacements for the target_abi cfgs with the same values.
- Configuration options are environment-specific and not exhaustive.
- Split up the unknown_or_malformed_diagnostic_attributes lint
- Lints are outside the scope of the FLS.
- Allow constants whose final value has references to mutable/external memory, but reject such constants as patterns
- This lifted restriction was not documented in the FLS.
- The restriction on patterns is documented in :p:`fls_wJ9f906BlBvg`.
- New paragraph: :p:`fls_zyuxqty09SDO`
- Paragraph :p:`fls_zyuxqty09SDO` replaces :p:`fls_6g7c1kjrmfnr` and :p:`fls_hkbwa8xx2fwx`.
- New paragraphs:
- Allow volatile access to non-Rust memory, including address 0
- Lints are outside the scope of the FLS.
- Stabilize explicitly inferred const arguments (feature(generic_arg_infer))
- New paragraphs:
- Changed paragraph: :p:`fls_imr2jx6cbuzq`
- Add a warn-by-default mismatched_lifetime_syntaxes lint.
- Lints are outside the scope of the FLS.
- Expand unpredictable_function_pointer_comparisons to also lint on function pointer comparisons in external macros
- Lints are outside the scope of the FLS.
- Make the dangerous_implicit_autorefs lint deny-by-default
- Lints are outside the scope of the FLS.
- Stabilize the avx512 target features
- Changed syntax: :s:`Feature`
- New paragraphs:
- :p:`fls_8HPcvIaahaB9`
- :p:`fls_lxcfj6XCKyMh`
- :p:`fls_fh7i1Pcmqjdm`
- :p:`fls_M9ne2sqhRB5L`
- :p:`fls_xWcGvl83bVWC`
- :p:`fls_5CVTkOoLHAvW`
- :p:`fls_hThb8qn820wJ`
- :p:`fls_1T0VYMtG3loD`
- :p:`fls_AlBD9ckWKecQ`
- :p:`fls_72cwAExPDMQ8`
- :p:`fls_pSSIwmUAnUly`
- :p:`fls_YOW8lcBQ5lNI`
- :p:`fls_8PrvVL6dkr31`
- :p:`fls_hKvaSExdlKgd`
- :p:`fls_r5KEicrmEGJt`
- :p:`fls_Qnx9nNiJeIAX`
- :p:`fls_ZrcPWy4pxlTX`
- :p:`fls_YW7otDxAliSj`
- :p:`fls_G4aOoX8a7i7r`
- :p:`fls_HGKiXfM5fGVo`
- :p:`fls_gRf8F9PIGySt`
- :p:`fls_NNj4H6A9VTR8`
- Stabilize these target features for x86: kl, widekl
- Changed syntax: :s:`Feature`
- New paragraphs:
- Stabilize these target features for x86: sha512, sm3, sm4
- Changed syntax: :s:`Feature`
- New paragraphs:
- Stabilize these LoongArch target features: f, d, frecipe, lasx, lbt, lsx, lvz
- The target is outside the scope of the FLS.
- Remove i128 and u128 from improper_ctypes_definitions lint
- Lints are outside the scope of the FLS.
- Stabilize repr128 (#[repr(u128), #repr(i128)])
- The FLS already documented the semantics.
- Allow #![doc(test(attr(..))) everywhere
- Documentation tests are outside the scope of the FLS.
- Extend temporary lifetime extension to also go through tuple struct and tuple variant constructors
- Changed paragraphs:
- New paragraphs:
- extern "C" functions on the wasm32-unknown-unknown target now have a standards compliant ABI
- The target is outside the scope of the FLS.
- Stabilize let_chains feature in the 2024 edition
- The 2024 edition is outside the scope of the FLS.
- Stabilize naked_functions feature
- New sections: :ref:`fls_Sd6rUmpEb355`
- Changed paragraphs:
- New paragraphs:
- New syntax: :s:`SymPathExpression`
- Stabilize cfg_boolean_literals feature
- Changed syntax: :s:`ConfigurationPredicate`
- Fully de-stabilize the #[bench] attribute
- Unstable features are outside the scope of the FLS.
- Add warn-by-default dangerous_implicit_autorefs lint against implicit autoref of raw pointer dereference
- Lints are outside the scope of the FLS.
- Add invalid_null_arguments lint to prevent invalid usage of null pointers
- Lints are outside the scope of the FLS.
- Change trait impl candidate preference for builtin impls and trivial where-clauses.
- Trait impl candidate preferences of the compiler are outside the scope of the FLS.
- Check types of generic const parameter defaults
- This bug was not documented in the FLS.
- Stabilize asm_goto feature
- New section: :ref:`fls_MW7mtH5oOeQ1`
- Allow parsing open beginning ranges (..EXPR) after unary operators: ! - *
- This lifted restriction was not documented in the FLS.
- Don't require method impls for methods with "Self: Sized" bounds in impls for unsized types
- This lifted restriction was not documented in the FLS.
- Stabilize feature(precise_capturing_in_traits) allowing use<...> bounds on return position impl Trait in traits (RPITIT)
- This lifted restriction was not documented in the FLS.
- Stabilize upcasting trait objects to supertraits.
- New paragraph: :p:`fls_QB4c6FNKxaPl`
- Allow safe functions to be marked with the #[target_feature] attribute.
- Changed paragraph: :p:`fls_3qj3jvmtxvx6`
- The missing_abi lint now warns-by-default.
- Lints are outside the scope of the FLS.
- Rust now lints about double negations, to catch cases that might have intended to be a prefix decrement operator (--x) as written in other languages. This was previously a clippy lint, clippy::double_neg, and is now available directly in Rust as double_negations.
- Lints are outside the scope of the FLS.
- More pointers are now detected as definitely not-null based on their alignment in const eval.
- The concrete semantics of constant evaluation is not described in the FLS.
- Empty repr() attribute applied to invalid items are now correctly rejected.
- This bug was not documented in the FLS.
- Inner attributes, #![test] and #![rustfmt::skip], are no longer accepted in more places than intended.
- Tool-related attributes are outside the scope of the FLS.
- The incorrect semantics of
#![test]were not documented in the FLS.
- The 2024 Edition is now stable.
- The 2024 edition is outside the scope of the FLS.
- Stabilize async closures
- New paragraphs:
- Changed syntax: :s:`ClosureExpression`
- Stabilize `#[diagnostic::do_not_recommend]`
- Tool-related attributes are outside the scope of the FLS.
- Add `unpredictable_function_pointer_comparisons` lint to warn against function pointer comparisons
- Lints are outside the scope of the FLS.
- Lint on combining `#[no_mangle]` and `#[export_name]` attributes.
- Lints are outside the scope of the FLS.
- Allow `#[deny]` inside `#[forbid]` as a no-op
- Lints are outside the scope of the FLS.
- Show a warning when `-Ctarget-feature` is used to toggle features that can lead to unsoundness due to ABI mismatches
- Conforming tool usage is outside the scope of the FLS.
- Use the next-generation trait solver in coherence
- The trait solver is outside the scope of the FLS.
- Allow coercions to drop the principal of trait objects
- Changed paragraph: :p:`fls_SYnFJBhi0IWj`
- Support `/` as the path separator for `include!()` in all cases on Windows
- This restriction of the include macro was not documented in the FLS.
- Taking a raw ref (`raw (const|mut)`) of a deref of a pointer (`*ptr`) is now safe
- Changed paragraph: :p:`fls_8i4jzksxlrw0`
- Stabilize s390x inline assembly
- This target is outside the scope of the FLS.
- Stabilize Arm64EC inline assembly
- This target is outside the scope of the FLS.
- Lint against creating pointers to immediately dropped temporaries
- Lints are outside the scope of the FLS.
- Execute drop glue when unwinding in an `extern "C"` function
- This lifted restriction was not documented in the FLS.
- Stabilize `&mut`, `*mut`, `&Cell`, and `*const Cell` in const.
- Changed paragraphs:
- Removed paragraph: :p:`fls_ox6sgl9n43g2`
- Allow creating references to statics in `const` initializers.
- This lifted restriction was not documented in the FLS.
- Implement raw lifetimes and labels (`'r#ident`).
- Changed syntax: :s:`Lifetime`
- Define behavior when atomic and non-atomic reads race.
- Already covered by the definition of data race.
- Non-exhaustive structs may now be empty.
- Changed paragraphs:
- Removed paragraph: :p:`fls_2CWUWbYT9KcT`
- Disallow implicit coercions from places of type `!`
- The FLS does not specify type inference to such a degree.
- `const extern` functions can now be defined for other calling conventions.
- This lifted restriction was not documented in the FLS.
- Stabilize `expr_2021` macro fragment specifier in all editions.
- Changed syntax: :s:`MacroFragmentSpecifier`
- Changed paragraphs:
- The `non_local_definitions` lint now fires on less code and warns by default.
- Lints are outside the scope of the FLS.
- Don't make statement nonterminals match pattern nonterminals
- Parsing behavior of non-terminals within declarative macros is outside the scope of the FLS.
- Patterns matching empty types can now be omitted in common cases
- New section: :ref:`fls_mcxF9y5u66sZ`
- Changed paragraphs:
- Enforce supertrait outlives obligations when using trait impls
- The FLS does not specify type inference to such a degree.
- `addr_of(_mut)!` macros and the newly stabilized `&raw (const|mut)` are now safe to use with all static items
- Library-defined macros are outside the scope of the FLS.
- &raw (const|mut) appears as a new feature separately below.
- size_of_val_raw: for length 0 this is safe to call
- Library-defined functions are outside the scope of the FLS.
- Reorder trait bound modifiers *after* `for<...>` binder in trait bounds
- Changed syntax: :s:`TraitBound`
- Stabilize opaque type precise capturing (RFC 3617)
- Stabilize `&raw const` and `&raw mut` operators (RFC 2582)
- New section: :ref:`fls_vXGuvRWOLbEE`
- New paragraph: :p:`fls_K7SbApHPmwjM`
- Stabilize unsafe extern blocks (RFC 3484)
- New syntax: :s:`ItemSafety`
- Changed syntax:
- Changed paragraphs:
- New paragraphs:
- Removed paragraph :p:`fls_iaimuqcclstl`
- Stabilize nested field access in `offset_of!`
- Library-defined macros are outside the scope of the FLS.
- Do not require `T` to be live when dropping `[T; 0]`
- The mechanics of the borrow checker are outside the scope of the FLS.
- Stabilize `const` operands in inline assembly
- New syntax: :s:`ConstRegisterExpression`
- New paragraphs:
- Stabilize floating-point arithmetic in `const fn`
- New paragraph: :p:`fls_lSxXWxJn0vMO`
- Removed paragraph: :p:`fls_9mrrosm8jnn7`
- Stabilize explicit opt-in to unsafe attributes
- New section: :ref:`fls_19LnTi3WabFd`
- Document NaN bit patterns guarantees
- New paragraph: :p:`fls_nuFAwLHOdQBx`
- Abort on uncaught panics in `extern "C"` functions.
- The mechanics of unwinding are outside the scope of the FLS.
- Fix ambiguous cases of multiple `&` in elided self lifetimes.
- Changed paragraph: :p:`fls_crb6m6b3cdwh`
- New paragraph: :p:`fls_d4u3y82hdadc`
- Stabilize `#[expect]` for lints (RFC 2383), like `#[allow]` with a warning if the lint is _not_ fulfilled.
- New paragraph: :p:`fls_NrTL2FruARAv`
- Change method resolution to constrain hidden types instead of rejecting method candidates.
- The FLS does not specify type inference to such a degree.
- Bump `elided_lifetimes_in_associated_constant` to deny.
- Lints are outside the scope of the FLS.
- `offset_from`: always allow pointers to point to the same address.
- This lifted restriction was not documented in the FLS.
- Allow constraining opaque types during subtyping in the trait system.
- The FLS does not specify type inference to such a degree.
- Allow constraining opaque types during various unsizing casts.
- The FLS does not specify type inference to such a degree.
- Deny keyword lifetimes pre-expansion.
- No change: the FLS already specifies this restriction in :s:`Lifetime`
- Document maximum allocation size
- Allow zero-byte offsets and ZST read/writes on arbitrary pointers
- This lifted restriction was not documented in the FLS.
- Support C23's variadics without a named parameter
- This lifted restriction was not documented in the FLS.
- Stabilize `exclusive_range_pattern` feature
- Changed syntax: :s:`RangePattern`
- New syntax: :s:`ExclusiveRangePattern`
- Changed paragraph: :p:`fls_8Q6NfRx4j5V7`
- New paragraphs:
- Stabilize inline `const {}` expressions.
- New section: :ref:`fls_G59PiNQkVUnQ`
- Prevent opaque types being instantiated twice with different regions within the same function.
- Already described in :p:`fls_hza5n5eb18ta`.
- Stabilize WebAssembly target features that are in phase 4 and 5.
- This target is outside the scope of the FLS.
- Add the `redundant_lifetimes` lint to detect lifetimes which are semantically redundant.
- Lints are outside the scope of the FLS.
- Stabilize the `unnameable_types` lint for public types that can't be named.
- Lints are outside the scope of the FLS.
- Enable debuginfo in macros, and stabilize `-C collapse-macro-debuginfo` and `#[collapse_debuginfo]`.
- New section: :ref:`fls_qyudjGHZfyJH`
- Propagate temporary lifetime extension into `if` and `match` expressions.
- New paragraphs:
- Restrict promotion of `const fn` calls.
- Already described in :p:`fls_3h5vr7xk2rrt`.
- Warn against refining impls of crate-private traits with `refining_impl_trait` lint.
- Lints are outside the scope of the FLS.
- Stabilize associated type bounds (RFC 2289).
- New paragraph: :p:`fls_mcUMWsYcxzmZ`
- Stabilize importing `main` from other modules or crates.
- This lifted restriction was not documented in the FLS.
- While updating the FLS to account for this feature, we realized that the way the FLS described crate types was incorrect. We rectified this:
- New section: :ref:`fls_8JB3SJqamdpU`
- Changed glossary entries:
- binary crate
- library crate
- proc-macro crate
- New glossary entry: crate type
- Changed paragraphs:
- New paragraphs:
- Moved paragraph: :p:`fls_sbGnkm8Ephiu`
- Check return types of function types for well-formedness
- The mechanism of trait resolution is outside the scope of the FLS.
- Rework `impl Trait` lifetime inference
- New paragraphs:
- Change inductive trait solver cycles to be ambiguous
- The trait solver is outside the scope of the FLS.
- Stabilize `#[cfg(target_abi = ...)]`
- Configuration options are outside the scope of the FLS.
- Stabilize the `#[diagnostic]` namespace and `#[diagnostic::on_unimplemented]` attribute
- Tool-related attributes are outside the scope of the FLS.
- Make async-fn-in-trait implementable with concrete signatures
- The FLS already documented the semantics.
- Make matching on NaN a hard error, and remove the rest of `illegal_floating_point_literal_pattern`
- New paragraph: :p:`fls_JP8YSbxSN0Ym`
- static mut: allow mutable reference to arbitrary types, not just slices and arrays
- This lifted restriction was not documented in the FLS.
- Extend `invalid_reference_casting` to include references casting to bigger memory layout
- Lints are outside the scope of the FLS.
- Add `non_contiguous_range_endpoints` lint for singleton gaps after exclusive ranges
- Lints are outside the scope of the FLS.
- Add `wasm_c_abi` lint for use of older wasm-bindgen versions
- Lints are outside the scope of the FLS.
- Update `indirect_structural_match` and `pointer_structural_match` lints to match RFC
- Lints are outside the scope of the FLS.
- Make non-`PartialEq`-typed consts as patterns a hard error
- Already described in :p:`fls_zCswsyuitexI`.
- Split `refining_impl_trait` lint into `_reachable`, `_internal` variants
- Lints are outside the scope of the FLS.
- Remove unnecessary type inference when using associated types inside of higher ranked `where`-bounds
- The FLS does not document type inference to such a degree.
- Weaken eager detection of cyclic types during type inference
- The FLS does not specify type inference to such a degree.
- `trait Trait: Auto {}`: allow upcasting from `dyn Trait` to `dyn Trait + Auto`
- New paragraph: :p:`fls_SYnFJBhi0IWj`
- Reveal opaque types within the defining body for exhaustiveness checking.
- Concrete type introspection is outside the scope of the FLS.
- Stabilize C-string literals.
- New section: :ref:`fls_U1gHCy16emVe`
- Stabilize THIR unsafeck.
- This is not a language change.
- Add lint `static_mut_refs` to warn on references to mutable statics.
- Lints are outside the scope of the FLS.
- Support async recursive calls (as long as they have indirection).
- This lifted restriction was not documented in the FLS.
- Undeprecate lint `unstable_features` and make use of it in the compiler.
- Lints are outside the scope of the FLS.
- Make inductive cycles in coherence ambiguous always.
- The trait solver is outside the scope of the FLS.
- Get rid of type-driven traversal in const-eval interning, only as a future compatibility lint for now.
- This lifted restriction was not documented in the FLS.
- Deny braced macro invocations in let-else.
- New paragraph: :p:`fls_1s1UikGU5YQb`