Result<T, Uninhabited> and ControlFlow<Uninhabited, T> to be equivalent to T for must use lintdead_code_pub_in_binary lint for unused pub items in binary cratesdiv32, lam-bh, lamcas, ld-seq-sa and scq target featurescfg(target_has_atomic_primitive_alignment)self in imports in more casesRefer to Rust’s platform support page for more information on Rust’s tiered platform support.
Default for RepeatNCopy for ffi::FromBytesUntilNulErrorSend for std::fs::File on UEFI<{integer}>::isolate_highest_one<{integer}>::isolate_lowest_one<{integer}>::highest_one<{integer}>::lowest_one<{integer}>::bit_widthNonZero<{integer}>::isolate_highest_oneNonZero<{integer}>::isolate_lowest_oneNonZero<{integer}>::highest_oneNonZero<{integer}>::lowest_oneNonZero<{integer}>::bit_widthThese previously stable APIs are now stable in const contexts:
build.warnings config. This controls how lint warnings from local packages are treated. Useful for enforcing a warning-free build in CI, replacing -Dwarnings. docsresolver.lockfile-path config. This allows specifying the path to the lockfile to use when resolving dependencies. Useful when working with read-only source directories. docs--target-dir doesn’t look like a Cargo target directory. This prevents accidental deletion of non-target directories.-m shorthand for --manifest-pathcurl dependency from crates-io cratef32: From<{float}> to constrain {float}pin!, in order to prevent unsoundness. The most likely case where this might impact users is: writing pin!(x) where x has type &mut T will now always correctly produce a value of type Pin<&mut &mut T>, instead of sometimes allowing a coercion that produces a value of type Pin<&mut T>. This coercion was previously incorrectly allowed since Rust 1.88.0.std::char constants and functionsf64 methods which have been deprecated since 1.0varargs_without_pattern lint in depslink_section specifierenums have changed. This is not a breaking change, as it only applies to enums without layout guarantees, but is noted here as we’ve seen people impacted from having made assumptions about the layout algorithm.#[export_name = "..."] where the name is empty#[link_name = "..."] & #[link(name = "...")] parametersshutdown on a socket to shut down the write side, attempting to write to the socket will now produce a BrokenPipe error rather than Other. Map WSAESHUTDOWN to io::ErrorKind::BrokenPipeexpr metavariable to cfgManuallyDrop as patterns (fixing a regression introduced in 1.94.0)riscv64gc-unknown-fuchsia baseline to RVA22 + vectorNonZero integersassert_matches!debug_assert_matches!From<T> for AssertUnwindSafe<T>From<T> for LazyCell<T, F>From<T> for LazyLock<T, F>core::range::RangeToInclusivecore::range::RangeToInclusiveItercore::range::RangeFromcore::range::RangeFromItercore::range::Rangecore::range::RangeItertarget.'cfg(..)'.rustdocflags support in configuration.white-space: pre-wrap; property and stripped any <p> elements from the rendered html, however this caused issues and unintuitive behavior. The new behavior should be more predictable, however some multi-line deprecation notes will now be rendered as as single lines. If this is undesirable, you can use the standard markdown method of forcing a linebreak, which is two spaces followed by a newline ("\n").missing_doc_code_examples lint on impl items#[repr(Int)] enums in some edge cases involving fields of uninhabited zero-sized typesPin<Foo> where Foo doesn’t implement Deref. Some such coercions were previously allowed, but produce a type with no useful public API.--allow-undefined on wasm targets#![reexport_test_harness_main] attributeuninhabited_static lint in dependencies and make it deny-by-default-Csoft-float::{self [as name]}, e.g., struct S {}; use S::{self as Other};, is now no longer permitted because {self} imports require a module parent.export_name, link_name, and link_section attributes, if multiple of the same attribute is present, the first one now takes precedence.avr targets, C’s double type is 32-bit by default, so change c_double to f32 on avr targets to match. This is a breaking change, but necessary to make c_double match C’s double.BTreeMap::append() was optimized, which may now cause panics for types with incorrect Ord implsThese changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
aarch64 softfloat targets now have to have rustc_abi set to "softfloat"cfg(target_abi)if let guards on match armsirrefutable_let_patterns lint no longer lints on let chains--remap-path-scope for controlling the scoping of how paths get remapped in the resulting binarypowerpc64-unknown-linux-musl to Tier 2 with host toolsaarch64-apple-tvos to Tier 2aarch64-apple-tvos-sim to Tier 2aarch64-apple-watchos to Tier 2aarch64-apple-watchos-sim to Tier 2aarch64-apple-visionos to Tier 2aarch64-apple-visionos-sim to Tier 2Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
thread::scope: document how join interacts with TLS destructorsstr::contains on aarch64 targets with neon target feature enabled by defaultMaybeUninit<[T; N]>: From<[MaybeUninit<T>; N]>MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>; N]>MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>]>MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>; N]>MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>]>[MaybeUninit<T>; N]: From<MaybeUninit<[T; N]>>Cell<[T; N]>: AsRef<[Cell<T>; N]>Cell<[T; N]>: AsRef<[Cell<T>]>Cell<[T]>: AsRef<[Cell<T>]>bool: TryFrom<{integer}>AtomicPtr::updateAtomicPtr::try_updateAtomicBool::updateAtomicBool::try_updateAtomicIn::updateAtomicIn::try_updateAtomicUn::updateAtomicUn::try_updatecfg_select!mod core::rangecore::range::RangeInclusivecore::range::RangeInclusiveItercore::hint::cold_path<*const T>::as_ref_unchecked<*mut T>::as_ref_unchecked<*mut T>::as_mut_uncheckedVec::push_mutVec::insert_mutVecDeque::push_front_mutVecDeque::push_back_mutVecDeque::insert_mutLinkedList::push_front_mutLinkedList::push_back_mutLayout::dangling_ptrLayout::repeatLayout::repeat_packedLayout::extend_packedThese previously stable APIs are now stable in const contexts:
$crate without renaming, i.e. use $crate::{self};, is now no longer permitted due to stricter error checking for self imports.const or static.ambiguous_glob_imported_traits is now reported when using an ambiguously glob imported traitEq::assert_receiver_is_total_eq and emit future compatibility warnings on manual impls#[non_exhaustive] enum now reads the discriminant, even if the enum has only one variant. This can cause closures to capture values that they previously wouldn’t.mut ref and mut ref mut patterns, part of the unstable Match Ergonomics 2024 RFC, were accidentally allowed on stable within struct pattern field shorthand. These patterns are now correctly feature-gated as unstable in this position.-Z unstable-options to use. Previously, they could not be used without the standard library, which has no stable build mechanism. In preparation for the build-std project adding that support, JSON target specs are being proactively gated to ensure they remain unstable even if build-std is stabilized. Cargo now includes the -Z json-target-spec CLI flag to automatically pass -Z unstable-options to the compiler when needed. See #150151, #151534, and rust-lang/cargo#16557.#[feature] attributes on invalid targets are now checkedThese changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
std::thread::spawn on wasm32-wasip1-threadsstd::os::windows::fs::OpenOptionsExt
The new methods were unstable, but the trait itself is not sealed and so
cannot be extended with non-default methods.match_same_armsdead_code lint level of the corresponding traits and trait itemsunused_visibilities lint for visibility on const _ declarationsRefer to Rust’s platform support page for more information on Rust’s tiered platform support.
<[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_mutavx512fp16 intrinsics
(excluding those that depend directly on the unstable f16 type)f16 type)f32::consts::EULER_GAMMAf64::consts::EULER_GAMMAf32::consts::GOLDEN_RATIOf64::consts::GOLDEN_RATIOThese previously stable APIs are now stable in const contexts:
CARGO_BIN_EXE_<crate> available at runtime dyn-typesDrop to run at a different point in time.#[macro_use]
This will raise an error if macros of the same name are glob imported.
For example if a crate defines their own matches macro and then glob imports that,
it’s now ambiguous whether the custom or standard library matches is meant and
an explicit import of the name is required to resolve the ambiguity.
One exception is core::panic and std::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.
Both core::panic! and std::panic! are then in scope and which is used is ambiguous.include!(…)s
This can cause previously working includes to no longer compile if they included files which started with a shebang.std::time::SystemTime::checked_sub_duration will return None for times before the Windows epoch (1/1/1601)'a are now NFC normalized.--remap-path-prefix given 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.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.
annotate-snippets for error emission
This should preserve mostly the same outputs in rustc error messages.clippy::panicking_unwrap false-positive on field access with implicit deref.wasm32-wasip2 target.vector-related target features and the is_s390x_feature_detected! macrosystem ABIcfg predicateasm_cfgconst items that contain mutable references to static (which is very unsafe, but not always UB)const_item_interior_mutations lint to warn against calls which mutate interior mutable const itemsfunction_casts_as_integer lint-Cjump-tables=bool. The flag was previously called -Zno-jump-tables.Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
specialization on the Copy trait as it is unsound in the presence of lifetime dependent Copy implementations. This may result in some performance regressions as some standard library APIs may now call Clone::clone instead of performing bitwise copiesstd::thread::current()BTree::append not update existing keys when appending an entry which already existsT: RefUnwindSafe for vec::IntoIter<T>: UnwindSafe<[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::FromFncargo tree, support long forms for --format variables--workspace to cargo clean#![doc(document_private_items)]importhtml_favicon_url, html_logo_url, html_playground_url, issue_tracker_base_url, or html_no_source either has a missing value, an unexpected value, or a value of the wrong type, rustdoc will emit the deny-by-default lint rustdoc::invalid_doc_attributes.pin_v2 into the builtin attributes namespacepanic=unwind was changed from the JS exception handling ABI to the wasm exception handling ABI. If linking C/C++ object files with Rust objects, -fwasm-exceptions must 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.#[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 when test attribute is applied to structsCARGO_CFG_DEBUG_ASSERTIONS environment variable in more situations. This will cause crates depending on static-init versions 1.0.1 to 1.0.3 to fail compilation with “failed to resolve: use of unresolved module or unlinked crate parking_lot”. See the linked issue for details.offset_of! macro are now checked to be well formed.cargo publish no longer emits .crate files as a final artifact for user access when the build.build-dir config is unsetderef_nullptr lint from warn-by-default to deny-by-default... function parameters without a pattern outside of extern blocksrepr(C) enums whose discriminant values do not fit into a c_int or c_uintrepr(C) types as part of repr(transparent)MaybeUninit representation and validity&raw [mut | const] for union field in safe codeSizedX in [X; 0] when X is unsizing a const#[track_caller] and #[no_mangle] (requires every declaration specifying #[track_caller] as well)never_type_fallback_flowing_into_unsafe and dependency_on_unit_never_type_fallback deny-by-defaultunused_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.mips64el-unknown-linux-muslabi64 link dynamicallyIterator::eq{_by} for TrustedLen iteratorsExtend for tuplesDebug for EncodeWide.iter::Repeat::last and count will now panic, rather than looping infinitely.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::TokenStreamThese previously stable APIs are now stable in const contexts:
Iterator::last as well as impl methods like std::vec::IntoIter::last. Now these impl methods will be hidden, freeing up space for inherent methods like BTreeSet::last.-C panic=abort on Linux by generating unwind tables by default. Build with -C force-unwind-tables=no to keep omitting unwind tables.invalid_macro_export_arguments is upgraded to deny-by-default and will be reported in dependencies too.impl DerefMut for Pin<LocalType>pin! and formatting macroswasm_import_module attribute cross-crate. This fixes linker errors on WASM targets.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.dangling_pointers_from_locals lint to warn against dangling pointers from local variablessemicolon_in_expressions_from_macros from warn to denyinteger_to_ptr_transmutes lint against integer-to-pointer transmutessse4a and tbm target featurestarget_env = "macabi" and target_env = "sim" cfgs as replacements for the target_abi cfgs with the same values.aarch64-pc-windows-gnullvm and x86_64-pc-windows-gnullvm to Tier 2 with host tools.
Note: llvm-tools and MSI installers are missing but will be added in future releases.aarch64-pc-windows-msvc to Tier 1Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
core::panic::Location::file return type_by() variants of min / max/ minmax in std::cmpClone and Eq traitsstd::thread: Return error if setting thread stack size fails
This used to panic within the standard library.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<[T; N]>::each_mutOsString::newPathBuf::newTypeId::ofptr::with_exposed_provenanceptr::with_exposed_provenance_mutbuild.build-dir.
This config sets the directory where intermediate build artifacts are stored.
These artifacts are produced by Cargo and rustc during the build process.
End users usually won’t need to interact with them, and the layout inside
build-dir is an implementation detail that may change without notice.
(config doc)
(build cache doc)
#15833
#15840--target flag and the build.target configuration can now take literal
"host-tuple" string, which will internally be substituted by the host
machine’s target triple.
#15838
#16003
#16032*const u8 ->, and additionally functions that take or return raw pointers will now display their signature properly in search results.cc, and pass it via SDKROOT env var. This should fix linking issues with rustc running inside Xcode. Libraries in /usr/local/lib may no longer be linked automatically, if you develop or use a crate that relies on this, you should explicitly set cargo::rustc-link-search=/usr/local/lib in a build.rs script.TraitRef<AssocTy: ?Sized> are now correctly forbidden#[sanitize(xyz = "on|off")] built-in attribute that shadows procedural macros with the same namesemicolon_in_expressions_from_macros, for macro_rules! macros in expression position that expand to end in a semicolon (;), is now deny-by-default. It was already warn-by-default, and a future compatibility warning (FCW) that warned even in dependencies. This lint will become a hard error in the future.unsafe, !, default) in inherent impls are no longer syntactically validill_formed_attribute_input in dependenciespin!, format_args!, write!, and writeln! in if let scrutinees in Rust Edition 2024. This applies Rust Edition 2024’s if let temporary scope rules to these temporaries, which previously could live past the if expression regardless of Edition.static are now syntactically invalid--cfg and --check-cfg arguments are no longer allowedCargo compatibility notes:
cargo publish no longer keeps .crate tarballs as final build artifacts
when build.build-dir is set. These tarballs were previously included due to
an oversight and are now treated as intermediate artifacts.
To get .crate tarballs as final artifacts, use cargo package.
In a future version, this change will apply regardless of build.build-dir.
#15910build-dir
may not work for users changing their build-dir layout.
For those doing so, we’d recommend proactively testing these cases
particularly as we are considering changing the default location of the build-dir in the future
(cargo#16147).
If you can’t migrate off of Cargo’s internal details,
we’d like to learn more about your use case as we prepare to change the layout of the build-dir
(cargo#15010).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.
unknown_or_malformed_diagnostic_attributes lint. This lint has been split up into four finer-grained lints, with unknown_or_malformed_diagnostic_attributes now 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 literallld by default on x86_64-unknown-linux-gnu.musl targets 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-musleabihfRefer to Rust’s platform support page for more information on Rust’s tiered platform support.
u*::{checked,overflowing,saturating,wrapping}_sub_signedCStr, CString, and Cow<CStr>MSG_NOSIGNAL for UnixStreamproc_macro::Ident::new now supports $crate.Thread::into_raw has at least 8 bytes of alignmentu{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_evenhttp.proxy-cainfo config for proxy certsgix for cargo packageimpl blocks, now they do when shift is heldunsafe() wrapperslld by default on x86_64-unknown-linux-gnu.
See also https://blog.rust-lang.org/2025/09/01/rust-lld-on-1.90.0-stable/.core::iter::Fuse’s Default impl construct I::default() internally as promised in the docs instead of always being emptyMSG_NOSIGNAL for UnixStream
This 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.std::env::home_dir will use the fallback if the HOME environment variable is emptyextern "{abi}"s consistently in all positions. This primarily affects the use of implementing traits on an extern "{abi}" function pointer, like extern "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.proc_macro_derive macro has correct arguments when applied to the crate rootfeature(generic_arg_infer))mismatched_lifetime_syntaxes lint.
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-default elided_named_lifetimes lint.unpredictable_function_pointer_comparisons to also lint on function pointer comparisons in external macrosdangerous_implicit_autorefs lint deny-by-defaultkl and widekl target features for x86sha512, sm3 and sm4 target features for x86f, d, frecipe, lasx, lbt, lsx, and lvzi128 and u128 from improper_ctypes_definitionsrepr128 (#[repr(u128)], #[repr(i128)])#![doc(test(attr(..)))] everywhereextern "C" functions on the wasm32-unknown-unknown target now have a standards compliant ABIloongarch32-unknown-none and loongarch32-unknown-none-softfloatx86_64-apple-darwin is in the process of being demoted to Tier 2 with host toolsRefer to Rust’s platform support page for more information on Rust’s tiered platform support.
file!format_args!() in a variable#[must_use] to [T; N]::mapDerefMut for Lazy{Cell,Lock}Default for array::IntoIterClone for slice::ChunkByio::Seek for io::TakeNonZero<char>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_quickackThese previously stable APIs are now stable in const contexts:
cargo fix and cargo clippy --fix now default to the same Cargo target selection as other build commands. Previously it would apply to all targets (like binaries, examples, tests, etc.). The --edition flag still applies to all targets.runner setting 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.missing_fragment_specifier an unconditional errorneon target feature on aarch64-unknown-none-softfloat causes a warning because mixing code with and without that target feature is not properly supported by LLVM?Sized bounds 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 the sized_hierarchy unstable feature. See the FCP report for a code example.elided_named_lifetimes lint is superseded by the warn-by-default mismatched_lifetime_syntaxes lint.Copy are now only available at the end of type checkingstd::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.std::intrinsics::drop_in_place!) are now reported in dependenciesstd::ptr::copy_* intrinsics also perform the static self-init checksextern "C" functions on the wasm32-unknown-unknown target now have a standards compliant ABIThese changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
#![feature(let_chains)] in the 2024 edition.
This feature allows &&-chaining let statements inside if and while, allowing intermixture with boolean expressions. The patterns inside the let sub-expressions can be irrefutable or refutable.#![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.#![feature(cfg_boolean_literals)].
This allows using boolean literals as cfg predicates, e.g. #[cfg(true)] and #[cfg(false)].#[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.dangerous_implicit_autorefs lint against implicit autoref of raw pointer dereference.
The lint will be bumped to deny-by-default in the next version of Rust.invalid_null_arguments lint to prevent invalid usage of null pointers.
This lint is uplifted from clippy::invalid_null_ptr_usage.Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
#[should_panic] test failure message.[T; N]::from_fn is generated in order of increasing indices., for those passing it a stateful closure.--nocapture is deprecated in favor of the more consistent --no-capture flag.{float}::NAN is a quiet NaN.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_strThese 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_cellsignore-* attributes.--test-runtool and --test-runtool-arg CLI options to specify a program (like qemu) and its arguments to run a doctest.tt fragment specifier can often fix these macros.#[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.asm_goto feature..EXPR) after unary operators !, -, and *.Self: Sized bounds in impls for unsized typesfeature(precise_capturing_in_traits) allowing use<...> bounds on return position impl Trait in traitsRefer to Rust’s platform support page for more information on Rust’s tiered platform support.
Debug impl of raw pointersVec::with_capacity guarantees it allocates with the amount requested, even if Vec::capacity returns a different number.std::arch intrinsics which don’t take pointer arguments can now be called from safe code if the caller has the appropriate target features already enabled (https://github.com/rust-lang/stdarch/pull/1714, https://github.com/rust-lang/stdarch/pull/1716, https://github.com/rust-lang/stdarch/pull/1717)env::home_dirControlFlow as #[must_use]assert_eq! and vec! now support const {...} expressionsVec::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_mutThese 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_sliceVec::capacityVec::lenVec::is_emptyVec::as_mut_sliceVec::as_mut_ptr#![crate_name] attributeDebug impl of raw pointers print metadata if presentdyn types are no longer deduplicated.. inside of struct patterns (let Struct { #[attribute] .. }) =ptr_cast_add_auto_to_object lint into hard errorstd::arch intrinsics are now safe to call in some contexts, there may now be new unused_unsafe warnings in existing codebases.width and precision formatting options to 16 bits on all targetsControlFlow as #[must_use]advapi32, except on win7. Code such as C libraries that were relying on this assumption may need to explicitly link advapi32.cfg(true) attributes.tt fragment specifier can often fix these macros.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.
#[target_feature] attribute.missing_abi lint now warns-by-default.--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.repr() attribute applied to invalid items are now correctly rejected.#![test] and #![rustfmt::skip] are no longer accepted in more places than intended.-O to mean -C opt-level=3 instead of -C opt-level=2 to match Cargo’s defaults.overflowing_literals under certain macro environments.i686-unknown-redox target with i586-unknown-redox.i686-unknown-hurd-gnu to Pentium 4.{aarch64-unknown,x86_64-pc}-nto-qnx710_iosock.
For supporting Neutrino QNX 7.1 with io-socket network stack.{aarch64-unknown,x86_64-pc}-nto-qnx800.
For supporting Neutrino QNX 8.0 (no_std-only).{x86_64,i686}-win7-windows-gnu.
Intended for backwards compatibility with Windows 7. {x86_64,i686}-win7-windows-msvc are the Windows MSVC counterparts that already exist as Tier 3 targets.amdgcn-amd-amdhsa.x86_64-pc-cygwin.{mips,mipsel}-mti-none-elf.
Initial bare-metal support.m68k-unknown-none-elf.armv7a-nuttx-{eabi,eabihf}, aarch64-unknown-nuttx, and thumbv7a-nuttx-{eabi,eabihf}.Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
FromBytesWithNulError in CStr::from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError> was changed from an opaque struct to an enum, allowing users to examine why the conversion failed.RustcDecodable and RustcEncodable.--logfile option.std::fs::remove_file will now remove read-only files.{float}::next_down{float}::next_up<[_]>::get_disjoint_mut<[_]>::get_disjoint_unchecked_mutslice::GetDisjointMutErrorHashMap::get_disjoint_mutHashMap::get_disjoint_unchecked_mutNonZero::count_onesVec::pop_ifsync::Once::waitsync::Once::wait_forcesync::OnceLock::waitThese APIs are now stable in const contexts:
hint::black_boxio::Cursor::get_mutio::Cursor::set_positionstr::is_char_boundarystr::split_atstr::split_at_checkedstr::split_at_mutstr::split_at_mut_checked--package and --workspace are passed but the requested package is missing. This was previously silently ignored, which was considered a bug since missing packages should be reported.cargo login to avoid shell history leaks.SourceID comparisons. This may potentially change behavior if the canonicalized URL compares differently in alternative registries.wasm_c_abi future compatibility warning is now a hard error.
Users of wasm-bindgen should upgrade to at least version 0.2.89, otherwise compilation will fail.#![no_start] and #![crate_id].cenum_impl_drop_cast has been made into a hard error. This means it is now an error to cast a field-less enum to an integer if the enum implements Drop.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.
target_feature checks when generating docs.std::fs::rename on Windows 10, version 1607.cc to fix custom targets.#[diagnostic::do_not_recommend]unpredictable_function_pointer_comparisons lint to warn against function pointer comparisons#[no_mangle] and #[export_name] attributes.-Zpolymorphize has been removed, see https://github.com/rust-lang/compiler-team/issues/810 for some background.Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
Panics in the standard library now have a leading library/ in their path
std::env::home_dir() on Windows now ignores the non-standard $HOME environment variable
It will be un-deprecated in a subsequent release.
BuildHasherDefault::newptr::fn_addr_eqio::ErrorKind::QuotaExceededio::ErrorKind::CrossesDevices{float}::midpoint{integer}::midpointNonZeroU*::midpointstd::iter::Extend for tuples with arity 1 through 12FromIterator<(A, ...)> for tuples with arity 1 through 12std::task::Waker::noopThese APIs are now stable in const contexts:
mem::size_of_valmem::align_of_valLayout::for_valueLayout::align_toLayout::pad_to_alignLayout::extendLayout::arraystd::mem::swapstd::ptr::swapNonNull::newHashMap::with_hasherHashSet::with_hasherBuildHasherDefault::new<float>::recip<float>::to_degrees<float>::to_radians<float>::max<float>::min<float>::clamp<float>::abs<float>::signum<float>::copysignMaybeUninit::writeCARGO_CFG_FEATURE to build scriptsrustc no longer treats the test cfg as a well known check-cfg, instead it is up to the build systems and users of --check-cfg1 to set it as a well known cfg using --check-cfg=cfg(test).
This is done to enable build systems like Cargo to set it conditionally, as not all source files are suitable for unit tests.
Cargo (for now) unconditionally sets the test cfg as a well known cfg.
Disable potentially incorrect type inference if there are trivial and non-trivial where-clauses
std::env::home_dir() has been deprecated for years, because it can give surprising results in some Windows configurations if the HOME environment variable is set (which is not the normal configuration on Windows). We had previously avoided changing its behavior, out of concern for compatibility with code depending on this non-standard configuration. Given how long this function has been deprecated, we’re now fixing its behavior as a bugfix. A subsequent release will remove the deprecation for this function.
Make core::ffi::c_char signedness more closely match that of the platform-default char
This changed c_char from an i8 to u8 or vice versa on many Tier 2 and 3
targets (mostly Arm and RISC-V embedded targets). The new definition may
result in compilation failures but fixes compatibility issues with C.
The libc crate matches this change as of its 0.2.169 release.
Increase sparcv9-sun-solaris and x86_64-pc-solaris Solaris baseline to 11.4.
Show abi_unsupported_vector_types lint in future breakage reports
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.
#[deny] inside #[forbid] as a no-op-Ctarget-feature is used to toggle features that can lead to unsoundness due to ABI mismatches/ as the path separator for include!() in all cases on Windowsraw (const|mut)) of a deref of a pointer (*ptr) is now safeextern "C" function--print host-tuple flag to print the host target tuple and affirm the “target tuple” terminology over “target triple”loongarch64-unknown-linux-{musl,ohos}unexpected_cfgs lint to also warn in external macrosmultivalue, reference-types, and tail-call target featureswasm32v1-none targetFrom<&mut {slice}> for Box/Rc/Arc<{slice}><float>::copysign, <float>::abs, <float>::signum to coreLowerExp and UpperExp implementations to NonZeroFromStr for CString and TryFrom<CString> for Stringstd::os::darwin has been made publicIpv6Addr::is_unique_localIpv6Addr::is_unicast_link_localcore::ptr::with_exposed_provenancecore::ptr::with_exposed_provenance_mut<ptr>::addr<ptr>::expose_provenance<ptr>::with_addr<ptr>::map_addr<int>::isqrt<int>::checked_isqrt<uint>::isqrtNonZero::isqrtcore::ptr::without_provenancecore::ptr::without_provenance_mutcore::ptr::danglingcore::ptr::dangling_mutPin::as_deref_mutThese APIs are now stable in const contexts
AtomicBool::from_ptrAtomicPtr::from_ptrAtomicU8::from_ptrAtomicU16::from_ptrAtomicU32::from_ptrAtomicU64::from_ptrAtomicUsize::from_ptrAtomicI8::from_ptrAtomicI16::from_ptrAtomicI32::from_ptrAtomicI64::from_ptrAtomicIsize::from_ptr<ptr>::is_null<ptr>::as_ref<ptr>::as_mutPin::newPin::new_uncheckedPin::get_refPin::into_refPin::get_mutPin::get_unchecked_mutPin::static_refPin::static_mutLSX target feature for LoongArch Linux targets-Zprofile flag (“gcov-style” coverage instrumentation) has been removed. This does not affect the stable flags for coverage instrumentation (-Cinstrument-coverage) and profile-guided optimization (-Cprofile-generate, -Cprofile-use), which are unrelated and remain available.wasm32-wasi has been removed as the target is now named wasm32-wasip1. This completes the transition plan for this target following the introduction of wasm32-wasip1 in Rust 1.78. Compiler warnings on use of wasm32-wasi introduced in Rust 1.81 are now gone as well as the target is removed.&pin (mut|const) T is now parsed as a type which in theory could affect macro expansion results in some edge casesstd::arch functions is no longer permitted to declare items or bodies (such as closures, inline consts, or async blocks).&mut, *mut, &Cell, and *const Cell in const.const initializers.'r#ident).!const extern functions can now be defined for other calling conventions.expr_2021 macro fragment specifier in all editions.non_local_definitions lint now fires on less code and warns by default.-Csoft-float flag.Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
PartialEq for ExitCode.catch_unwind can deal with foreign exceptions without UB, although the exact behavior is unspecified.Default for HashMap/HashSet iterators that don’t already have it.ptr::add/sub to not claim equivalence with offset.BufRead::skip_untilControlFlow::break_valueControlFlow::continue_valueControlFlow::map_breakControlFlow::map_continueDebugList::finish_non_exhaustiveDebugMap::finish_non_exhaustiveDebugSet::finish_non_exhaustiveDebugTuple::finish_non_exhaustiveErrorKind::ArgumentListTooLongErrorKind::DeadlockErrorKind::DirectoryNotEmptyErrorKind::ExecutableFileBusyErrorKind::FileTooLargeErrorKind::HostUnreachableErrorKind::IsADirectoryErrorKind::NetworkDownErrorKind::NetworkUnreachableErrorKind::NotADirectoryErrorKind::NotSeekableErrorKind::ReadOnlyFilesystemErrorKind::ResourceBusyErrorKind::StaleNetworkFileHandleErrorKind::StorageFullErrorKind::TooManyLinksOpt