← Back to all releases

Rust 1.74.0

Released on November 16, 2023

What's Changed

Full Changelog

Language

--------

- Codify that std::mem::Discriminant does not depend on any lifetimes in T

- Replace private_in_public lint with private_interfaces and private_bounds per RFC 2145.

Read more in RFC 2145.

- Allow explicit #[repr(Rust)]

- closure field capturing: don't depend on alignment of packed fields

- Enable MIR-based drop-tracking for async blocks

- Stabilize impl_trait_projections

Compiler

--------

- stabilize combining +bundle and +whole-archive link modifiers

- Stabilize PATH option for --print KIND=PATH

- Enable ASAN/LSAN/TSAN for *-apple-ios-macabi

- Promote loongarch64-unknown-none* to Tier 2

- Add i686-pc-windows-gnullvm as a tier 3 target

Libraries

---------

- Implement From for ChildStdin/out/err

- Implement From<{&,&mut} [T; N]> for Vec where T: Clone

- impl Step for IP addresses

- Implement From<[T; N]> for Rc<[T]> and Arc<[T]>

- impl TryFrom for u16

- Stabilize io_error_other feature

- Stabilize the Saturating type

- Stabilize const_transmute_copy

Stabilized APIs

---------------

- core::num::Saturating

- impl From for std::process::Stdio

- impl From for std::process::Stdio

- impl From for std::process::Child{Stdin, Stdout, Stderr}

- impl From for std::process::Child{Stdin, Stdout, Stderr}

- std::ffi::OsString::from_encoded_bytes_unchecked

- std::ffi::OsString::into_encoded_bytes

- std::ffi::OsStr::from_encoded_bytes_unchecked

- std::ffi::OsStr::as_encoded_bytes

- std::io::Error::other

- impl TryFrom for u16

- impl From<&[T; N]> for Vec

- impl From<&mut [T; N]> for Vec

- impl From<[T; N]> for Arc<[T]>

- impl From<[T; N]> for Rc<[T]>

These APIs are now stable in const contexts:

- core::mem::transmute_copy

- str::is_ascii

- [u8]::is_ascii

Cargo

-----

- In Cargo.toml, stabilize [lints]

- Stabilize credential-process and registry-auth

- Stabilize --keep-going build flag

- Add styling to --help output

- For cargo clean, add --dry-run flag and summary line at the end

- For cargo update, make --package more convenient by being positional

- For cargo update, clarify meaning of --aggressive as --recursive

- Add '-n' as an alias for --dry-run

- Allow version-prefixes in pkgid's (e.g. --package flags) to resolve ambiguities

- In .cargo/config.toml, merge lists in precedence order

- Add support for target.'cfg(..)'.linker

Rustdoc

-------

- Add warning block support in rustdoc

- rustdoc-search: add support for type parameters

- rustdoc: show inner enum and struct in type definition for concrete type

Compatibility Notes

-------------------

- Raise minimum supported Apple OS versions

- make Cell::swap panic if the Cells partially overlap

- Reject invalid crate names in --extern

- Don't resolve generic impls that may be shadowed by dyn built-in impls

- The new impl From<{&,&mut} [T; N]> for Vec is known to cause some inference failures with overly-generic code. In those examples using the tui crate, the combination of AsRef<_> and Into leaves the middle type ambiguous, and the new impl adds another possibility, so it now requires an explicit type annotation.

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.

None this cycle.