#[repr(..)] attributesextern "custom"dropping_references, dropping_copy_types and undropped_manually_drops lints to drop_in_placeunfulfilled_lint_expectations no longer fires on #[expect(dead_code)] inside code that is covered by a dead parent’s diagnosticrepr(align) fields in a repr(packed) type into a deny-by-default lint aligned_fields_in_packedi686-pc-windows-gnu is now a tier 2 without host tools targetwasm32-wasip3 to Tier 2powerpc64-sony-ps3Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
ENOTSUP to ErrorKind::Unsupportedstd::sys::pal::sgx::waitqueue::unsafe_listimpl PartialEq<Cow<'_, [U]>> for Vec<T, A>impl PartialEq<Cow<'_, [U]>> for &[T]impl PartialEq<Cow<'_, [U]>> for &mut [T]std::alloc::Allocatorstd::alloc::Globalstd::alloc::Systemimpl Allocator for Globalimpl Allocator for Systemimpl<A: Allocator> Allocator for &Aimpl<T: Allocator, A: Allocator> Allocator for Box<T, A>impl<A: Allocator> Allocator for &mut Aimpl<T: Allocator, A: Allocator> Allocator for Arc<T, A>impl<T: Allocator, A: Allocator> Allocator for Rc<T, A>Box::new_inBox::from_raw_inBox::from_non_null_inBox::into_raw_with_allocatorBox::into_non_null_with_allocatorBox::allocatorVec::new_inVec::with_capacity_inVec::from_raw_parts_inVec::from_parts_inVec::into_raw_parts_with_allocatorVec::into_parts_with_allocatorVec::allocatorChild::main_thread_handleimpl Default for std::sync::Oncebool::toggleBox::takeBox::mapRc::mapArc::mapimpl AsRef<T> for !impl AsMut<T> for !core::mem::DropGuardcore::mem::conjure_zstUnsafeCell::replaceUnsafeCell::as_ref_uncheckedUnsafeCell::as_mut_uncheckedstr::trim_prefixstr::trim_suffix[T]::trim_prefix[T]::trim_suffixPath::trim_prefixVec::from_fnos::windows::process::CommandExt::show_window[lints.cargo] table. This includes a new built-in unused dependency check via the cargo::unused_dependencies lint. docs #17298Cargo.lock. (RFC 3923) docs #17335.crate tarball by default. --locked in cargo install becomes a no-op. #17388if let. This may cause new errorsInfallible is now a type alias to !! on all editionsbox patterns are no longer syntactically allowedstr::escape_debugmacro_rules expr metavariable groupingIterator::{min,max}(_by_key) changed which Ord methods they use. This cannot change behaviour (other than being potentially faster) for types correctly following the Ord rules, but may impact types with inconsistent trait implementations.VFPv3-D32 FPU as a minimum, as they erroneously had the d32 feature in their baseline list of features. Breakage introduced as a result of correcting this can be fixed by passing -Ctarget-feature=+d32 to Rust.ambiguous_glob_imported_traits lint fire in slightly more cases+fix-cortex-a53-835769 a default feature for aarch64-unknown-fuchsiaBox have been generalised to arbitrary allocators, which may cause new type inference errors-Ctarget-feature/-Ctarget-cpu values that would alter the ABI are rejected as hard errors now.wcslen on UEFI and embedded targetsbool return values on x86_64libLLVM on macOSraw_borrows_via_references lint that checks for references that decay immediately into raw borrowsunconditional_panic lint to function calls that panic when the chunks/windows size is zero#[unsafe(naked)] functions to define C-variadic functions (#![feature(c_variadic_naked_functions)]).Sized#[my_macro] mod foo;. This allows outlined modules (mod foo;) anywhere in the body of a custom attribute or derive macro.overflowing_literals lint with repeated negation. For instance, it will now no longer lint on --128_i8, which is already detected by the arithmetic_overflow lint.invalid_runtime_symbol_definitions and suspicious_runtime_symbol_definitions lints#[path] attributes on inline modulesunreachable_cfg_select_predicates lint as part of unused lint groupasm! on x86UnsafeCell can be accessed without going through get
global_asm!doc attribute is used on a macro invocation-Ctarget-cpu into a target-modifier for AVR, AMDGCN and NVPTXstatic_position_independent_executables on all gnu targetsRefer to Rust’s platform support page for more information on Rust’s tiered platform support.
RangeInclusive (a..=b ranges) is now optimized better in some circumstances. As a side effect of this, the behavior of RangeInclusive values that has already been exhausted (as an iterator) has changed. For example, the return values of start() and end() on such ranges may return different values, and using such ranges as slice indexes may have different behavior. These behaviors were not guaranteed to be stable, so these changes are considered to not be breaking changes.transmute_copy to accept ?Sized typestransmute_copy to use a non-unwinding panicescape_debug_extcore::fmt::NumBuffer in alloc (and std)IntoIterator for Box<[T; N]>IntoIterator for &Box<[T; N]>IntoIterator for &mut Box<[T; N]>VecDeque::retain_backcore::ffi::VaListBox::into_non_nullBox::from_non_nullVec::into_partsVec::from_partscore::mem::size_of_val_rawcore::mem::align_of_val_rawcore::alloc::Layout::for_value_rawString::from_utf8_lossy_ownedstring::FromUtf8Error::into_utf8_lossyFusedIterator for StepBy<I>std::fs::set_timesstd::fs::set_times_nofollow<LocalKey<Cell<T>>>::updatedebug. This is a preparation for transitioning the dev profile away from debugging to give a saner default for faster development iterations. Currently there is no difference between dev and debug profiles. docs #17214default-features field. For example, serde = { workspace = true, default-features = false } now turns off default features even when the workspace definition enables them. On earlier editions, default-features = false is ignored with a warning. (RFC 3945) #17126See also the full Cargo changelog
unused_footnote_definition rustdoc lintstd::i32::MAX should be accessed via i32::MAX instead.no_mangle_generic_items into hard errorPin::new_unchecked has had its safety invariants changed slightlylet patterns typecheckunsupported() instead of from_raw_os_error(22)#[repr(simd)] was accidentally allowed on macro invocations on stable RustBox::leak: tell people to avoid unleakingdoc(cfg()) into account when filtering doctests'staticsemicolon_in_expressions_from_non_local_macros) even when the macro comes from another crate. Previously, such warnings only appeared for macros from the same crate, to avoid showing warnings that can’t be fixed locally; however, this masked problems, as integration tests from the crate providing the macro get compiled as a separate crate, so tests often wouldn’t reveal this issue. If you encounter a lint like this, please make sure to report it to the crate providing the macro so they can fix it; don’t just silence it in your own crate.
CI environment variable. #17220These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
&mut when unsize-coercing, even in an invariant position. For example, you can now coerce a Cell<&'long mut i32> to a Cell<&'short mut dyn Send>. Such shortenings were already previously allowed when coercing a &mut to a &, or coercing a & to a &.invalid_runtime_symbol_definitions lint and warn-by-default suspicious_runtime_symbol_definitions lint
core runtime symbols like memcmp, memset, strlen, … and is planned to be expanded in the next few releases.c_void_returns lint to check core::ffi::c_void as a return typepowerpc64-unknown-linux-gnuelfv2 as Tier 3aarch64-unknown-linux-pauthtest as Tier 3 targetthumbv7a-none-eabi to Tier 2thumbv7a-none-eabihf to Tier 2thumbv7r-none-eabi to Tier 2thumbv7r-none-eabihf to Tier 2thumbv8r-none-eabihf to Tier 2Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
Location<'_> lifetime to 'static in Panic[Hook]InfoRangeInclusive::from(legacy::RangeInclusive)ManuallyDrop’s Box interaction has been fixedderive macro is available at {core,std}::derive. This was previously unintentionally stabilized in 1.96, but is now explicitly accepted as a stabilized API.
{core,std}::derive will be 1.96, and not 1.98.str::substr_range[T]::subslice_rangecore::fmt::NumBuffer<{integer}>::format_intoSend/Sync for std::process::CommandArgs{fN}::algebraic_add{fN}::algebraic_sub{fN}::algebraic_mul{fN}::algebraic_div{fN}::algebraic_remNonZero<{integer}>::from_str_radixString::from_utf16leString::from_utf16le_lossyString::from_utf16beString::from_utf16be_lossy[T]::strip_circumfixstr::strip_circumfixAtomic<T>::from_mutAtomic<T>::get_mut_sliceAtomic<T>::from_mut_slicestd::range::legacybool::ok_orbool::ok_or_elseOption::map_or_defaultResult::map_or_defaultBox::as_ptrBox::as_mut_ptrPath::is_emptyPathBuf::into_stringarch::{arm,aarch64}::vdot*: NEON dot product intrinsicsambiguous_glob_imports lint into a hard errorType = Type and Type == Type are no longer syntactically allowedrepr(transparent) is now more strict about which fields have “trivial” layout and hence can be ignored: repr(C) types, types with private fields, and #[non_exhaustive] types are no longer considered “trivial”transmute() when some repr attributes are involved.derive(PartialOrd) when deriving Ord
This can break crates in practice where a type’s PartialOrd and Ord impls were inconsistent with each other.assert_eq and assert_nePartialEq implementation, when a derive(PartialEq) implementation for that type also exists.-Zemscripten-wasm-eh=false flag to switch back to JS exceptions has been removed.File::lock implementation, it has the wrong semantics (return “unsupported” instead)cfg_select!
This may cause more code to be formatted which was previously ignored.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_packedcore::arch::aarch64::__jcvtThese 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_h