Releases: rust-lang/rust
Rust 1.94.0
Language
- Impls and impl items inherit
dead_codelint level of the corresponding traits and trait items - Stabilize additional 29 RISC-V target features including large portions of the RVA22U64 / RVA23U64 profiles
- Add warn-by-default
unused_visibilitieslint for visibility onconst _declarations - Update to Unicode 17
- Avoid incorrect lifetime errors for closures
Platform Support
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
Stabilized APIs
<[T]>::array_windows<[T]>::element_offsetLazyCell::getLazyCell::get_mutLazyCell::force_mutLazyLock::getLazyLock::get_mutLazyLock::force_mutimpl TryFrom<char> for usizestd::iter::Peekable::next_if_mapstd::iter::Peekable::next_if_map_mut- x86
avx512fp16intrinsics (excluding those that depend directly on the unstablef16type) - AArch64 NEON fp16 intrinsics (excluding those that depend directly on the unstable
f16type) f32::consts::EULER_GAMMAf64::consts::EULER_GAMMAf32::consts::GOLDEN_RATIOf64::consts::GOLDEN_RATIO
These previously stable APIs are now stable in const contexts:
Cargo
- Stabilize the config include key. The top-level include config key allows loading additional config files, enabling better organization, sharing, and management of Cargo configurations across projects and environments. docs #16284
- Stabilize the pubtime field in registry index. This records when a crate version was published and enables time-based dependency resolution in the future. Note that crates.io will gradually backfill existing packages when a new version is published. Not all crates have pubtime yet. #16369 #16372
- Cargo now parses TOML v1.1 for manifests and configuration files. Note that using these features in Cargo.toml will raise your development MSRV, but the published manifest remains compatible with older parsers. #16415
- Make
CARGO_BIN_EXE_<crate>available at runtime
Compatibility Notes
- Forbid freely casting lifetime bounds of
dyn-types - Make closure capturing have consistent and correct behaviour around patterns Some finer details of how precise closure captures get affected by pattern matching have been changed. In some cases, this can cause a non-move closure that was previously capturing an entire variable by move, to now capture only part of that variable by move, and other parts by borrow. This can cause the borrow checker to complain where it previously didn't, or cause
Dropto run at a different point in time. - Standard library macros are now imported via prelude, not via injected
#[macro_use]This will raise an error if macros of the same name are glob imported. For example if a crate defines their ownmatchesmacro and then glob imports that, it's now ambiguous whether the custom or standard librarymatchesis meant and an explicit import of the name is required to resolve the ambiguity. One exception iscore::panicandstd::panic, if their import is ambiguous a new warning (ambiguous_panic_imports) is raised. This may raise a new warning (ambiguous_panic_imports) on#![no_std]code glob importing the std crate. Bothcore::panic!andstd::panic!are then in scope and which is used is ambiguous. - Don't strip shebang in expression-context
include!(…)s This can cause previously working includes to no longer compile if they included files which started with a shebang. - Ambiguous glob reexports are now also visible cross-crate This unifies behavior between local and cross-crate errors on these exports, which may introduce new ambiguity errors.
- Don't normalize where-clauses before checking well-formedness
- Introduce a future compatibility warning on codegen attributes on body-free trait methods These attributes currently have no effect in this position.
- On Windows
std::time::SystemTime::checked_sub_durationwill returnNonefor times before the Windows epoch (1/1/1601) - Lifetime identifiers such as
'aare now NFC normalized. - Overhaul filename handling for cross-compiler consistency Any paths emitted by compiler now always respect the relative-ness of the paths and
--remap-path-prefixgiven originally. One side-effect of this change is that paths emitted for local crates in Cargo (path dependencies and workspace members) are no longer absolute but relative when emitted as part of a diagnostic in a downstream crate.
Internal Changes
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
- Switch to
annotate-snippetsfor error emission This should preserve mostly the same outputs in rustc error messages.
Rust 1.93.1
- Don't try to recover keyword as non-keyword identifier, fixing an ICE that especially affected rustfmt.
- Fix
clippy::panicking_unwrapfalse-positive on field access with implicit deref. - Revert "Update wasm-related dependencies in CI", fixing file descriptor leaks on the
wasm32-wasip2target.
Rust 1.93.0
Language
- Stabilize several s390x
vector-related target features and theis_s390x_feature_detected!macro - Stabilize declaration of C-style variadic functions for the
systemABI - Emit error when using some keyword as a
cfgpredicate - Stabilize
asm_cfg - During const-evaluation, support copying pointers byte-by-byte
- LUB coercions now correctly handle function item types, and functions with differing safeties
- Allow
constitems that contain mutable references tostatic(which is very unsafe, but not always UB) - Add warn-by-default
const_item_interior_mutationslint to warn against calls which mutate interior mutableconstitems - Add warn-by-default
function_casts_as_integerlint
Compiler
- Stabilize
-Cjump-tables=bool. The flag was previously called-Zno-jump-tables.
Platform Support
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Stop internally using
specializationon theCopytrait as it is unsound in the presence of lifetime dependentCopyimplementations. This may result in some performance regressions as some standard library APIs may now callClone::cloneinstead of performing bitwise copies - Allow the global allocator to use thread-local storage and
std::thread::current() - Make
BTree::appendnot update existing keys when appending an entry which already exists - Don't require
T: RefUnwindSafeforvec::IntoIter<T>: UnwindSafe
Stabilized APIs
<[MaybeUninit<T>]>::assume_init_drop<[MaybeUninit<T>]>::assume_init_ref<[MaybeUninit<T>]>::assume_init_mut<[MaybeUninit<T>]>::write_copy_of_slice<[MaybeUninit<T>]>::write_clone_of_sliceString::into_raw_partsVec::into_raw_parts<iN>::unchecked_neg<iN>::unchecked_shl<iN>::unchecked_shr<uN>::unchecked_shl<uN>::unchecked_shr<[T]>::as_array<[T]>::as_mut_array<*const [T]>::as_array<*mut [T]>::as_mut_arrayVecDeque::pop_front_ifVecDeque::pop_back_ifDuration::from_nanos_u128char::MAX_LEN_UTF8char::MAX_LEN_UTF16std::fmt::from_fnstd::fmt::FromFn
Cargo
- Enable CARGO_CFG_DEBUG_ASSERTIONS in build scripts based on profile
- In
cargo tree, support long forms for--formatvariables - Add
--workspacetocargo clean
Rustdoc
- Remove
#![doc(document_private_items)] - Include attribute and derive macros in search filters for "macros"
- Include extern crates in search filters for
import - Validate usage of crate-level doc attributes. This means if any of
html_favicon_url,html_logo_url,html_playground_url,issue_tracker_base_url, orhtml_no_sourceeither has a missing value, an unexpected value, or a value of the wrong type, rustdoc will emit the deny-by-default lintrustdoc::invalid_doc_attributes.
Compatibility Notes
- Introduce
pin_v2into the builtin attributes namespace - Update bundled musl to 1.2.5
- On Emscripten, the unwinding ABI used when compiling with
panic=unwindwas changed from the JS exception handling ABI to the wasm exception handling ABI. If linking C/C++ object files with Rust objects,-fwasm-exceptionsmust be passed to the linker now. On nightly Rust, it is possible to get the old behavior with-Zwasm-emscripten-eh=false -Zbuild-std, but it will be removed in a future release. - The
#[test]attribute, used to define tests, was previously ignored in various places where it had no meaning (e.g on trait methods or types). Putting the#[test]attribute in these places is no longer ignored, and will now result in an error; this may also result in errors when generating rustdoc. Error whentestattribute is applied to structs - Cargo now sets the
CARGO_CFG_DEBUG_ASSERTIONSenvironment variable in more situations. This will cause crates depending onstatic-initversions 1.0.1 to 1.0.3 to fail compilation with "failed to resolve: use of unresolved module or unlinked crateparking_lot". See the linked issue for details. - User written types in the
offset_of!macro are now checked to be well formed. cargo publishno longer emits.cratefiles as a final artifact for user access when thebuild.build-dirconfig is unset- Upgrade the
deref_nullptrlint from warn-by-default to deny-by-default - Add future-incompatibility warning for
...function parameters without a pattern outside ofexternblocks - Introduce future-compatibility warning for
repr(C)enums whose discriminant values do not fit into ac_intorc_uint - Introduce future-compatibility warning against ignoring
repr(C)types as part ofrepr(transparent)
Rust 1.92.0
Language
- Document
MaybeUninitrepresentation and validity - Allow
&raw [mut | const]for union field in safe code - Prefer item bounds of associated types over where-bounds for auto-traits and
Sized - Do not materialize
Xin[X; 0]whenXis unsizing a const - Support combining
#[track_caller]and#[no_mangle](requires every declaration specifying#[track_caller]as well) - Make never type lints
never_type_fallback_flowing_into_unsafeanddependency_on_unit_never_type_fallbackdeny-by-default - Allow specifying multiple bounds for same associated item, except in trait objects
- Slightly strengthen higher-ranked region handling in coherence
- The
unused_must_uselint no longer warns onResult<(), Uninhabited>(for instance,Result<(), !>), orControlFlow<Uninhabited, ()>. This avoids having to check for an error that can never happen.
Compiler
- Make
mips64el-unknown-linux-muslabi64link dynamically - Remove current code for embedding command-line args in PDB Command-line information is typically not needed by debugging tools, and the removed code was causing problems for incremental builds even on targets that don't use PDB debuginfo.
Libraries
- Specialize
Iterator::eq{_by}forTrustedLeniterators - Simplify
Extendfor tuples - Added details to
DebugforEncodeWide. iter::Repeat::lastandcountwill now panic, rather than looping infinitely.
Stabilized APIs
NonZero<u{N}>::div_ceilLocation::file_as_c_strRwLockWriteGuard::downgradeBox::new_zeroedBox::new_zeroed_sliceRc::new_zeroedRc::new_zeroed_sliceArc::new_zeroedArc::new_zeroed_slicebtree_map::Entry::insert_entrybtree_map::VacantEntry::insert_entryimpl Extend<proc_macro::Group> for proc_macro::TokenStreamimpl Extend<proc_macro::Literal> for proc_macro::TokenStreamimpl Extend<proc_macro::Punct> for proc_macro::TokenStreamimpl Extend<proc_macro::Ident> for proc_macro::TokenStream
These previously stable APIs are now stable in const contexts:
Cargo
- Added a new chapter to the Cargo book, "Optimizing Build Performance".
Rustdoc
- If a trait item appears in rustdoc search, hide the corresponding impl items. Previously a search for "last" would show both
Iterator::lastas well as impl methods likestd::vec::IntoIter::last. Now these impl methods will be hidden, freeing up space for inherent methods likeBTreeSet::last. - Relax rules for identifiers in search. Previously you could only search for identifiers that were valid in rust code, now searches only need to be valid as part of an identifier. For example, you can now perform a search that starts with a digit.
Compatibility Notes
- Fix backtraces with
-C panic=aborton Linux by generating unwind tables by default. Build with-C force-unwind-tables=noto keep omitting unwind tables.
- As part of the larger effort refactoring compiler built-in attributes and their diagnostics, the future-compatibility lint
invalid_macro_export_argumentsis upgraded to deny-by-default and will be reported in dependencies too. - Update the minimum external LLVM to 20
- Prevent downstream
impl DerefMut for Pin<LocalType> - Don't apply temporary lifetime extension rules to the arguments of non-extended
pin!and formatting macros
Rust 1.91.1
- Enable file locking support in illumos. This fixes Cargo not locking the build directory on illumos.
- Fix
wasm_import_moduleattribute cross-crate. This fixes linker errors on WASM targets.
Rust 1.91.0
Language
- Lower pattern bindings in the order they're written and base drop order on primary bindings' order
- Stabilize declaration of C-style variadic functions for
sysv64,win64,efiapi, andaapcsABIs. This brings these ABIs in line with the C ABI: variadic functions can be declared in extern blocks but not defined. - Add
dangling_pointers_from_localslint to warn against dangling pointers from local variables - Upgrade
semicolon_in_expressions_from_macrosfrom warn to deny - Stabilize LoongArch32 inline assembly
- Add warn-by-default
integer_to_ptr_transmuteslint against integer-to-pointer transmutes - Stabilize
sse4aandtbmtarget features - Add
target_env = "macabi"andtarget_env = "sim"cfgs as replacements for thetarget_abicfgs with the same values.
Compiler
Platform Support
- Promote
aarch64-pc-windows-gnullvmandx86_64-pc-windows-gnullvmto Tier 2 with host tools. Note: llvm-tools and MSI installers are missing but will be added in future releases. - Promote
aarch64-pc-windows-msvcto Tier 1
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Print thread ID in panic message
- Fix overly restrictive lifetime in
core::panic::Location::filereturn type - Guarantee parameter order for
_by()variants ofmin/max/minmaxinstd::cmp - Document assumptions about
CloneandEqtraits std::thread: Return error if setting thread stack size fails This used to panic within the standard library.
Stabilized APIs
Path::file_prefixAtomicPtr::fetch_ptr_addAtomicPtr::fetch_ptr_subAtomicPtr::fetch_byte_addAtomicPtr::fetch_byte_subAtomicPtr::fetch_orAtomicPtr::fetch_andAtomicPtr::fetch_xor{integer}::strict_add{integer}::strict_sub{integer}::strict_mul{integer}::strict_div{integer}::strict_div_euclid{integer}::strict_rem{integer}::strict_rem_euclid{integer}::strict_neg{integer}::strict_shl{integer}::strict_shr{integer}::strict_powi{N}::strict_add_unsignedi{N}::strict_sub_unsignedi{N}::strict_absu{N}::strict_add_signedu{N}::strict_sub_signedPanicHookInfo::payload_as_strcore::iter::chainu{N}::checked_signed_diffcore::array::repeatPathBuf::add_extensionPathBuf::with_added_extensionDuration::from_minsDuration::from_hoursimpl PartialEq<str> for PathBufimpl PartialEq<String> for PathBufimpl PartialEq<str> for Pathimpl PartialEq<String> for Pathimpl PartialEq<PathBuf> for Stringimpl PartialEq<Path> for Stringimpl PartialEq<PathBuf> for strimpl PartialEq<Path> for strIpv4Addr::from_octetsIpv6Addr::from_octetsIpv6Addr::from_segmentsimpl<T> Default for Pin<Box<T>> where Box<T>: Default, T: ?Sizedimpl<T> Default for Pin<Rc<T>> where Rc<T>: Default, T: ?Sizedimpl<T> Default for Pin<Arc<T>> where Arc<T>: Default, T: ?SizedCell::as_array_of_cellsu{N}::carrying_addu{N}::borrowing_subu{N}::carrying_mulu{N}::carrying_mul_addBTreeMap::extract_ifBTreeSet::extract_ifimpl Debug for windows::ffi::EncodeWide<'_>str::ceil_char_boundarystr::floor_char_boundaryimpl Sum for Saturating<u{N}>impl Sum<&Self> for Saturating<u{N}>impl Product for Saturating<u{N}>impl Product<&Self> for Saturating<u{N}>
These previously stable APIs are now stable in const contexts:
- [
<[T; N]>::each_ref](https://doc.rust-lang.org/stable/std/...
Rust 1.90.0
Language
- Split up the
unknown_or_malformed_diagnostic_attributeslint. This lint has been split up into four finer-grained lints, withunknown_or_malformed_diagnostic_attributesnow being the lint group that contains these lints:unknown_diagnostic_attributes: unknown to the current compilermisplaced_diagnostic_attributes: placed on the wrong itemmalformed_diagnostic_attributes: malformed attribute syntax or optionsmalformed_diagnostic_format_literals: malformed format string literal
- Allow constants whose final value has references to mutable/external memory, but reject such constants as patterns
- Allow volatile access to non-Rust memory, including address 0
Compiler
- Use
lldby default onx86_64-unknown-linux-gnu. - Tier 3
musltargets now link dynamically by default. Affected targets:mips64-unknown-linux-muslabi64powerpc64-unknown-linux-muslpowerpc-unknown-linux-muslpowerpc-unknown-linux-muslsperiscv32gc-unknown-linux-musls390x-unknown-linux-muslthumbv7neon-unknown-linux-musleabihf
Platform Support
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Stabilize
u*::{checked,overflowing,saturating,wrapping}_sub_signed - Allow comparisons between
CStr,CString, andCow<CStr> - Remove some unsized tuple impls since unsized tuples can't be constructed
- Set
MSG_NOSIGNALforUnixStream proc_macro::Ident::newnow supports$crate.- Guarantee the pointer returned from
Thread::into_rawhas at least 8 bytes of alignment
Stabilized APIs
u{n}::checked_sub_signedu{n}::overflowing_sub_signedu{n}::saturating_sub_signedu{n}::wrapping_sub_signedimpl Copy for IntErrorKindimpl Hash for IntErrorKindimpl PartialEq<&CStr> for CStrimpl PartialEq<CString> for CStrimpl PartialEq<Cow<CStr>> for CStrimpl PartialEq<&CStr> for CStringimpl PartialEq<CStr> for CStringimpl PartialEq<Cow<CStr>> for CStringimpl PartialEq<&CStr> for Cow<CStr>impl PartialEq<CStr> for Cow<CStr>impl PartialEq<CString> for Cow<CStr>
These previously stable APIs are now stable in const contexts:
<[T]>::reversef32::floorf32::ceilf32::truncf32::fractf32::roundf32::round_ties_evenf64::floorf64::ceilf64::truncf64::fractf64::roundf64::round_ties_even
Cargo
- Add
http.proxy-cainfoconfig for proxy certs - Use
gixforcargo package - feat(publish): Stabilize multi-package publishing
Rustdoc
- Add ways to collapse all impl blocks. Previously the "Summary" button and "-" keyboard shortcut would never collapse
implblocks, now they do when shift is held - Display unsafe attributes with
unsafe()wrappers
Compatibility Notes
- Use
lldby default onx86_64-unknown-linux-gnu. See also https://blog.rust-lang.org/2025/09/01/rust-lld-on-1.90.0-stable/. - Make
core::iter::Fuse'sDefaultimpl constructI::default()internally as promised in the docs instead of always being empty - Set
MSG_NOSIGNALforUnixStreamThis may change program behavior but results in the same behavior as other primitives (e.g., stdout, network sockets). Programs relying on signals to terminate them should update handling of sockets to handle errors on write by exiting. - On Unix
std::env::home_dirwill use the fallback if theHOMEenvironment variable is empty - We now reject unsupported
extern "{abi}"s consistently in all positions. This primarily affects the use of implementing traits on anextern "{abi}"function pointer, likeextern "stdcall" fn(), on a platform that doesn't support that, like aarch64-unknown-linux-gnu. Direct usage of these unsupported ABI strings by declaring or defining functions was already rejected, so this is only a change for consistency. - const-eval: error when initializing a static writes to that static
- Check that the
proc_macro_derivemacro has correct arguments when applied to the crate root
Rust 1.89.0
Language
- Stabilize explicitly inferred const arguments (
feature(generic_arg_infer)) - Add a warn-by-default
mismatched_lifetime_syntaxeslint. This lint detects when the same lifetime is referred to by different syntax categories between function arguments and return values, which can be confusing to read, especially in unsafe code. This lint supersedes the warn-by-defaultelided_named_lifetimeslint. - Expand
unpredictable_function_pointer_comparisonsto also lint on function pointer comparisons in external macros - Make the
dangerous_implicit_autorefslint deny-by-default - Stabilize the avx512 target features
- Stabilize
klandwidekltarget features for x86 - Stabilize
sha512,sm3andsm4target features for x86 - Stabilize LoongArch target features
f,d,frecipe,lasx,lbt,lsx, andlvz - Remove
i128andu128fromimproper_ctypes_definitions - Stabilize
repr128(#[repr(u128)],#[repr(i128)]) - Allow
#![doc(test(attr(..)))]everywhere - Extend temporary lifetime extension to also go through tuple struct and tuple variant constructors
extern "C"functions on thewasm32-unknown-unknowntarget now have a standards compliant ABI
Compiler
- Default to non-leaf frame pointers on aarch64-linux
- Enable non-leaf frame pointers for Arm64EC Windows
- Set Apple frame pointers by architecture
Platform Support
- Add new Tier-3 targets
loongarch32-unknown-noneandloongarch32-unknown-none-softfloat x86_64-apple-darwinis in the process of being demoted to Tier 2 with host tools
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Specify the base path for
file! - Allow storing
format_args!()in a variable - Add
#[must_use]to[T; N]::map - Implement
DerefMutforLazy{Cell,Lock} - Implement
Defaultforarray::IntoIter - Implement
Cloneforslice::ChunkBy - Implement
io::Seekforio::Take
Stabilized APIs
NonZero<char>- Many intrinsics for x86, not enumerated here
File::lockFile::lock_sharedFile::try_lockFile::try_lock_sharedFile::unlockNonNull::from_refNonNull::from_mutNonNull::without_provenanceNonNull::with_exposed_provenanceNonNull::expose_provenanceOsString::leakPathBuf::leakResult::flattenstd::os::linux::net::TcpStreamExt::quickackstd::os::linux::net::TcpStreamExt::set_quickack
These previously stable APIs are now stable in const contexts:
Cargo
cargo fixandcargo clippy --fixnow default to the same Cargo target selection as other build commands. Previously it would apply to all targets (like binaries, examples, tests, etc.). The--editionflag still applies to all targets.- Stabilize doctest-xcompile. Doctests are now tested when cross-compiling. Just like other tests, it will use the
runnersetting to run the tests. If you need to disable tests for a target, you can use the ignore doctest attribute to specify the targets to ignore.
Rustdoc
- On mobile, make the sidebar full width and linewrap. This makes long section and item names much easier to deal with on mobile.
Compatibility Notes
- Make
missing_fragment_specifieran unconditional error - Enabling the
neontarget feature onaarch64-unknown-none-softfloatcauses a warning because mixing code with and without that target feature is not properly supported by LLVM - Sized Hierarchy: Part I
- Introduces a small breaking change affecting
?Sizedbounds on impls on recursive types which contain associated type projections. It is not expected to affect any existing published crates. Can be fixed by refactoring the involved types or opting into thesized_hierarchyunstable feature. See the FCP report for a code example.
- Introduces a small breaking change affecting
- The warn-by-default
elided_named_lifetimeslint is superseded by the warn-by-defaultmismatched_lifetime_syntaxeslint. - Error on recursive opaque types earlier in the type checker
- Type inference side effects from requiring element types of array repeat expressions are
Copyare now only available at the end of type checking - The deprecated accidentally-stable
std::intrinsics::{copy,copy_nonoverlapping,write_bytes}are now proper intrinsics. There are no debug assertions guarding against UB, and they cannot be coerced to function pointers. - Remove long-deprecated
std::intrinsics::drop_in_place - Make well-formedness predicates no longer coinductive
- Remove hack when checking impl method compatibility
- Remove unnecessary type inference due to built-in trait object impls
- Lint against "stdcall", "fastcall", and "cdecl" on non-x86-32 targets
- Future incompatibility warnings relating to the never type (
!) are now reported in dependencies - Ensure
std::ptr::copy_*intrinsics also perform the static self-init checks extern "C"functions on thewasm32-unknown-unknowntarget now have a standards compliant ABI
Internal Changes
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
Rust 1.88.0
Language
- Stabilize
#![feature(let_chains)]in the 2024 edition. This feature allows&&-chainingletstatements insideifandwhile, allowing intermixture with boolean expressions. The patterns inside theletsub-expressions can be irrefutable or refutable. - Stabilize
#![feature(naked_functions)]. Naked functions allow writing functions with no compiler-generated epilogue and prologue, allowing full control over the generated assembly for a particular function. - Stabilize
#![feature(cfg_boolean_literals)]. This allows using boolean literals ascfgpredicates, e.g.#[cfg(true)]and#[cfg(false)]. - Fully de-stabilize the
#[bench]attribute. Usage of#[bench]without#![feature(custom_test_frameworks)]already triggered a deny-by-default future-incompatibility lint since Rust 1.77, but will now become a hard error. - Add warn-by-default
dangerous_implicit_autorefslint against implicit autoref of raw pointer dereference. The lint will be bumped to deny-by-default in the next version of Rust. - Add
invalid_null_argumentslint to prevent invalid usage of null pointers. This lint is uplifted fromclippy::invalid_null_ptr_usage. - Change trait impl candidate preference for builtin impls and trivial where-clauses.
- Check types of generic const parameter defaults
Compiler
Platform Support
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Remove backticks from
#[should_panic]test failure message. - Guarantee that
[T; N]::from_fnis generated in order of increasing indices., for those passing it a stateful closure. - The libtest flag
--nocaptureis deprecated in favor of the more consistent--no-captureflag. - Guarantee that
{float}::NANis a quiet NaN.
Stabilized APIs
Cell::updateimpl Default for *const Timpl Default for *mut THashMap::extract_ifHashSet::extract_ifhint::select_unpredictableproc_macro::Span::lineproc_macro::Span::columnproc_macro::Span::startproc_macro::Span::endproc_macro::Span::fileproc_macro::Span::local_file<[T]>::as_chunks<[T]>::as_chunks_mut<[T]>::as_chunks_unchecked<[T]>::as_chunks_unchecked_mut<[T]>::as_rchunks<[T]>::as_rchunks_mutmod ffi::c_str
These previously stable APIs are now stable in const contexts:
NonNull<T>::replace<*mut T>::replacestd::ptr::swap_nonoverlappingCell::replaceCell::getCell::get_mutCell::from_mutCell::as_slice_of_cells
Cargo
Rustdoc
- Doctests can be ignored based on target names using
ignore-*attributes. - Stabilize the
--test-runtooland--test-runtool-argCLI options to specify a program (like qemu) and its arguments to run a doctest.
Compatibility Notes
- Finish changing the internal representation of pasted tokens. Certain invalid declarative macros that were previously accepted in obscure circumstances are now correctly rejected by the compiler. Use of a
ttfragment specifier can often fix these macros. - Fully de-stabilize the
#[bench]attribute. Usage of#[bench]without#![feature(custom_test_frameworks)]already triggered a deny-by-default future-incompatibility lint since Rust 1.77, but will now become a hard error. - Fix borrow checking some always-true patterns. The borrow checker was overly permissive in some cases, allowing programs that shouldn't have compiled.
- Update the minimum external LLVM to 19.
- Make it a hard error to use a vector type with a non-Rust ABI without enabling the required target feature.
Rust 1.87.0
Language
- Stabilize
asm_gotofeature - Allow parsing open beginning ranges (
..EXPR) after unary operators!,-, and*. - Don't require method impls for methods with
Self: Sizedbounds inimpls for unsized types - Stabilize
feature(precise_capturing_in_traits)allowinguse<...>bounds on return positionimpl Traitintraits
Compiler
Platform Support
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Stabilize the anonymous pipe API
- Add support for unbounded left/right shift operations
- Print pointer metadata in
Debugimpl of raw pointers Vec::with_capacityguarantees it allocates with the amount requested, even ifVec::capacityreturns a different number.- Most
std::archintrinsics which don't take pointer arguments can now be called from safe code if the caller has the appropriate target features already enabled (rust-lang/stdarch#1714, rust-lang/stdarch#1716, rust-lang/stdarch#1717) - Undeprecate
env::home_dir - Denote
ControlFlowas#[must_use] - Macros such as
assert_eq!andvec!now supportconst {...}expressions
Stabilized APIs
Vec::extract_ifvec::ExtractIfLinkedList::extract_iflinked_list::ExtractIf<[T]>::split_off<[T]>::split_off_mut<[T]>::split_off_first<[T]>::split_off_first_mut<[T]>::split_off_last<[T]>::split_off_last_mutString::extend_from_withinos_str::DisplayOsString::displayOsStr::displayio::pipeio::PipeReaderio::PipeWriterimpl From<PipeReader> for OwnedHandleimpl From<PipeWriter> for OwnedHandleimpl From<PipeReader> for Stdioimpl From<PipeWriter> for Stdioimpl From<PipeReader> for OwnedFdimpl From<PipeWriter> for OwnedFdBox<MaybeUninit<T>>::writeimpl TryFrom<Vec<u8>> for String<*const T>::offset_from_unsigned<*const T>::byte_offset_from_unsigned<*mut T>::offset_from_unsigned<*mut T>::byte_offset_from_unsignedNonNull::offset_from_unsignedNonNull::byte_offset_from_unsigned<uN>::cast_signedNonZero::<uN>::cast_signed.<iN>::cast_unsigned.NonZero::<iN>::cast_unsigned.<uN>::is_multiple_of<uN>::unbounded_shl<uN>::unbounded_shr<iN>::unbounded_shl<iN>::unbounded_shr<iN>::midpoint<str>::from_utf8<str>::from_utf8_mut<str>::from_utf8_unchecked<str>::from_utf8_unchecked_mut
These previously stable APIs are now stable in const contexts:
core::str::from_utf8_mut<[T]>::copy_from_sliceSocketAddr::set_ipSocketAddr::set_port,SocketAddrV4::set_ipSocketAddrV4::set_port,SocketAddrV6::set_ipSocketAddrV6::set_portSocketAddrV6::set_flowinfoSocketAddrV6::set_scope_idchar::is_digitchar::is_whitespace<[[T; N]]>::as_flattened<[[T; N]]>::as_flattened_mutString::into_bytesString::as_strString::capacityString::as_bytesString::lenString::is_emptyString::as_mut_strString::as_mut_vecVec::as_ptrVec::as_slice- [
Vec::capacity](https://doc.r...