Rust Changelog

What's new in Rust 1.77.0

Mar 21, 2024
  • Language:
  • Reveal opaque types within the defining body for exhaustiveness checking.
  • Stabilize C-string literals.
  • Stabilize THIR unsafeck.
  • Add lint static_mut_refs to warn on references to mutable statics.
  • Support async recursive calls (as long as they have indirection).
  • Undeprecate lint unstable_features and make use of it in the compiler.
  • Make inductive cycles in coherence ambiguous always.
  • Get rid of type-driven traversal in const-eval interning, only as a future compatiblity lint for now.
  • Deny braced macro invocations in let-else.
  • Compiler:
  • Include lint soft_unstable in future breakage reports.
  • Make i128 and u128 16-byte aligned on x86-based targets.
  • Use --verbose in diagnostic output.
  • Improve spacing between printed tokens.
  • Merge the unused_tuple_struct_fields lint into dead_code.
  • Error on incorrect implied bounds in well-formedness check, with a temporary exception for Bevy.
  • Fix coverage instrumentation/reports for non-ASCII source code.
  • Fix fn/const items implied bounds and well-formedness check.
  • Promote riscv32{im|imafc}-unknown-none-elf targets to tier 2.
  • Add several new tier 3 targets:
  • aarch64-unknown-illumos
  • hexagon-unknown-none-elf
  • riscv32imafc-esp-espidf
  • riscv32im-risc0-zkvm-elf

New in Rust 1.76.0 (Feb 13, 2024)

  • Language:
  • Document Rust ABI compatibility between various types
  • Also: guarantee that char and u32 are ABI-compatible
  • Add lint ambiguous_wide_pointer_comparisons that supersedes clippy::vtable_address_comparisons
  • Compiler:
  • Lint pinned #[must_use] pointers (in particular, Box<T> where T is #[must_use]) in unused_must_use.
  • Soundness fix: fix computing the offset of an unsized field in a packed struct
  • Soundness fix: fix dynamic size/align computation logic for packed types with dyn Trait tail
  • Add $message_type field to distinguish json diagnostic outputs
  • Enable Rust to use the EHCont security feature of Windows
  • Add tier 3 {x86_64,i686}-win7-windows-msvc targets
  • Add tier 3 aarch64-apple-watchos target
  • Add tier 3 arm64e-apple-ios & arm64e-apple-darwin targets
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Add a column number to dbg!()
  • Add std::hash::{DefaultHasher, RandomState} exports
  • Fix rounding issue with exponents in fmt
  • Add T: ?Sized to RwLockReadGuard and RwLockWriteGuard's Debug impls.
  • Windows: Allow File::create to work on hidden files
  • Stabilized APIs:
  • Arc::unwrap_or_clone
  • Rc::unwrap_or_clone
  • Result::inspect
  • Result::inspect_err
  • Option::inspect
  • type_name_of_val
  • std::hash::{DefaultHasher, RandomState} These were previously available only through std::collections::hash_map.
  • ptr::{from_ref, from_mut}
  • ptr::addr_eq
  • Cargo:
  • See Cargo release notes.
  • Rustdoc:
  • Don't merge cfg and doc(cfg) attributes for re-exports
  • rustdoc: allow resizing the sidebar / hiding the top bar
  • rustdoc-search: add support for traits and associated types
  • rustdoc: Add highlighting for comments in items declaration
  • Compatibility Notes:
  • Add allow-by-default lint for unit bindings This is expected to be upgraded to a warning by default in a future Rust release. Some macros emit bindings with type () with user-provided spans, which means that this lint will warn for user code.
  • Remove x86_64-sun-solaris target.
  • Remove asmjs-unknown-emscripten target
  • Report errors in jobserver inherited through environment variables This may warn on benign problems too.
  • Update the minimum external LLVM to 16.
  • Improve print_tts This change can break some naive manual parsing of token trees in proc macro code which expect a particular structure after .to_string(), rather than just arbitrary Rust code.
  • Make IMPLIED_BOUNDS_ENTAILMENT into a hard error from a lint
  • Vec's allocation behavior was changed when collecting some iterators Allocation behavior is currently not specified, nevertheless changes can be surprising. See impl FromIterator for Vec for more details.
  • Properly reject default on free const items

New in Rust 1.75.0 (Dec 28, 2023)

  • Language:
  • Stabilize async fn and return-position impl Trait in traits.
  • Allow function pointer signatures containing &mut T in const contexts.
  • Match usize/isize exhaustively with half-open ranges.
  • Guarantee that char has the same size and alignment as u32.
  • Document that the null pointer has the 0 address.
  • Allow partially moved values in match.
  • Add notes about non-compliant FP behavior on 32bit x86 targets.
  • Stabilize ratified RISC-V target features.
  • Compiler:
  • Rework negative coherence to properly consider impls that only partly overlap.
  • Bump COINDUCTIVE_OVERLAP_IN_COHERENCE to deny, and warn in dependencies.
  • Consider alias bounds when computing liveness in NLL.
  • Add the V (vector) extension to the riscv64-linux-android target spec.
  • Automatically enable cross-crate inlining for small functions
  • Add several new tier 3 targets:
  • csky-unknown-linux-gnuabiv2hf
  • i586-unknown-netbsd
  • mipsel-unknown-netbsd
  • Libraries:
  • Override Waker::clone_from to avoid cloning Wakers unnecessarily.
  • Implement BufRead for VecDeque<u8>.
  • Implement FusedIterator for DecodeUtf16 when the inner iterator does.
  • Implement Not, Bit{And,Or}{,Assign} for IP addresses.
  • Implement Default for ExitCode.
  • Guarantee representation of None in NPO
  • Document when atomic loads are guaranteed read-only.
  • Broaden the consequences of recursive TLS initialization.
  • Windows: Support sub-millisecond sleep.
  • Fix generic bound of str::SplitInclusive's DoubleEndedIterator impl
  • Fix exit status / wait status on non-Unix cfg(unix) platforms.
  • Stabilized APIs:
  • Atomic*::from_ptr
  • FileTimes
  • FileTimesExt
  • File::set_modified
  • File::set_times
  • IpAddr::to_canonical
  • Ipv6Addr::to_canonical
  • Option::as_slice
  • Option::as_mut_slice
  • pointer::byte_add
  • pointer::byte_offset
  • pointer::byte_offset_from
  • pointer::byte_sub
  • pointer::wrapping_byte_add
  • pointer::wrapping_byte_offset
  • pointer::wrapping_byte_sub
  • These APIs are now stable in const contexts:
  • Ipv6Addr::to_ipv4_mapped
  • MaybeUninit::assume_init_read
  • MaybeUninit::zeroed
  • mem::discriminant
  • mem::zeroed
  • Cargo:
  • Add new packages to [workspace.members] automatically.
  • Allow version-less Cargo.toml manifests.
  • Make browser links out of HTML file paths.
  • Rustdoc:
  • Accept less invalid Rust in rustdoc.
  • Document lack of object safety on affected traits.
  • Hide #[repr(transparent)] if it isn't part of the public ABI.
  • Show enum discriminant if it is a C-like variant.
  • Compatibility Notes:
  • FreeBSD targets now require at least version 12.
  • Formally demote tier 2 MIPS targets to tier 3.
  • Make misalignment a hard error in const contexts.
  • Fix detecting references to packed unsized fields.
  • Remove support for compiler plugins.
  • 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.
  • Optimize librustc_driver.so with BOLT.
  • Enable parallel rustc front end in dev and nightly builds.
  • Distribute rustc-codegen-cranelift as rustup component on the nightly channel.

New in Rust 1.74.0 (Nov 16, 2023)

  • Codify that `std::mem::Discriminant<T>` does not depend on any lifetimes in T
  • Replace `private_in_public` lint with `private_interfaces` and `private_bounds` per 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`

New in Rust 1.73.0 (Oct 6, 2023)

  • Language:
  • Uplift clippy::fn_null_check lint as useless_ptr_null_checks.
  • Make noop_method_call warn by default.
  • Support interpolated block for try and async in macros.
  • Make unconditional_recursion lint detect recursive drops.
  • Future compatibility warning for some impls being incorrectly considered not overlapping.
  • The invalid_reference_casting lint is now deny-by-default (instead of allow-by-default)
  • Compiler:
  • Write version information in a .comment section like GCC/Clang.
  • Add documentation on v0 symbol mangling.
  • Stabilize extern "thiscall" and "thiscall-unwind" ABIs.
  • Only check outlives goals on impl compared to trait.
  • Infer type in irrefutable slice patterns with fixed length as array.
  • Discard default auto trait impls if explicit ones exist.
  • Add several new tier 3 targets:
  • aarch64-unknown-teeos
  • csky-unknown-linux-gnuabiv2
  • riscv64-linux-android
  • riscv64gc-unknown-hermit
  • x86_64-unikraft-linux-musl
  • x86_64-unknown-linux-ohos
  • Add wasm32-wasi-preview1-threads as a tier 2 target.
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Add Read, Write and Seek impls for Arc<File>.
  • Merge functionality of io::Sink into io::Empty.
  • Implement RefUnwindSafe for Backtrace
  • Make ExitStatus implement Default
  • impl SliceIndex<str> for (Bound<usize>, Bound<usize>)
  • Change default panic handler message format.
  • Cleaner assert_eq! & assert_ne! panic messages.
  • Correct the (deprecated) Android stat struct definitions.
  • Stabilized APIs:
  • Unsigned {integer}::div_ceil
  • Unsigned {integer}::next_multiple_of
  • Unsigned {integer}::checked_next_multiple_of
  • std::ffi::FromBytesUntilNulError
  • std::os::unix::fs::chown
  • std::os::unix::fs::fchown
  • std::os::unix::fs::lchown
  • LocalKey::<Cell<T>>::get
  • LocalKey::<Cell<T>>::set
  • LocalKey::<Cell<T>>::take
  • LocalKey::<Cell<T>>::replace
  • LocalKey::<RefCell<T>>::with_borrow
  • LocalKey::<RefCell<T>>::with_borrow_mut
  • LocalKey::<RefCell<T>>::set
  • LocalKey::<RefCell<T>>::take
  • LocalKey::<RefCell<T>>::replace
  • These APIs are now stable in const contexts:
  • rc::Weak::new
  • sync::Weak::new
  • NonNull::as_ref
  • Cargo:
  • Encode URL params correctly for SourceId in Cargo.lock.
  • Bail out an error when using cargo:: in custom build script.
  • Misc:
  • Compatibility Notes:
  • Update the minimum external LLVM to 15.
  • Check for non-defining uses of return position impl Trait.
  • 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.
  • Remove LLVM pointee types, supporting only opaque pointers.
  • Port PGO/LTO/BOLT optimized build pipeline to Rust.
  • Replace in-tree rustc_apfloat with the new version of the crate.
  • Update to LLVM 17.
  • Add internal_features lint for internal unstable features.
  • Mention style for new syntax in tracking issue template.

New in Rust 1.72.0 (Aug 25, 2023)

  • Language:
  • Replace const eval limit by a lint and add an exponential backoff warning
  • expand: Change how #![cfg(FALSE)] behaves on crate root
  • Stabilize inline asm for LoongArch64
  • Uplift clippy::undropped_manually_drops lint
  • Uplift clippy::invalid_utf8_in_unchecked lint
  • Uplift clippy::cast_ref_to_mut lint
  • Uplift clippy::cmp_nan lint
  • resolve: Remove artificial import ambiguity errors
  • Don't require associated types with Self: Sized bounds in dyn Trait objects
  • Compiler:
  • Remember names of cfg-ed out items to mention them in diagnostics
  • Support for native WASM exceptions
  • Add support for NetBSD/aarch64-be (big-endian arm64).
  • Write to stdout if - is given as output file
  • Force all native libraries to be statically linked when linking a static binary
  • Add Tier 3 support for loongarch64-unknown-none*
  • Prevent .eh_frame from being emitted for -C panic=abort
  • Support 128-bit enum variant in debuginfo codegen
  • compiler: update solaris/illumos to enable tsan support.
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Document memory orderings of thread::{park, unpark}
  • io: soften ‘at most one write attempt’ requirement in io::Write::write
  • Specify behavior of HashSet::insert
  • Relax implicit T: Sized bounds on BufReader<T>, BufWriter<T> and LineWriter<T>
  • Update runtime guarantee for select_nth_unstable
  • Return Ok on kill if process has already exited
  • Implement PartialOrd for Vecs over different allocators
  • Use 128 bits for TypeId hash
  • Don't drain-on-drop in DrainFilter impls of various collections.
  • Make {Arc,Rc,Weak}::ptr_eq ignore pointer metadata
  • Rustdoc:
  • Allow whitespace as path separator like double colon
  • Add search result item types after their name
  • Search for slices and arrays by type with []
  • Clean up type unification and "unboxing"
  • Stabilized APIs:
  • impl<T: Send> Sync for mpsc::Sender<T>
  • impl TryFrom<&OsStr> for &str
  • String::leak
  • These APIs are now stable in const contexts:
  • CStr::from_bytes_with_nul
  • CStr::to_bytes
  • CStr::to_bytes_with_nul
  • CStr::to_str
  • Cargo:
  • Enable -Zdoctest-in-workspace by default. When running each documentation test, the working directory is set to the root directory of the package the test belongs to. docs #12221 #12288
  • Add support of the "default" keyword to reset previously set build.jobs parallelism back to the default. #12222
  • Compatibility Notes:
  • Alter Display for Ipv6Addr for IPv4-compatible addresses
  • Cargo changed feature name validation check to a hard error. The warning was added in Rust 1.49. These extended characters aren't allowed on crates.io, so this should only impact users of other registries, or people who don't publish to a registry. #12291

New in Rust 1.71.1 (Aug 4, 2023)

  • Fix CVE-2023-38497: Cargo did not respect the umask when extracting dependencies
  • Fix bash completion for users of Rustup
  • Do not show suspicious_double_ref_op lint when calling borrow()
  • Fix ICE: substitute types before checking inlining compatibility
  • Fix ICE: don't use can_eq in derive(..) suggestion for missing method
  • Fix building Rust 1.71.0 from the source tarball

New in Rust 1.71.0 (Jul 13, 2023)

  • Language:
  • Stabilize raw-dylib, link_ordinal, import_name_type and -Cdlltool.
  • Uplift clippy::{drop,forget}_{ref,copy} lints.
  • Type inference is more conservative around constrained vars.
  • Use fulfillment to check Drop impl compatibility
  • Compiler:
  • Evaluate place expression in PlaceMention, making let _ = patterns more consistent with respect to the borrow checker.
  • Add --print deployment-target flag for Apple targets.
  • Stabilize extern "C-unwind" and friends. The existing extern "C" etc. may change behavior for cross-language unwinding in a future release.
  • Update the version of musl used on *-linux-musl targets to 1.2.3, enabling time64 on 32-bit systems.
  • Stabilize debugger_visualizer for embedding metadata like Microsoft's Natvis.
  • Enable flatten-format-args by default.
  • Make Self respect tuple constructor privacy.
  • Improve niche placement by trying two strategies and picking the better result.
  • Use apple-m1 as the target CPU for aarch64-apple-darwin.
  • Add Tier 3 support for the x86_64h-apple-darwin target.
  • Promote loongarch64-unknown-linux-gnu to Tier 2 with host tools.

New in Rust 1.70.0 (Jun 2, 2023)

  • Language:
  • Relax ordering rules for asm! operands
  • Properly allow macro expanded format_args invocations to uses captures
  • Lint ambiguous glob re-exports
  • Perform const and unsafe checking for expressions in let _ = expr position.
  • Compiler:
  • Extend -Cdebuginfo with new options and named aliases This provides a smaller version of debuginfo for cases that only need line number information (-Cdebuginfo=line-tables-only), which may eventually become the default for -Cdebuginfo=1.
  • Make unused_allocation lint against Box::new too
  • Detect uninhabited types early in const eval
  • Switch to LLD as default linker for {arm,thumb}v4t-none-eabi
  • Add tier 3 target loongarch64-unknown-linux-gnu
  • Add tier 3 target for i586-pc-nto-qnx700 (QNX Neutrino RTOS, version 7.0),
  • Insert alignment checks for pointer dereferences as debug assertions This catches undefined behavior at runtime, and may cause existing code to fail.
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Document NonZeroXxx layout guarantees
  • Windows: make Command prefer non-verbatim paths
  • Implement Default for some alloc/core iterators
  • Fix handling of trailing bare CR in str::lines
  • allow negative numeric literals in concat!
  • Add documentation about the memory layout of Cell
  • Use partial_cmp to implement tuple lt/le/ge/gt
  • Stabilize atomic_as_ptr
  • Stabilize nonnull_slice_from_raw_parts
  • Partial stabilization of once_cell
  • Stabilize nonzero_min_max
  • Flatten/inline format_args!() and (string and int) literal arguments into format_args!()
  • Stabilize movbe target feature
  • don't splice from files into pipes in io::copy
  • Add a builtin unstable FnPtr trait that is implemented for all function pointers This extends Debug, Pointer, Hash, PartialEq, Eq, PartialOrd, and Ord implementations for function pointers with all ABIs.
  • Stabilized APIs:
  • NonZero*::MIN/MAX
  • BinaryHeap::retain
  • Default for std::collections::binary_heap::IntoIter
  • Default for std::collections::btree_map::{IntoIter, Iter, IterMut}
  • Default for std::collections::btree_map::{IntoKeys, Keys}
  • Default for std::collections::btree_map::{IntoValues, Values}
  • Default for std::collections::btree_map::Range
  • Default for std::collections::btree_set::{IntoIter, Iter}
  • Default for std::collections::btree_set::Range
  • Default for std::collections::linked_list::{IntoIter, Iter, IterMut}
  • Default for std::vec::IntoIter
  • Default for std::iter::Chain
  • Default for std::iter::Cloned
  • Default for std::iter::Copied
  • Default for std::iter::Enumerate
  • Default for std::iter::Flatten
  • Default for std::iter::Fuse
  • Default for std::iter::Rev
  • Default for std::slice::Iter
  • Default for std::slice::IterMut
  • Rc::into_inner
  • Arc::into_inner
  • std::cell::OnceCell
  • Option::is_some_and
  • NonNull::slice_from_raw_parts
  • Result::is_ok_and
  • Result::is_err_and
  • std::sync::atomic::Atomic*::as_ptr
  • std::io::IsTerminal
  • std::os::linux::net::SocketAddrExt
  • std::os::unix::net::UnixDatagram::bind_addr
  • std::os::unix::net::UnixDatagram::connect_addr
  • std::os::unix::net::UnixDatagram::send_to_addr
  • std::os::unix::net::UnixListener::bind_addr
  • std::path::Path::as_mut_os_str
  • std::sync::OnceLock
  • Cargo:
  • Add CARGO_PKG_README
  • Make sparse the default protocol for crates.io
  • Accurately show status when downgrading dependencies
  • Use registry.default for login/logout
  • Stabilize cargo logout
  • Misc:
  • Stabilize rustdoc --test-run-directory
  • Compatibility Notes:
  • Prevent stable libtest from supporting -Zunstable-options
  • Perform const and unsafe checking for expressions in let _ = expr position.
  • WebAssembly targets enable sign-ext and mutable-globals features in codegen This may cause incompatibility with older execution environments.
  • Insert alignment checks for pointer dereferences as debug assertions This catches undefined behavior at runtime, and may cause existing code to fail.
  • 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.
  • Upgrade to LLVM 16
  • Use SipHash-1-3 instead of SipHash-2-4 for StableHasher

New in Rust 1.69.0 (Apr 20, 2023)

  • Language:
  • Deriving built-in traits on packed structs works with Copy fields.
  • Stabilize the cmpxchg16b target feature on x86 and x86_64.
  • Improve analysis of trait bounds for associated types.
  • Allow associated types to be used as union fields.
  • Allow Self: Autotrait bounds on dyn-safe trait methods.
  • Treat str as containing [u8] for auto trait purposes.
  • Compiler:
  • Upgrade *-pc-windows-gnu on CI to mingw-w64 v10 and GCC 12.2.
  • Rework min_choice algorithm of member constraints.
  • Support true and false as boolean flags in compiler arguments.
  • Default repr(C) enums to c_int size.
  • Libraries:
  • Implement the unstable DispatchFromDyn for cell types, allowing downstream experimentation with custom method receivers.
  • Document that fmt::Arguments::as_str() may return Some(_) in more cases after optimization, subject to change.
  • Implement AsFd and AsRawFd for Rc.
  • Stabilized APIs:
  • CStr::from_bytes_until_nul
  • Core::ffi::FromBytesUntilNulError
  • These APIs are now stable in const contexts:
  • SocketAddr::new
  • SocketAddr::ip
  • SocketAddr::port
  • SocketAddr::is_ipv4
  • SocketAddr::is_ipv6
  • SocketAddrV4::new
  • SocketAddrV4::ip
  • SocketAddrV4::port
  • SocketAddrV6::new
  • SocketAddrV6::ip
  • SocketAddrV6::port
  • SocketAddrV6::flowinfo
  • SocketAddrV6::scope_id
  • Cargo:
  • Cargo now suggests cargo fix or cargo clippy --fix when compilation warnings are auto-fixable.
  • Cargo now suggests cargo add if you try to install a library crate.
  • Cargo now sets the CARGO_BIN_NAME environment variable also for binary examples.
  • Rustdoc:
  • Vertically compact trait bound formatting.
  • Only include stable lints in rustdoc::all group.
  • Compute maximum Levenshtein distance based on the query.
  • Remove inconsistently-present sidebar tooltips.
  • Search by macro when query ends with !.
  • Compatibility Notes:
  • The rust-analysis component from rustup now only contains a warning placeholder. This was primarily intended for RLS, and the corresponding -Zsave-analysis flag has been removed from the compiler as well.
  • Unaligned references to packed fields are now a hard error. This has been a warning since 1.53, and denied by default with a future-compatibility warning since 1.62.
  • Update the minimum external LLVM to 14.
  • Cargo now emits errors on invalid characters in a registry token.
  • When default-features is set to false of a workspace dependency, and an inherited dependency of a member has default-features = true, Cargo will enable default features of that dependency.
  • Cargo denies CARGO_HOME in the [env] configuration table. Cargo itself doesn't pick up this value, but recursive calls to cargo would, which was not intended.
  • Debuginfo for build dependencies is now off if not explicitly set. This is expected to improve the overall build time.
  • 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.
  • Move format_args!() into AST (and expand it during AST lowering)

New in Rust 1.68.2 (Mar 28, 2023)

  • Update the GitHub RSA host key bundled within Cargo. The key was rotated by GitHub on 2023-03-24 after the old one leaked.
  • Mark the old GitHub RSA host key as revoked. This will prevent Cargo from accepting the leaked key even when trusted by the system.
  • Add support for @revoked and a better error message for @cert-authority in Cargo's SSH host key verification

New in Rust 1.68.0 (Mar 9, 2023)

  • Language:
  • Stabilize default_alloc_error_handler This allows usage of alloc on stable without requiring the definition of a handler for allocation failure. Defining custom handlers is still unstable.
  • Stabilize efiapi calling convention.
  • Remove implicit promotion for types with drop glue
  • Compiler:
  • Change bindings_with_variant_name to deny-by-default
  • Allow .. to be parsed as let initializer
  • Add armv7-sony-vita-newlibeabihf as a tier 3 target
  • Always check alignment during compile-time const evaluation
  • Disable "split dwarf inlining" by default.
  • Add vendor to Fuchsia's target triple
  • Enable sanitizers for s390x-linux
  • Libraries:
  • Loosen the bound on the Debug implementation of Weak.
  • Make std::task::Context !Send and !Sync
  • PhantomData layout guarantees
  • Don't derive Debug for OnceWith & RepeatWith
  • Implement DerefMut for PathBuf
  • Add O(1) Vec -> VecDeque conversion guarantee
  • Leak amplification for peek_mut() to ensure BinaryHeap's invariant is always met
  • Stabilized APIs:
  • {core,std}::pin::pin!
  • impl From<bool> for {f32,f64}
  • std::path::MAIN_SEPARATOR_STR
  • impl DerefMut for PathBuf
  • These APIs are now stable in const contexts:
  • VecDeque::new
  • Cargo:
  • Stabilize sparse registry support for crates.io
  • cargo build --verbose tells you more about why it recompiles.
  • Show progress of crates.io index update even net.git-fetch-with-cli option enabled
  • Misc:
  • Compatibility Notes:
  • Add SEMICOLON_IN_EXPRESSIONS_FROM_MACROS to future-incompat report
  • Only specify --target by default for -Zgcc-ld=lld on wasm
  • Bump IMPLIED_BOUNDS_ENTAILMENT to Deny + ReportNow
  • std::task::Context no longer implements Send and Sync
  • 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.
  • Encode spans relative to the enclosing item
  • Don't normalize in AstConv
  • Find the right lower bound region in the scenario of partial order relations
  • Fix impl block in const expr
  • Check ADT fields for copy implementations considering regions
  • rustdoc: simplify JS search routine by not messing with lev distance
  • Enable ThinLTO for rustc on x86_64-pc-windows-msvc
  • Enable ThinLTO for rustc on x86_64-apple-darwin

New in Rust 1.67.0 (Jan 26, 2023)

  • Language:
  • Make Sized predicates coinductive, allowing cycles.
  • #[must_use] annotations on async fn also affect the Future::Output.
  • Elaborate supertrait obligations when deducing closure signatures.
  • Invalid literals are no longer an error under cfg(FALSE).
  • Unreserve braced enum variants in value namespace.
  • Compiler:
  • Enable varargs support for calling conventions other than C or cdecl.
  • Add new MIR constant propagation based on dataflow analysis.
  • Optimize field ordering by grouping m*2^n-sized fields with equivalently aligned ones.
  • Stabilize native library modifier verbatim.
  • Added and removed targets:
  • Add a tier 3 target for PowerPC on AIX, powerpc64-ibm-aix.
  • Add a tier 3 target for the Sony PlayStation 1, mipsel-sony-psx.
  • Add tier 3 no_std targets for the QNX Neutrino RTOS, aarch64-unknown-nto-qnx710 and x86_64-pc-nto-qnx710.
  • Remove tier 3 linuxkernel targets (not used by the actual kernel).
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Merge crossbeam-channel into std::sync::mpsc.
  • Fix inconsistent rounding of 0.5 when formatted to 0 decimal places.
  • Derive Eq and Hash for ControlFlow.
  • Don't build compiler_builtins with -C panic=abort.
  • Stabilized APIs:
  • {integer}::checked_ilog
  • {integer}::checked_ilog2
  • {integer}::checked_ilog10
  • {integer}::ilog
  • {integer}::ilog2
  • {integer}::ilog10
  • NonZeroU*::ilog2
  • NonZeroU*::ilog10
  • NonZero*::BITS
  • These APIs are now stable in const contexts:
  • char::from_u32
  • char::from_digit
  • char::to_digit
  • core::char::from_u32
  • core::char::from_digit
  • Compatibility Notes:
  • The layout of repr(Rust) types now groups m*2^n-sized fields with equivalently aligned ones. This is intended to be an optimization, but it is also known to increase type sizes in a few cases for the placement of enum tags. As a reminder, the layout of repr(Rust) types is an implementation detail, subject to change.
  • 0.5 now rounds to 0 when formatted to 0 decimal places. This makes it consistent with the rest of floating point formatting that rounds ties toward even digits.
  • Chains of && and || will now drop temporaries from their sub-expressions in evaluation order, left-to-right. Previously, it was "twisted" such that the first expression dropped its temporaries last, after all of the other expressions dropped in order.
  • Underscore suffixes on string literals are now a hard error. This has been a future-compatibility warning since 1.20.0.
  • Stop passing -export-dynamic to wasm-ld.
  • main is now mangled as __main_void on wasm32-wasi.
  • Cargo now emits an error if there are multiple registries in the configuration with the same index URL.
  • 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.
  • Rewrite LLVM's archive writer in Rust.

New in Rust 1.66.0 (Dec 15, 2022)

  • Language:
  • Permit specifying explicit discriminants on all repr(Int) enums
  • Allow transmutes between the same type differing only in lifetimes
  • Change constant evaluation errors from a deny-by-default lint to a hard error
  • Trigger must_use on impl Trait for supertraits This makes impl ExactSizeIterator respect the existing #[must_use] annotation on Iterator.
  • Allow ..=X in patterns
  • Uplift clippy::for_loops_over_fallibles lint into rustc
  • Stabilize sym operands in inline assembly
  • Update to Unicode 15
  • Opaque types no longer imply lifetime bounds This is a soundness fix which may break code that was erroneously relying on this behavior.
  • Compiler:
  • Add armv5te-none-eabi and thumbv5te-none-eabi tier 3 targets
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Add support for linking against macOS universal libraries
  • Libraries:
  • Fix #[derive(Default)] on a generic #[default] enum adding unnecessary Default bounds
  • Update to Unicode 15
  • Stabilized APIs:
  • proc_macro::Span::source_text
  • uX::{checked_add_signed, overflowing_add_signed, saturating_add_signed, wrapping_add_signed}
  • iX::{checked_add_unsigned, overflowing_add_unsigned, saturating_add_unsigned, wrapping_add_unsigned}
  • iX::{checked_sub_unsigned, overflowing_sub_unsigned, saturating_sub_unsigned, wrapping_sub_unsigned}
  • BTreeSet::{first, last, pop_first, pop_last}
  • BTreeMap::{first_key_value, last_key_value, first_entry, last_entry, pop_first, pop_last}
  • Add AsFd implementations for stdio lock types on WASI.
  • impl TryFrom<Vec<T>> for Box<[T; N]>
  • core::hint::black_box
  • Duration::try_from_secs_{f32,f64}
  • Option::unzip
  • std::os::fd
  • Rustdoc:
  • Add Rustdoc warning for invalid HTML tags in the documentation
  • Cargo:
  • Added cargo remove to remove dependencies from Cargo.toml
  • cargo publish now waits for the new version to be downloadable before exiting
  • 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.
  • Enable BOLT for LLVM compilation
  • Enable LTO for rustc_driver.so

New in Rust 1.65.0 (Nov 3, 2022)

  • Language:
  • Error on as casts of enums with #[non_exhaustive] variants
  • Stabilize let else
  • Stabilize generic associated types (GATs)
  • Add lints let_underscore_drop, let_underscore_lock, and let_underscore_must_use from Clippy
  • Stabilize breaking from arbitrary labeled blocks ("label-break-value")
  • Uninitialized integers, floats, and raw pointers are now considered immediate UB. Usage of MaybeUninit is the correct way to work with uninitialized memory.
  • Stabilize raw-dylib for Windows x86_64, aarch64, and thumbv7a
  • Do not allow Drop impl on foreign ADTs
  • Compiler:
  • Stabilize -Csplit-debuginfo on Linux
  • Use niche-filling optimization even when multiple variants have data
  • Associated type projections are now verified to be well-formed prior to resolving the underlying type
  • Stringify non-shorthand visibility correctly
  • Normalize struct field types when unsizing
  • Update to LLVM 15
  • Fix aarch64 call abi to correctly zeroext when needed
  • Debuginfo: Generalize C++-like encoding for enums
  • Add special_module_name lint
  • Add support for generating unique profraw files by default when using -C instrument-coverage
  • Allow dynamic linking for iOS/tvOS targets
  • New targets:
  • Add armv4t-none-eabi as a tier 3 target
  • Add powerpc64-unknown-openbsd and riscv64-unknown-openbsd as tier 3 targets
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Don't generate PartialEq::ne in derive(PartialEq)
  • Windows RNG: Use BCRYPT_RNG_ALG_HANDLE by default
  • Forbid mixing System with direct system allocator calls
  • Document no support for writing to non-blocking stdio/stderr
  • Std::layout::Layout size must not overflow isize::MAX when rounded up to align This also changes the safety conditions on Layout::from_size_align_unchecked.
  • Stabilized APIs:
  • Std::backtrace::Backtrace
  • Bound::as_ref
  • Std::io::read_to_string
  • <*const T>::cast_mut
  • <*mut T>::cast_const
  • These APIs are now stable in const contexts:
  • <*const T>::offset_from
  • <*mut T>::offset_from
  • Cargo:
  • Apply GitHub fast path even for partial hashes
  • Do not add home bin path to PATH if it's already there
  • Take priority into account within the pending queue. This slightly optimizes job scheduling by Cargo, with typically small improvements on larger crate graph builds.
  • Compatibility Notes:
  • Std::layout::Layout size must not overflow isize::MAX when rounded up to align. This also changes the safety conditions on Layout::from_size_align_unchecked.
  • PollFn now only implements Unpin if the closure is Unpin. This is a possible breaking change if users were relying on the blanket unpin implementation. See discussion on the PR for details of why this change was made.
  • Drop ExactSizeIterator impl from std::char::EscapeAscii This is a backwards-incompatible change to the standard library's surface area, but is unlikely to affect real world usage.
  • Do not consider a single repeated lifetime eligible for elision in the return type This behavior was unintentionally changed in 1.64.0, and this release reverts that change by making this an error again.
  • Reenable disabled early syntax gates as future-incompatibility lints
  • Update the minimum external LLVM to 13
  • Don't duplicate file descriptors into stdio fds
  • Sunset RLS
  • Deny usage of #![cfg_attr(..., crate_type = ...)] to set the crate type This strengthens the forward compatibility lint deprecated_cfg_attr_crate_type_name to deny.
  • Llvm-has-rust-patches allows setting the build system to treat the LLVM as having Rust-specific patches This option may need to be set for distributions that are building Rust with a patched LLVM via llvm-config, not the built-in LLVM.
  • 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.
  • Add x.sh and x.ps1 shell scripts
  • Compiletest: use target cfg instead of hard-coded tables
  • Use object instead of LLVM for reading bitcode from rlibs
  • Enable MIR inlining for optimized compilations This provides a 3-10% improvement in compiletimes for real world crates. See perf results.

New in Rust 1.63.0 (Aug 11, 2022)

  • Language:
  • Remove migrate borrowck mode for pre-NLL errors.
  • Modify MIR building to drop repeat expressions with length zero.
  • Remove label/lifetime shadowing warnings.
  • Allow explicit generic arguments in the presence of impl Trait args.
  • Make cenum_impl_drop_cast warnings deny-by-default.
  • Prevent unwinding when -C panic=abort is used regardless of declared ABI.
  • Lub: don't bail out due to empty binders.
  • Compiler:
  • Stabilize the bundle native library modifier, also removing the deprecated static-nobundle linking kind.
  • Add Apple WatchOS compile targets*.
  • Add a Windows application manifest to rustc-main.
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Implement Copy, Clone, PartialEq and Eq for core::fmt::Alignment.
  • Extend ptr::null and null_mut to all thin (including extern) types.
  • Impl Read and Write for VecDeque<u8>.
  • STD support for the Nintendo 3DS.
  • Make write/print macros eagerly drop temporaries.
  • Implement internal traits that enable [OsStr]::join.
  • Implement Hash for core::alloc::Layout.
  • Add capacity documentation for OsString.
  • Put a bound on collection misbehavior.
  • Make std::mem::needs_drop accept ?Sized.
  • Impl Termination for Infallible and then make the Result impls of Termination more generic.
  • Document Rust's stance on /proc/self/mem.
  • Stabilized APIs:
  • Array::from_fn
  • Box::into_pin
  • BinaryHeap::try_reserve
  • BinaryHeap::try_reserve_exact
  • OsString::try_reserve
  • OsString::try_reserve_exact
  • PathBuf::try_reserve
  • PathBuf::try_reserve_exact
  • Path::try_exists
  • Ref::filter_map
  • RefMut::filter_map
  • NonNull::<[T]>::len
  • ToOwned::clone_into
  • Ipv6Addr::to_ipv4_mapped
  • Unix::io::AsFd
  • Unix::io::BorrowedFd<'fd>
  • Unix::io::OwnedFd
  • Windows::io::AsHandle
  • Windows::io::BorrowedHandle<'handle>
  • Windows::io::OwnedHandle
  • Windows::io::HandleOrInvalid
  • Windows::io::HandleOrNull
  • Windows::io::InvalidHandleError
  • Windows::io::NullHandleError
  • Windows::io::AsSocket
  • Windows::io::BorrowedSocket<'handle>
  • Windows::io::OwnedSocket
  • Thread::scope
  • Thread::Scope
  • Thread::ScopedJoinHandle
  • These APIs are now usable in const contexts:
  • Array::from_ref
  • Slice::from_ref
  • Intrinsics::copy
  • Intrinsics::copy_nonoverlapping
  • <*const T>::copy_to
  • <*const T>::copy_to_nonoverlapping
  • <*mut T>::copy_to
  • <*mut T>::copy_to_nonoverlapping
  • <*mut T>::copy_from
  • <*mut T>::copy_from_nonoverlapping
  • Str::from_utf8
  • Utf8Error::error_len
  • Utf8Error::valid_up_to
  • Condvar::new
  • Mutex::new
  • RwLock::new
  • Cargo:
  • Stabilize the --config path command-line argument.
  • Expose rust-version in the environment as CARGO_PKG_RUST_VERSION.

New in Rust 1.62.0 (Jul 1, 2022)

  • Language:
  • Stabilize #[derive(Default)] on enums with a #[default] variant
  • Stop validating some checks in dead code after functions with uninhabited return types
  • Fix constants not getting dropped if part of a diverging expression
  • Support unit struct/enum variant in destructuring assignment
  • Remove mutable_borrow_reservation_conflict lint and allow the code pattern
  • Compiler:
  • linker: Stop using whole-archive on dependencies of dylibs
  • Make unaligned_references lint deny-by-default This lint is also a future compatibility lint, and is expected to eventually become a hard error.
  • Only add codegen backend to dep info if -Zbinary-dep-depinfo is used
  • Reject #[thread_local] attribute on non-static items
  • Add tier 3 aarch64-pc-windows-gnullvm and x86_64-pc-windows-gnullvm targets*
  • Implement a lint to warn about unused macro rules
  • Promote x86_64-unknown-none target to Tier 2*
  • Libraries:
  • Windows: Use a pipe relay for chaining pipes
  • Replace Linux Mutex and Condvar with futex based ones.
  • Replace RwLock by a futex based one on Linux
  • std: directly use pthread in UNIX parker implementation
  • Stabilized APIs:
  • bool::then_some
  • f32::total_cmp
  • f64::total_cmp
  • Stdin::lines
  • windows::CommandExt::raw_arg
  • impl<T: Default> Default for AssertUnwindSafe<T>
  • From<Rc<str>> for Rc<[u8]>
  • From<Arc<str>> for Arc<[u8]>
  • FusedIterator for EncodeWide
  • RDM intrinsics on aarch64
  • Clippy:
  • Create clippy lint against unexpectedly late drop for temporaries in match scrutinee expressions
  • Cargo:
  • Added the cargo add command for adding dependencies to Cargo.toml from the command-line. docs
  • Package ID specs now support name@version syntax in addition to the previous name:version to align with the behavior in cargo add and other tools. cargo install and cargo yank also now support this syntax so the version does not need to passed as a separate flag.
  • The git and registry directories in Cargo's home directory (usually ~/.cargo) are now marked as cache directories so that they are not included in backups or content indexing (on Windows).
  • Added automatic @ argfile support, which will use "response files" if the command-line to rustc exceeds the operating system's limit.
  • Compatibility Notes:
  • cargo test now passes --target to rustdoc if the specified target is the same as the host target. #10594
  • rustdoc: Remove .woff font files
  • Enforce Copy bounds for repeat elements while considering lifetimes
  • Internal Changes:
  • Unify ReentrantMutex implementations across all platforms

New in Rust 1.60.0 (Apr 7, 2022)

  • Language:
  • Stabilize #[cfg(panic = "...")] for either "unwind" or "abort".
  • Stabilize #[cfg(target_has_atomic = "...")] for each integer size and "ptr".
  • Compiler:
  • Enable combining +crt-static and relocation-model=pic on x86_64-unknown-linux-gnu
  • Fixes wrong unreachable_pub lints on nested and glob public reexport
  • Stabilize -Z instrument-coverage as -C instrument-coverage
  • Stabilize -Z print-link-args as --print link-args
  • Add new Tier 3 target mips64-openwrt-linux-musl*
  • Add new Tier 3 target armv7-unknown-linux-uclibceabi (softfloat)*
  • Fix invalid removal of newlines from doc comments
  • Add kernel target for RustyHermit
  • Deny mixing bin crate type with lib crate types
  • Make rustc use RUST_BACKTRACE=full by default
  • Upgrade to LLVM 14
  • * Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries
  • Guarantee call order for sort_by_cached_key
  • Improve Duration::try_from_secs_f32/f64 accuracy by directly processing exponent and mantissa
  • Make Instant::{duration_since, elapsed, sub} saturating
  • Remove non-monotonic clocks workarounds in Instant::now
  • Make BuildHasherDefault, iter::Empty and future::Pending covariant
  • Stabilized APIs:
  • Arc::new_cyclic
  • Rc::new_cyclic
  • slice::EscapeAscii
  • <[u8]>::escape_ascii
  • u8::escape_ascii
  • Vec::spare_capacity_mut
  • MaybeUninit::assume_init_drop
  • MaybeUninit::assume_init_read
  • i8::abs_diff
  • i16::abs_diff
  • i32::abs_diff
  • i64::abs_diff
  • i128::abs_diff
  • isize::abs_diff
  • u8::abs_diff
  • u16::abs_diff
  • u32::abs_diff
  • u64::abs_diff
  • u128::abs_diff
  • usize::abs_diff
  • Display for io::ErrorKind
  • From<u8> for ExitCode
  • Not for ! (the "never" type)
  • OpAssign<$t> for Wrapping<$t>
  • arch::is_aarch64_feature_detected!
  • Cargo:
  • Port cargo from toml-rs to toml_edit
  • Stabilize -Ztimings as --timings
  • Stabilize namespaced and weak dependency features.
  • Accept more cargo:rustc-link-arg-* types from build script output.
  • cargo-new should not add ignore rule on Cargo.lock inside subdirs
  • Misc:
  • Ship docs on Tier 2 platforms by reusing the closest Tier 1 platform docs
  • Drop rustc-docs from complete profile
  • bootstrap: tidy up flag handling for llvm build
  • Compatibility Notes:
  • Remove compiler-rt linking hack on Android
  • Mitigations for platforms with non-monotonic clocks have been removed from Instant::now. On platforms that don't provide monotonic clocks, an instant is not guaranteed to be greater than an earlier instant anymore.
  • Instant::{duration_since, elapsed, sub} do not panic anymore on underflow, saturating to 0 instead. In the real world the panic happened mostly on platforms with buggy monotonic clock implementations rather than catching programming errors like reversing the start and end times. Such programming errors will now results in 0 rather than a panic.
  • In a future release we're planning to increase the baseline requirements for the Linux kernel to version 3.2, and for glibc to version 2.17. We'd love your feedback in PR #95026.

New in Rust 1.59.0 (Feb 24, 2022)

  • Fix many cases of normalization-related ICEs
  • Replace dominators algorithm with simple Lengauer-Tarjan
  • Store liveness in interval sets for region inference
  • Remove in_band_lifetimes from the compiler and standard library, in preparation for removing this unstable feature.

New in Rust 1.58.0 (Jan 13, 2022)

  • Language:
  • Format strings can now capture arguments simply by writing {ident} in the string. This works in all macros accepting format strings. Support for this in panic! (panic!("{ident}")) requires the 2021 edition; panic invocations in previous editions that appear to be trying to use this will result in a warning lint about not having the intended effect.
  • const T pointers can now be dereferenced in const contexts.
  • The rules for when a generic struct implements Unsize have been relaxed.
  • Compiler:
  • Add LLVM CFI support to the Rust compiler
  • Stabilize -Z strip as -C strip. Note that while release builds already don't add debug symbols for the code you compile, the compiled standard library that ships with Rust includes debug symbols, so you may want to use the strip option to remove these symbols to produce smaller release binaries. Note that this release only includes support in rustc, not directly in cargo.
  • Add support for LLVM coverage mapping format versions 5 and 6
  • Emit LLVM optimization remarks when enabled with -Cremark
  • Update the minimum external LLVM to 12
  • Add x86_64-unknown-none at Tier 3*
  • Build musl dist artifacts with debuginfo enabled. When building release binaries using musl, you may want to use the newly stabilized strip option to remove these debug symbols, reducing the size of your binaries.
  • Don't abort compilation after giving a lint error
  • Error messages point at the source of trait bound obligations in more places
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • All remaining functions in the standard library have #[must_use] annotations where appropriate, producing a warning when ignoring their return value. This helps catch mistakes such as expecting a function to mutate a value in place rather than return a new value.
  • Paths are automatically canonicalized on Windows for operations that support it
  • Re-enable debug checks for copy and copy_nonoverlapping
  • Implement RefUnwindSafe for Rc<T>
  • Make RSplit<T, P>: Clone not require T: Clone
  • Implement Termination for Result<Infallible, E>. This allows writing fn main() -> Result<Infallible, ErrorType>, for a program whose successful exits never involve returning from main (for instance, a program that calls exit, or that uses exec to run another program).
  • Stabilized APIs:
  • Metadata::is_symlink
  • Path::is_symlink
  • {integer}::saturating_div
  • Option::unwrap_unchecked
  • Result::unwrap_unchecked
  • Result::unwrap_err_unchecked
  • NonZero{unsigned}::is_power_of_two
  • File::options
  • These APIs are now usable in const contexts:
  • Duration::new
  • Duration::checked_add
  • Duration::saturating_add
  • Duration::checked_sub
  • Duration::saturating_sub
  • Duration::checked_mul
  • Duration::saturating_mul
  • Duration::checked_div
  • MaybeUninit::as_ptr
  • MaybeUninit::as_mut_ptr
  • MaybeUninit::assume_init
  • MaybeUninit::assume_init_ref
  • Cargo:
  • Add --message-format for install command
  • Warn when alias shadows external subcommand
  • Rustdoc:
  • Show all Deref implementations recursively in rustdoc
  • Use computed visibility in rustdoc
  • Compatibility Notes:
  • Try all stable method candidates first before trying unstable ones. This change ensures that adding new nightly-only methods to the Rust standard library will not break code invoking methods of the same name from traits outside the standard library.
  • Windows: std::process::Command will no longer search the current directory for executables.
  • All proc-macro backward-compatibility lints are now deny-by-default.
  • proc_macro: Append .0 to unsuffixed float if it would otherwise become int token
  • Refactor weak symbols in std::sys::unix. This optimizes accesses to glibc functions, by avoiding the use of dlopen. This does not increase the minimum expected version of glibc. However, software distributions that use symbol versions to detect library dependencies, and which take weak symbols into account in that analysis, may detect rust binaries as requiring newer versions of glibc.
  • rustdoc now rejects some unexpected semicolons in doctests
  • Internal Changes:
  • These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
  • Implement coherence checks for negative trait impls
  • Add rustc lint, warning when iterating over hashmaps
  • Optimize live point computation
  • Enable verification for 1/32nd of queries loaded from disk
  • Implement version of normalize_erasing_regions that allows for normalization failure

New in Rust 1.57.0 (Dec 2, 2021)

  • Language:
  • Macro attributes may follow #[derive] and will see the original (pre-cfg) input.
  • Accept curly-brace macros in expressions, like m!{ .. }.method() and m!{ .. }?.
  • Allow panicking in constant evaluation.
  • Compiler:
  • Create more accurate debuginfo for vtables.
  • Add armv6k-nintendo-3ds at Tier 3*.
  • Add armv7-unknown-linux-uclibceabihf at Tier 3*.
  • Add m68k-unknown-linux-gnu at Tier 3*.
  • Add SOLID targets at Tier 3*: aarch64-kmc-solid_asp3, armv7a-kmc-solid_asp3-eabi, armv7a-kmc-solid_asp3-eabihf
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Avoid allocations and copying in Vec::leak
  • Add #[repr(i8)] to Ordering
  • Optimize File::read_to_end and read_to_string
  • Update to Unicode 14.0
  • Many more functions are marked #[must_use], producing a warning when ignoring their return value. This helps catch mistakes such as expecting a function to mutate a value in place rather than return a new value.
  • Stabilised APIs:
  • [T; N]::as_mut_slice
  • [T; N]::as_slice
  • collections::TryReserveError
  • HashMap::try_reserve
  • HashSet::try_reserve
  • String::try_reserve
  • String::try_reserve_exact
  • Vec::try_reserve
  • Vec::try_reserve_exact
  • VecDeque::try_reserve
  • VecDeque::try_reserve_exact
  • Iterator::map_while
  • iter::MapWhile
  • proc_macro::is_available
  • Command::get_program
  • Command::get_args
  • Command::get_envs
  • Command::get_current_dir
  • CommandArgs
  • CommandEnvs
  • These APIs are now usable in const contexts:
  • hint::unreachable_unchecked
  • Cargo:
  • Stabilize custom profiles
  • Compatibility notes
  • Internal changes:
  • These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
  • Added an experimental backend for codegen with libgccjit.

New in Rust 1.56.0 (Oct 21, 2021)

  • Language:
  • The 2021 Edition is now stable. See the edition guide for more details.
  • The pattern in binding @ pattern can now also introduce new bindings.
  • Union field access is permitted in const fn.
  • Compiler:
  • Upgrade to LLVM 13.
  • Support memory, address, and thread sanitizers on aarch64-unknown-freebsd.
  • Allow specifying a deployment target version for all iOS targets
  • Warnings can be forced on with --force-warn. This feature is primarily intended for usage by cargo fix, rather than end users.
  • Promote aarch64-apple-ios-sim to Tier 2*.
  • Add powerpc-unknown-freebsd at Tier 3*.
  • Add riscv32imc-esp-espidf at Tier 3*.
  • Allow writing of incomplete UTF-8 sequences via stdout/stderr on Windows. The Windows console still requires valid Unicode, but this change allows splitting a UTF-8 character across multiple write calls. This allows, for instance, programs that just read and write data buffers (e.g. copying a file to stdout) without regard for Unicode or character boundaries.
  • Prefer AtomicU{64,128} over Mutex for Instant backsliding protection. For this use case, atomics scale much better under contention.
  • Implement Extend<(A, B)> for (Extend<A>, Extend<B>)
  • impl Default, Copy, Clone for std::io::Sink and std::io::Empty
  • impl From<[(K, V); N]> for all collections.
  • Remove P: Unpin bound on impl Future for Pin.
  • Treat invalid environment variable names as non-existent. Previously, the environment functions would panic if given a variable name with an internal null character or equal sign (=). Now, these functions will just treat such names as non-existent variables, since the OS cannot represent the existence of a variable with such a name.

New in Rust 1.55.0 (Sep 9, 2021)

  • Language:
  • You can now write open "from" range patterns (X..), which will start at X and will end at the maximum value of the integer.
  • You can now explicitly import the prelude of different editions through std::prelude (e.g. use std::prelude::rust_2021::*;).
  • Compiler:
  • Added tier 3* support for powerpc64le-unknown-freebsd.
  • * Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries
  • Updated std's float parsing to use the Eisel-Lemire algorithm. These improvements should in general provide faster string parsing of floats, no longer reject certain valid floating point values, and reduce the produced code size for non-stripped artifacts.
  • string::Drain now implements AsRef<str> and AsRef<[u8]>.
  • Stabilised APIs:
  • Bound::cloned
  • Drain::as_str
  • IntoInnerError::into_error
  • IntoInnerError::into_parts
  • MaybeUninit::assume_init_mut
  • MaybeUninit::assume_init_ref
  • MaybeUninit::write
  • array::map
  • ops::ControlFlow
  • x86::_bittest
  • x86::_bittestandcomplement
  • x86::_bittestandreset
  • x86::_bittestandset
  • x86_64::_bittest64
  • x86_64::_bittestandcomplement64
  • x86_64::_bittestandreset64
  • x86_64::_bittestandset64
  • Cargo:
  • Cargo will now deduplicate compiler diagnostics to the terminal when invoking rustc in parallel such as when using cargo test.
  • The package definition in cargo metadata now includes the "default_run" field from the manifest.
  • Added cargo d as an alias for cargo doc.
  • Added {lib} as formatting option for cargo tree to print the "lib_name" of packages.
  • Rustdoc:
  • Added "Go to item on exact match" search option.
  • The "Implementors" section on traits no longer shows redundant method definitions.
  • Trait implementations are toggled open by default. This should make the implementations more searchable by tools like CTRL+F in your browser.
  • Intra-doc links should now correctly resolve associated items (e.g. methods) through type aliases.
  • Traits which are marked with #[doc(hidden)] will no longer appear in the "Trait Implementations" section.

New in Rust 1.54.0 (Jul 29, 2021)

  • Language:
  • You can now use macros for values in built-in attribute macros. While a seemingly minor addition on its own, this enables a lot of powerful functionality when combined correctly. Most notably you can now include external documentation in your crate by writing the following.
  • #![doc = include_str!("README.md")]
  • You can also use this to include auto-generated modules:
  • #[path = concat!(env!("OUT_DIR"), "/generated.rs")] mod generated;
  • You can now cast between unsized slice types (and types which contain unsized slices) in const fn.
  • You can now use multiple generic lifetimes with impl Trait where the lifetimes don't explicitly outlive another. In code this means that you can now have impl Trait<'a, 'b> where as before you could only have impl Trait<'a, 'b> where 'b: 'a.
  • Compiler:
  • Rustc will now search for custom JSON targets in /lib/rustlib/<target-triple>/target.json where / is the "sysroot" directory. You can find your sysroot directory by running rustc --print sysroot.
  • Added wasm as a target_family for WebAssembly platforms.
  • You can now use #[target_feature] on safe functions when targeting WebAssembly platforms.
  • Improved debugger output for enums on Windows MSVC platforms.
  • Added tier 3* support for bpfel-unknown-none and bpfeb-unknown-none.
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Panic::panic_any will now #[track_caller].
  • Added OutOfMemory as a variant of io::ErrorKind.
  • Proc_macro::Literal now implements FromStr.
  • The implementations of vendor intrinsics in core::arch have been significantly refactored. The main user-visible changes are a 50% reduction in the size of libcore.rlib and stricter validation of constant operands passed to intrinsics. The latter is technically a breaking change, but allows Rust to more closely match the C vendor intrinsics API.
  • Stabilized APIs:
  • BTreeMap::into_keys
  • BTreeMap::into_values
  • HashMap::into_keys
  • HashMap::into_values
  • Arch::wasm32
  • VecDeque::binary_search
  • VecDeque::binary_search_by
  • VecDeque::binary_search_by_key
  • VecDeque::partition_point
  • Cargo:
  • Added the --prune <spec> option to cargo-tree to remove a package from the dependency graph.
  • Added the --depth option to cargo-tree to print only to a certain depth in the tree
  • Added the no-proc-macro value to cargo-tree --edges to hide procedural macro dependencies.
  • A new environment variable named CARGO_TARGET_TMPDIR is available. This variable points to a directory that integration tests and benches can use as a "scratchpad" for testing filesystem operations.
  • Compatibility Notes:
  • Mixing Option and Result via ? is no longer permitted in closures for inferred types.
  • Previously unsound code is no longer permitted where different constructors in branches could require different lifetimes.
  • As previously mentioned the std::arch instrinsics now uses stricter const checking than before and may reject some previously accepted code.
  • I128 multiplication on Cortex M0+ platforms currently unconditionally causes overflow when compiled with codegen-units = 1.

New in Rust 1.53.0 (Jun 17, 2021)

  • Language:
  • You can now use unicode for identifiers. This allows multilingual identifiers but still doesn't allow glyphs that are not considered characters such as ◆ or 🦀. More specifically you can now use any identifier that matches the UAX #31 "Unicode Identifier and Pattern Syntax" standard. This is the same standard as languages like Python, however Rust uses NFC normalization which may be different from other languages.
  • You can now specify "or patterns" inside pattern matches. Previously you could only use | (OR) on complete patterns. E.g.
  • Added the :pat_param macro_rules! matcher. This matcher has the same semantics as the :pat matcher. This is to allow :pat to change semantics to being a pattern fragment in a future edition.
  • Compiler:
  • Updated the minimum external LLVM version to LLVM 10.
  • Added Tier 3* support for the wasm64-unknown-unknown target.
  • Improved debuginfo for closures and async functions on Windows MSVC.
  • Libraries:
  • Abort messages will now forward to android_set_abort_message on Android platforms when available.
  • slice::IterMut<'_, T> now implements AsRef<[T]>
  • Arrays of any length now implement IntoIterator. Currently calling .into_iter() as a method on an array will return impl Iterator<Item=&T>, but this may change in a future edition to change Item to T. Calling IntoIterator::into_iter directly on arrays will provide impl Iterator<Item=T> as expected.
  • leading_zeros, and trailing_zeros are now available on all NonZero integer types.
  • {f32, f64}::from_str now parse and print special values (NaN, -0) according to IEEE RFC 754.
  • You can now index into slices using (Bound<usize>, Bound<usize>).
  • Add the BITS associated constant to all numeric types.

New in Rust 1.52.0 (May 6, 2021)

  • Language:
  • Added the unsafe_op_in_unsafe_fn lint, which checks whether the unsafe code in an unsafe fn is wrapped in a unsafe block. This lint is allowed by default, and may become a warning or hard error in a future edition.
  • You can now cast mutable references to arrays to a pointer of the same type as the element.
  • Compiler:
  • Upgraded the default LLVM to LLVM 12.
  • Added tier 3* support for the following targets:
  • s390x-unknown-linux-musl
  • riscv32gc-unknown-linux-musl & riscv64gc-unknown-linux-musl
  • powerpc-unknown-openbsd
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • OsString now implements Extend and FromIterator.
  • cmp::Reverse now has #[repr(transparent)] representation.
  • Arc<impl Error> now implements error::Error.
  • All integer division and remainder operations are now const.
  • Stabilised APIs:
  • Arguments::as_str
  • char::MAX
  • char::REPLACEMENT_CHARACTER
  • char::UNICODE_VERSION
  • char::decode_utf16
  • char::from_digit
  • char::from_u32_unchecked
  • char::from_u32
  • slice::partition_point
  • str::rsplit_once
  • str::split_once
  • The following previously stable APIs are now const.:
  • char::len_utf8
  • char::len_utf16
  • char::to_ascii_uppercase
  • char::to_ascii_lowercase
  • char::eq_ignore_ascii_case
  • u8::to_ascii_uppercase
  • u8::to_ascii_lowercase
  • u8::eq_ignore_ascii_case
  • Rustdoc:
  • Rustdoc lints are now treated as a tool lint, meaning that lints are now prefixed with rustdoc:: (e.g. #[warn(rustdoc::non_autolinks)]). Using the old style is still allowed, and will become a warning in a future release.
  • Rustdoc now supports argument files.
  • Rustdoc now generates smart punctuation for documentation.
  • You can now use "task lists" in Rustdoc Markdown.
  • Misc:
  • You can now pass multiple filters to tests. E.g. cargo test -- foo bar will run all tests that match foo and bar.
  • Rustup now distributes PDB symbols for the std library on Windows, allowing you to see std symbols when debugging.
  • Internal Only:
  • These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
  • Check the result cache before the DepGraph when ensuring queries
  • Try fast_reject::simplify_type in coherence before doing full check
  • Only store a LocalDefId in some HIR nodes
  • Store HIR attributes in a side table
  • Compatibility Notes:
  • Cargo build scripts are now forbidden from setting RUSTC_BOOTSTRAP.
  • Removed support for the x86_64-rumprun-netbsd target.
  • Deprecated the x86_64-sun-solaris target in favor of x86_64-pc-solaris.
  • Rustdoc now only accepts ,, , and t as delimiters for specifying languages in code blocks.
  • Rustc now catches more cases of pub_use_of_private_extern_crate
  • Changes in how proc macros handle whitespace may lead to panics when used with older proc-macro-hack versions. A cargo update should be sufficient to fix this in all cases.

New in Rust 1.51.0 (Mar 26, 2021)

  • Language:
  • You can now parameterize items such as functions, traits, and structs by constant values in addition to by types and lifetimes. Also known as "const generics" E.g. you can now write the following. Note: Only values of primitive integers, bool, or char types are currently permitted.
  • Compiler:
  • Added the -Csplit-debuginfo codegen option for macOS platforms. This option controls whether debug information is split across multiple files or packed into a single file. Note This option is unstable on other platforms.
  • Added tier 3* support for aarch64_be-unknown-linux-gnu, aarch64-unknown-linux-gnu_ilp32, and aarch64_be-unknown-linux-gnu_ilp32 targets.
  • Added tier 3 support for i386-unknown-linux-gnu and i486-unknown-linux-gnu targets.
  • The target-cpu=native option will now detect individual features of CPUs.
  • Libraries:
  • Box::downcast is now also implemented for any dyn Any + Send + Sync object.
  • str now implements AsMut<str>.
  • u64 and u128 now implement From<char>.
  • Error is now implemented for &T where T implements Error.
  • Poll::{map_ok, map_err} are now implemented for Poll<Option<Result<T, E>>>.
  • unsigned_abs is now implemented for all signed integer types.
  • io::Empty now implements io::Seek.
  • rc::Weak<T> and sync::Weak<T>'s methods such as as_ptr are now implemented for T: ?Sized types.
  • Stabilized APIs:
  • Arc::decrement_strong_count
  • Arc::increment_strong_count
  • Once::call_once_force
  • Peekable::next_if_eq
  • Peekable::next_if
  • Seek::stream_position
  • array::IntoIter
  • panic::panic_any
  • ptr::addr_of!
  • ptr::addr_of_mut!
  • slice::fill_with
  • slice::split_inclusive_mut
  • slice::split_inclusive
  • slice::strip_prefix
  • slice::strip_suffix
  • str::split_inclusive
  • sync::OnceState
  • task::Wake
  • Cargo:
  • Added the split-debuginfo profile option to control the -Csplit-debuginfo codegen option.
  • Added the resolver field to Cargo.toml to enable the new feature resolver and CLI option behavior. Version 2 of the feature resolver will try to avoid unifying features of dependencies where that unification could be unwanted. Such as using the same dependency with a std feature in a build scripts and proc-macros, while using the no-std feature in the final binary. See the Cargo book documentation for more information on the feature.
  • Rustdoc:
  • Rustdoc will now include documentation for methods available from nested Deref traits.
  • You can now provide a --default-theme flag which sets the default theme to use for documentation.
  • Various improvements to intra-doc links:
  • You can link to non-path primitives such as slice.
  • You can link to associated items.
  • You can now include generic parameters when linking to items, like Vec<T>.
  • Misc:
  • You can now pass --include-ignored to tests (e.g. with cargo test -- --include-ignored) to include testing tests marked #[ignore].

New in Rust 1.50.0 (Feb 12, 2021)

  • Language:
  • You can now use const values for x in [x; N] array expressions. This has been technically possible since 1.38.0, as it was unintentionally stabilized.
  • Assignments to ManuallyDrop<T> union fields are now considered safe.
  • Compiler:
  • Added tier 3* support for the armv5te-unknown-linux-uclibceabi target.
  • Added tier 3 support for the aarch64-apple-ios-macabi target.
  • The x86_64-unknown-freebsd is now built with the full toolset.
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • proc_macro::Punct now implements PartialEq<char>.
  • ops::{Index, IndexMut} are now implemented for fixed sized arrays of any length.
  • On Unix platforms, the std::fs::File type now has a "niche" of -1. This value cannot be a valid file descriptor, and now means Option<File> takes up the same amount of space as File.
  • Stabilized APIs:
  • bool::then
  • btree_map::Entry::or_insert_with_key
  • f32::clamp
  • f64::clamp
  • hash_map::Entry::or_insert_with_key
  • Ord::clamp
  • RefCell::take
  • slice::fill
  • UnsafeCell::get_mut
  • The following previously stable methods are now const:
  • IpAddr::is_ipv4
  • IpAddr::is_ipv6
  • Layout::size
  • Layout::align
  • Layout::from_size_align
  • pow for all integer types.
  • checked_pow for all integer types.
  • saturating_pow for all integer types.
  • wrapping_pow for all integer types.
  • next_power_of_two for all unsigned integer types.
  • checked_power_of_two for all unsigned integer types.
  • Cargo:
  • Added the [build.rustc-workspace-wrapper] option. This option sets a wrapper to execute instead of rustc, for workspace members only.
  • cargo:rerun-if-changed will now, if provided a directory, scan the entire contents of that directory for changes.
  • Added the --workspace flag to the cargo update command.
  • Misc:
  • The search results tab and the help button are focusable with keyboard in rustdoc.
  • Running tests will now print the total time taken to execute.
  • Compatibility Notes:
  • The compare_and_swap method on atomics has been deprecated. It's recommended to use the compare_exchange and compare_exchange_weak methods instead.
  • Changes in how TokenStreams are checked have fixed some cases where you could write unhygenic macro_rules! macros.
  • #![test] as an inner attribute is now considered unstable like other inner macro attributes, and reports an error by default through the soft_unstable lint.
  • Overriding a forbid lint at the same level that it was set is now a hard error.
  • Dropped support for all cloudabi targets.
  • You can no longer intercept panic! calls by supplying your own macro. It's recommended to use the #[panic_handler] attribute to provide your own implementation.
  • Semi-colons after item statements (e.g. struct Foo {};) now produce a warning.

New in Rust 1.49.0 (Dec 31, 2020)

  • Language:
  • Unions can now implement Drop, and you can now have a field in a union with ManuallyDrop<T>.
  • You can now cast uninhabited enums to integers.
  • You can now bind by reference and by move in patterns. This allows you to selectively borrow individual components of a type. E.g.
  • #[derive(Debug)]
  • struct Person {
  • name: String,
  • age: u8,
  • let person = Person {
  • name: String::from("Alice"),
  • age: 20,
  • // `name` is moved out of person, but `age` is referenced.
  • let Person { name, ref age } = person;
  • println!("{} {}", name, age);
  • Compiler:
  • Added tier 1* support for aarch64-unknown-linux-gnu.
  • Added tier 2 support for aarch64-apple-darwin.
  • Added tier 2 support for aarch64-pc-windows-msvc.
  • Added tier 3 support for mipsel-unknown-none.
  • Raised the minimum supported LLVM version to LLVM 9.
  • Output from threads spawned in tests is now captured.
  • Change os and vendor values to "none" and "unknown" for some targets
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • RangeInclusive now checks for exhaustion when calling contains and indexing.
  • ToString::to_string now no longer shrinks the internal buffer in the default implementation.
  • ops::{Index, IndexMut} are now implemented for fixed sized arrays of any length.
  • Stabilized APIs:
  • slice::select_nth_unstable
  • slice::select_nth_unstable_by
  • slice::select_nth_unstable_by_key
  • The following previously stable methods are now const.
  • Poll::is_ready
  • Poll::is_pending
  • Cargo:
  • Building a crate with cargo-package should now be independently reproducible.
  • cargo-tree now marks proc-macro crates.
  • Added CARGO_PRIMARY_PACKAGE build-time environment variable. This variable will be set if the crate being built is one the user selected to build, either with -p or through defaults.
  • You can now use glob patterns when specifying packages & targets.
  • Compatibility Notes:
  • Demoted i686-unknown-freebsd from host tier 2 to target tier 2 support.
  • Macros that end with a semi-colon are now treated as statements even if they expand to nothing.
  • Rustc will now check for the validity of some built-in attributes on enum variants. Previously such invalid or unused attributes could be ignored.
  • Leading whitespace is stripped more uniformly in documentation comments, which may change behavior. You read this post about the changes for more details.
  • Trait bounds are no longer inferred for associated types.
  • Internal Only:
  • These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
  • rustc's internal crates are now compiled using the initial-exec Thread Local Storage model.
  • Calculate visibilities once in resolve.
  • Added system to the llvm-libunwind bootstrap config option.
  • Added --color for configuring terminal color support to bootstrap.

New in Rust 1.48.0 (Nov 19, 2020)

  • Language:
  • The unsafe keyword is now syntactically permitted on modules. This is still rejected semantically, but can now be parsed by procedural macros.
  • Compiler:
  • Stabilised the -C link-self-contained=<yes|no> compiler flag. This tells rustc whether to link its own C runtime and libraries or to rely on a external linker to find them. (Supported only on windows-gnu, linux-musl, and wasi platforms.)
  • You can now use -C target-feature=+crt-static on linux-gnu targets. Note: If you're using cargo you must explicitly pass the --target flag.
  • Added tier 2* support for aarch64-unknown-linux-musl.
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • io::Write is now implemented for &ChildStdin &Sink, &Stdout, and &Stderr.
  • All arrays of any length now implement TryFrom<Vec<T>>.
  • The matches! macro now supports having a trailing comma.
  • Vec<A> now implements PartialEq<[B]> where A: PartialEq<B>.
  • The RefCell::{replace, replace_with, clone} methods now all use #[track_caller].
  • Stabilized APIs:
  • slice::as_ptr_range
  • slice::as_mut_ptr_range
  • VecDeque::make_contiguous
  • future::pending
  • future::ready
  • The following previously stable methods are now const fn's:
  • Option::is_some
  • Option::is_none
  • Option::as_ref
  • Result::is_ok
  • Result::is_err
  • Result::as_ref
  • Ordering::reverse
  • Ordering::then
  • Rustdoc:
  • You can now link to items in rustdoc using the intra-doc link syntax. E.g. /// Uses [`std::future`] will automatically generate a link to std::future's documentation. See "Linking to items by name" for more information.
  • You can now specify #[doc(alias = "<alias>")] on items to add search aliases when searching through rustdoc's UI.
  • Compatibility Notes:
  • Promotion of references to 'static lifetime inside const fn now follows the same rules as inside a fn body. In particular, &foo() will not be promoted to 'static lifetime any more inside const fns.
  • Associated type bindings on trait objects are now verified to meet the bounds declared on the trait when checking that they implement the trait.
  • When trait bounds on associated types or opaque types are ambiguous, the compiler no longer makes an arbitrary choice on which bound to use.
  • Fixed recursive nonterminals not being expanded in macros during pretty-print/reparse check. This may cause errors if your macro wasn't correctly handling recursive nonterminal tokens.
  • &mut references to non zero-sized types are no longer promoted.
  • rustc will now warn if you use attributes like #[link_name] or #[cold] in places where they have no effect.
  • Updated _mm256_extract_epi8 and _mm256_extract_epi16 signatures in arch::{x86, x86_64} to return i32 to match the vendor signatures.
  • mem::uninitialized will now panic if any inner types inside a struct or enum disallow zero-initialization.
  • #[target_feature] will now error if used in a place where it has no effect.
  • Foreign exceptions are now caught by catch_unwind and will cause an abort. Note: This behaviour is not guaranteed and is still considered undefined behaviour, see the catch_unwind documentation for further information.
  • Internal Only:
  • These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
  • Building rustc from source now uses ninja by default over make. You can continue building with make by setting ninja=false in your config.toml.
  • cg_llvm: fewer_names in uncached_llvm_type
  • Made ensure_sufficient_stack() non-generic

New in Rust 1.47.0 (Oct 8, 2020)

  • Language:
  • Closures will now warn when not used.
  • Compiler:
  • Stabilized the -C control-flow-guard codegen option, which enables Control Flow Guard for Windows platforms, and is ignored on other platforms.
  • Upgraded to LLVM 11.
  • Added tier 3* support for the thumbv4t-none-eabi target.
  • Upgrade the FreeBSD toolchain to version 11.4
  • RUST_BACKTRACE's output is now more compact.
  • * Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • CStr now implements Index<RangeFrom<usize>>.
  • Traits in std/core are now implemented for arrays of any length, not just those of length less than 33.
  • ops::RangeFull and ops::Range now implement Default.
  • panic::Location now implements Copy, Clone, Eq, Hash, Ord, PartialEq, and PartialOrd.
  • Stabilized APIs:
  • Ident::new_raw
  • Range::is_empty
  • RangeInclusive::is_empty
  • Result::as_deref
  • Result::as_deref_mut
  • Vec::leak
  • pointer::offset_from
  • f32::TAU
  • f64::TAU
  • The following previously stable APIs have now been made const.
  • The new method for all NonZero integers.
  • The checked_add,checked_sub,checked_mul,checked_neg, checked_shl, checked_shr, saturating_add, saturating_sub, and saturating_mul methods for all integers.
  • The checked_abs, saturating_abs, saturating_neg, and signum for all signed integers.
  • The is_ascii_alphabetic, is_ascii_uppercase, is_ascii_lowercase, is_ascii_alphanumeric, is_ascii_digit, is_ascii_hexdigit, is_ascii_punctuation, is_ascii_graphic, is_ascii_whitespace, and is_ascii_control methods for char and u8.
  • Cargo:
  • build-dependencies are now built with opt-level 0 by default. You can override this by setting the following in your Cargo.toml.
  • [profile.release.build-override]
  • opt-level = 3
  • cargo-help will now display man pages for commands rather just the --help text.
  • cargo-metadata now emits a test field indicating if a target has tests enabled.
  • workspace.default-members now respects workspace.exclude.
  • cargo-publish will now use an alternative registry by default if it's the only registry specified in package.publish.
  • Misc:
  • Added a help button beside Rustdoc's searchbar that explains rustdoc's type based search.
  • Added the Ayu theme to rustdoc.
  • Compatibility Notes:
  • Bumped the minimum supported Emscripten version to 1.39.20.
  • Fixed a regression parsing {} && false in tail expressions.
  • Added changes to how proc-macros are expanded in macro_rules! that should help to preserve more span information. These changes may cause compiliation errors if your macro was unhygenic or didn't correctly handle Delimiter::None.
  • Moved support for the CloudABI target to tier 3.
  • linux-gnu targets now require minimum kernel 2.6.32 and glibc 2.11.
  • Added the rustc-docs component. This allows you to install and read the documentation for the compiler internal APIs. (Currently only available for x86_64-unknown-linux-gnu.)
  • Internal Only:
  • Improved default settings for bootstrapping in x.py. You can read details about this change in the "Changes to x.py defaults" post on the Inside Rust blog.

New in Rust 1.46.0 (Aug 27, 2020)

  • Language:
  • if, match, and loop expressions can now be used in const functions.
  • Additionally you are now also able to coerce and cast to slices (&[T]) in const functions.
  • The #[track_caller] attribute can now be added to functions to use the function's caller's location information for panic messages.
  • Recursively indexing into tuples no longer needs parentheses. E.g. x.0.0 over (x.0).0.
  • mem::transmute can now be used in static and constants. Note You currently can't use mem::transmute in constant functions.
  • Compiler:
  • You can now use the cdylib target on Apple iOS and tvOS platforms.
  • Enabled static "Position Independent Executables" by default for x86_64-unknown-linux-musl.
  • Libraries:
  • mem::forget is now a const fn.
  • String now implements From<char>.
  • The leading_ones, and trailing_ones methods have been stabilised for all integer types.
  • vec::IntoIter<T> now implements AsRef<[T]>.
  • All non-zero integer types (NonZeroU8) now implement TryFrom for their zero-able equivalent (e.g. TryFrom<u8>).
  • &[T] and &mut [T] now implement PartialEq<Vec<T>>.
  • (String, u16) now implements ToSocketAddrs.
  • vec::Drain<'_, T> now implements AsRef<[T]>.
  • Stabilized APIs:
  • Option::zip
  • vec::Drain::as_slice
  • Cargo:
  • Added a number of new environment variables that are now available when compiling your crate.
  • CARGO_BIN_NAME and CARGO_CRATE_NAME Providing the name of the specific binary being compiled and the name of the crate.
  • CARGO_PKG_LICENSE The license from the manifest of the package.
  • CARGO_PKG_LICENSE_FILE The path to the license file.
  • Compatibility Notes:
  • The target configuration option abi_blacklist has been renamed to unsupported_abis. The old name will still continue to work.
  • Rustc will now warn if you have a C-like enum that implements Drop. This was previously accepted but will become a hard error in a future release.
  • Rustc will fail to compile if you have a struct with #[repr(i128)] or #[repr(u128)]. This representation is currently only allowed on enums.
  • Tokens passed to macro_rules! are now always captured. This helps ensure that spans have the correct information, and may cause breakage if you were relying on receiving spans with dummy information.
  • The InnoSetup installer for Windows is no longer available. This was a legacy installer that was replaced by a MSI installer a few years ago but was still being built.
  • {f32, f64}::asinh now returns the correct values for negative numbers.
  • Rustc will no longer accept overlapping trait implementations that only differ in how the lifetime was bound.
  • Rustc now correctly relates the lifetime of an existential associated type. This fixes some edge cases where rustc would erroneously allow you to pass a shorter lifetime than expected.
  • Rustc now dynamically links to libz (also called zlib) on Linux. The library will need to be installed for rustc to work, even though we expect it to be already available on most systems.
  • Tests annotated with #[should_panic] are broken on ARMv7 while running under QEMU.
  • Pretty printing of some tokens in procedural macros changed. The exact output returned by rustc's pretty printing is an unstable implementation detail: we recommend any macro relying on it to switch to a more robust parsing system.

New in Rust 1.45.2 (Aug 4, 2020)

  • Fix bindings in tuple struct patterns
  • Fix track_caller integration with trait objects

New in Rust 1.45.1 (Jul 31, 2020)

  • Fix const propagation with references.
  • rustfmt accepts rustfmt_skip in cfg_attr again.
  • Avoid spurious implicit region bound.
  • Install clippy on x.py install

New in Rust 1.45.0 (Jul 16, 2020)

  • Language:
  • Out of range float to int conversions using as has been defined as a saturating conversion. This was previously undefined behaviour, but you can use the {f64, f32}::to_int_unchecked methods to continue using the current behaviour, which may be desirable in rare performance sensitive situations.
  • mem::Discriminant<T> now uses T's discriminant type instead of always using u64.
  • Function like procedural macros can now be used in expression, pattern, and statement positions. This means you can now use a function-like procedural macro anywhere you can use a declarative (macro_rules!) macro.
  • Compiler:
  • You can now override individual target features through the target-feature flag. E.g. -C target-feature=+avx2 -C target-feature=+fma is now equivalent to -C target-feature=+avx2,+fma.
  • Added the force-unwind-tables flag. This option allows rustc to always generate unwind tables regardless of panic strategy.
  • Added the embed-bitcode flag. This codegen flag allows rustc to include LLVM bitcode into generated rlibs (this is on by default).
  • Added the tiny value to the code-model codegen flag.
  • Added tier 3 support* for the mipsel-sony-psp target.
  • Added tier 3 support for the thumbv7a-uwp-windows-msvc target.
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • net::{SocketAddr, SocketAddrV4, SocketAddrV6} now implements PartialOrd and Ord.
  • proc_macro::TokenStream now implements Default.
  • You can now use char with ops::{Range, RangeFrom, RangeFull, RangeInclusive, RangeTo} to iterate over a range of codepoints. E.g. you can now write the following;
  • OsString now implements FromStr.
  • The saturating_neg method as been added to all signed integer primitive types, and the saturating_abs method has been added for all integer primitive types.
  • Arc<T>, Rc<T> now implement From<Cow<'_, T>>, and Box now implements From<Cow> when T is [T: Copy], str, CStr, OsStr, or Path.
  • Box<[T]> now implements From<[T; N]>.
  • BitOr and BitOrAssign are implemented for all NonZero integer types.
  • The fetch_min, and fetch_max methods have been added to all atomic integer types.
  • The fetch_update method has been added to all atomic integer types.

New in Rust 1.44.0 (Jun 4, 2020)

  • Language:
  • You can now use async/.await with #[no_std] enabled.
  • Added the unused_braces lint.
  • Syntax-only changes:
  • Expansion-driven outline module parsing
  • These are still rejected semantically, so you will likely receive an error but these changes can be seen and parsed by macros and conditional compilation.
  • Compiler:
  • Rustc now respects the -C codegen-units flag in incremental mode. Additionally when in incremental mode rustc defaults to 256 codegen units.
  • Refactored catch_unwind, to have zero-cost unless unwinding is enabled and a panic is thrown.
  • Added tier 3* support for the aarch64-unknown-none and aarch64-unknown-none-softfloat targets.
  • Added tier 3 support for arm64-apple-tvos and x86_64-apple-tvos targets.
  • Libraries:
  • Special cased vec![] to map directly to Vec::new(). This allows vec![] to be able to be used in const contexts.
  • convert::Infallible now implements Hash.
  • OsString now implements DerefMut and IndexMut returning a &mut OsStr.
  • Unicode 13 is now supported.
  • String now implements From<&mut str>.
  • IoSlice now implements Copy.
  • Vec<T> now implements From<[T; N]>. Where N is at most 32.
  • proc_macro::LexError now implements fmt::Display and Error.
  • from_le_bytes, to_le_bytes, from_be_bytes, to_be_bytes, from_ne_bytes, and to_ne_bytes methods are now const for all integer types.
  • Stabilized APIs:
  • PathBuf::with_capacity
  • PathBuf::capacity
  • PathBuf::clear
  • PathBuf::reserve
  • PathBuf::reserve_exact
  • PathBuf::shrink_to_fit
  • f32::to_int_unchecked
  • f64::to_int_unchecked
  • Layout::align_to
  • Layout::pad_to_align
  • Layout::array
  • Layout::extend
  • Cargo:
  • Added the cargo tree command which will print a tree graph of your dependencies.
  • You can also display dependencies on multiple versions of the same crate with cargo tree -d (short for cargo tree --duplicates).
  • Misc
  • Rustdoc now allows you to specify --crate-version to have rustdoc include the version in the sidebar.
  • Compatibility Notes:
  • Rustc now correctly generates static libraries on Windows GNU targets with the .a extension, rather than the previous .lib.
  • Removed the -C no_integrated_as flag from rustc.
  • The file_name property in JSON output of macro errors now points the actual source file rather than the previous format of <NAME macros>. Note: this may not point a file that actually exists on the user's system.
  • The minimum required external LLVM version has been bumped to LLVM 8.
  • mem::{zeroed, uninitialised} will now panic when used with types that do not allow zero initialization such as NonZeroU8. This was previously a warning.
  • In 1.45.0 (the next release) converting a f64 to u32 using the as operator has been defined as a saturating operation. This was previously undefined behaviour, you can use the {f64, f32}::to_int_unchecked methods to continue using the current behaviour which may desirable in rare performance sensitive situations.
  • Internal Only:
  • These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
  • dep_graph Avoid allocating a set on when the number reads are small.
  • Replace big JS dict with JSON parsing.

New in Rust 1.43.1 (May 7, 2020)

  • Updated openssl-src to 1.1.1g for CVE-2020-1967.
  • Fixed the stabilization of AVX-512 features.
  • Fixed cargo package --list not working with unpublished dependencies.

New in Rust 1.43.0 (Apr 23, 2020)

  • Language:
  • Fixed using binary operations with &{number} (e.g. &1.0) not having the type inferred correctly.
  • Attributes such as #[cfg()] can now be used on if expressions.
  • Syntax only changes:
  • Allow type Foo: Ord syntactically.
  • Fuse associated and extern items up to defaultness.
  • Syntactically allow self in all fn contexts.
  • Merge fn syntax + cleanup item parsing.
  • item macro fragments can be interpolated into traits, impls, and extern blocks.
  • These are still rejected semantically, so you will likely receive an error but these changes can be seen and parsed by macros and conditional compilation.
  • Compiler:
  • You can now pass multiple lint flags to rustc to override the previous flags. For example; rustc -D unused -A unused-variables denies everything in the unused lint group except unused-variables which is explicitly allowed. However, passing rustc -A unused-variables -D unused denies everything in the unused lint group including unused-variables since the allow flag is specified before the deny flag (and therefore overridden).
  • rustc will now prefer your system MinGW libraries over its bundled libraries if they are available on windows-gnu.
  • rustc now buffers errors/warnings printed in JSON.
  • Libraries:
  • Arc<[T; N]>, Box<[T; N]>, and Rc<[T; N]>, now implement TryFrom<Arc<[T]>>,TryFrom<Box<[T]>>, and TryFrom<Rc<[T]>> respectively. Note These conversions are only available when N is 0..=32.
  • You can now use associated constants on floats and integers directly, rather than having to import the module. e.g. You can now write u32::MAX or f32::NAN with no imports.
  • u8::is_ascii is now const.
  • String now implements AsMut<str>.
  • Added the primitive module to std and core. This module reexports Rust's primitive types. This is mainly useful in macros where you want avoid these types being shadowed.
  • Relaxed some of the trait bounds on HashMap and HashSet.
  • string::FromUtf8Error now implements Clone + Eq.
  • Stabilized APIs:
  • Once::is_completed
  • f32::LOG10_2
  • f32::LOG2_10
  • f64::LOG10_2
  • f64::LOG2_10
  • iter::once_with
  • Cargo:
  • You can now set config [profile]s in your .cargo/config, or through your environment.
  • Cargo will now set CARGO_BIN_EXE_<name> pointing to a binary's executable path when running integration tests or benchmarks. <name> is the name of your binary as-is e.g. If you wanted the executable path for a binary named my-programyou would use env!("CARGO_BIN_EXE_my-program").
  • Misc:
  • Certain checks in the const_err lint were deemed unrelated to const evaluation, and have been moved to the unconditional_panic and arithmetic_overflow lints.
  • Compatibility Notes:
  • Having trailing syntax in the assert! macro is now a hard error. This has been a warning since 1.36.0.
  • Fixed Self not having the correctly inferred type. This incorrectly led to some instances being accepted, and now correctly emits a hard error.
  • Internal Only:
  • These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
  • All components are now built with opt-level=3 instead of 2.
  • Improved how rustc generates drop code.
  • Improved performance from #[inline]-ing certain hot functions.
  • traits: preallocate 2 Vecs of known initial size
  • Avoid exponential behaviour when relating types
  • Skip Drop terminators for enum variants without drop glue
  • Improve performance of coherence checks
  • Deduplicate types in the generator witness
  • Invert control in struct_lint_level.

New in Rust 1.41.0 (Jan 30, 2020)

  • Language:
  • You can now pass type parameters to foreign items when implementing traits. E.g. You can now write impl<T> From<Foo> for Vec<T> {}.
  • You can now arbitrarily nest receiver types in the self position. E.g. you can now write fn foo(self: Box<Box<Self>>) {}. Previously only Self, &Self, &mut Self, Arc<Self>, Rc<Self>, and Box<Self> were allowed.
  • You can now use any valid identifier in a format_args macro. Previously identifiers starting with an underscore were not allowed.
  • Visibility modifiers (e.g. pub) are now syntactically allowed on trait items and enum variants. These are still rejected semantically, but can be seen and parsed by procedural macros and conditional compilation.
  • Compiler:
  • Rustc will now warn if you have unused loop 'labels.
  • Removed support for the i686-unknown-dragonfly target.
  • Added tier 3 support* for the riscv64gc-unknown-linux-gnu target.
  • You can now pass an arguments file passing the @path syntax to rustc. Note that the format differs somewhat from what is found in other tooling; please see the documentation for more information.
  • You can now provide --extern flag without a path, indicating that it is available from the search path or specified with an -L flag.
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • The core::panic module is now stable. It was already stable through std.
  • NonZero* numerics now implement From<NonZero*> if it's a smaller integer width. E.g. NonZeroU16 now implements From<NonZeroU8>.
  • MaybeUninit<T> now implements fmt::Debug.
  • Stabilized APIs:
  • Result::map_or
  • Result::map_or_else
  • std::rc::Weak::weak_count
  • std::rc::Weak::strong_count
  • std::sync::Weak::weak_count
  • std::sync::Weak::strong_count
  • Cargo:
  • Cargo will now document all the private items for binary crates by default.
  • cargo-install will now reinstall the package if it detects that it is out of date.
  • Cargo.lock now uses a more git friendly format that should help to reduce merge conflicts.
  • You can now override specific dependencies's build settings E.g. [profile.dev.package.image] opt-level = 2 sets the image crate's optimisation level to 2 for debug builds. You can also use [profile.<profile>.build-override] to override build scripts and their dependencies.
  • Misc:
  • You can now specify edition in documentation code blocks to compile the block for that edition. E.g. edition2018 tells rustdoc that the code sample should be compiled the 2018 edition of Rust.
  • You can now provide custom themes to rustdoc with --theme, and check the current theme with --check-theme.
  • You can use #[cfg(doc)] to compile an item when building documentation.

New in Rust 1.40.0 (Dec 19, 2019)

  • Language:
  • You can now use tuple structs and tuple enum variant's constructors in const contexts. e.g.
  • pub struct Point(i32, i32);
  • const ORIGIN: Point = {
  • let constructor = Point;
  • constructor(0, 0)
  • You can now mark structs, enums, and enum variants with the #[non_exhaustive] attribute to indicate that there may be variants or fields added in the future. For example this requires adding a wild-card branch (_ => {}) to any match statements on a non-exhaustive enum. (RFC 2008)
  • You can now use function-like procedural macros in extern blocks and in type positions. e.g. type Generated = macro!();
  • Function-like and attribute procedural macros can now emit macro_rules! items, so you can now have your macros generate macros.
  • The meta pattern matcher in macro_rules! now correctly matches the modern attribute syntax. For example (#[$m:meta]) now matches #[attr], #[attr{tokens}], #[attr[tokens]], and #[attr(tokens)].
  • Compiler:
  • Added tier 3 support* for the thumbv7neon-unknown-linux-musleabihf target.
  • Added tier 3 support for the aarch64-unknown-none-softfloat target.
  • Added tier 3 support for the mips64-unknown-linux-muslabi64, and mips64el-unknown-linux-muslabi64 targets.
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries
  • The is_power_of_two method on unsigned numeric types is now a const function.
  • Stabilized APIs:
  • BTreeMap::get_key_value
  • HashMap::get_key_value
  • Option::as_deref_mut
  • Option::as_deref
  • Option::flatten
  • UdpSocket::peer_addr
  • f32::to_be_bytes
  • f32::to_le_bytes
  • f32::to_ne_bytes
  • f64::to_be_bytes
  • f64::to_le_bytes
  • f64::to_ne_bytes
  • f32::from_be_bytes
  • f32::from_le_bytes
  • f32::from_ne_bytes
  • f64::from_be_bytes
  • f64::from_le_bytes
  • f64::from_ne_bytes
  • mem::take
  • slice::repeat
  • todo!
  • Cargo:
  • Cargo will now always display warnings, rather than only on fresh builds.
  • Feature flags (except --all-features) passed to a virtual workspace will now produce an error. Previously these flags were ignored.
  • You can now publish dev-dependencies without including a version.
  • Misc:
  • You can now specify the #[cfg(doctest)] attribute to include an item only when running documentation tests with rustdoc.
  • Compatibility Notes:
  • As previously announced, any previous NLL warnings in the 2015 edition are now hard errors.
  • The include! macro will now warn if it failed to include the entire file. The include! macro unintentionally only includes the first expression in a file, and this can be unintuitive. This will become either a hard error in a future release, or the behavior may be fixed to include all expressions as expected.
  • Using #[inline] on function prototypes and consts now emits a warning under unused_attribute lint. Using #[inline] anywhere else inside traits or extern blocks now correctly emits a hard error.

New in Rust 1.39.0 (Nov 7, 2019)

  • Language:
  • You can now create async functions and blocks with async fn, async move {}, and async {} respectively, and you can now call .await on async expressions.
  • You can now use certain attributes on function, closure, and function pointer parameters. These attributes include cfg, cfg_attr, allow, warn, deny, forbid as well as inert helper attributes used by procedural macro attributes applied to items. e.g.
  • fn len(
  • #[cfg(windows)] slice: &[u16],
  • #[cfg(not(windows))] slice: &[u8],
  • ) -> usize {
  • slice.len()
  • You can now take shared references to bind-by-move patterns in the if guards of match arms. e.g.
  • fn main() {
  • let array: Box<[u8; 4]> = Box::new([1, 2, 3, 4]);
  • match array {
  • nums
  • // ---- `nums` is bound by move.
  • if nums.iter().sum::<u8>() == 10
  • // ^------ `.iter()` implicitly takes a reference to `nums`.
  • => {
  • drop(nums);
  • // ----------- Legal as `nums` was bound by move and so we have ownership.
  • _ => unreachable!(),
  • Compiler:
  • Added tier 3* support for the i686-unknown-uefi target.
  • Added tier 3 support for the sparc64-unknown-openbsd target.
  • rustc will now trim code snippets in diagnostics to fit in your terminal. Note Cargo currently doesn't use this feature. Refer to cargo#7315 to track this feature's progress.
  • You can now pass --show-output argument to test binaries to print the output of successful tests.
  • * Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Vec::new and String::new are now const functions.
  • LinkedList::new is now a const function.
  • str::len, [T]::len and str::as_bytes are now const functions.
  • The abs, wrapping_abs, and overflowing_abs numeric functions are now const.
  • Stabilized APIs:
  • Pin::into_inner
  • Instant::checked_duration_since
  • Instant::saturating_duration_since
  • Cargo:
  • You can now publish git dependencies if supplied with a version.
  • The --all flag has been renamed to --workspace. Using --all is now deprecated.
  • Misc:
  • You can now pass -Clinker to rustdoc to control the linker used for compiling doctests.
  • Compatibility Notes:
  • Code that was previously accepted by the old borrow checker, but rejected by the NLL borrow checker is now a hard error in Rust 2018. This was previously a warning, and will also become a hard error in the Rust 2015 edition in the 1.40.0 release.
  • rustdoc now requires rustc to be installed and in the same directory to run tests. This should improve performance when running a large amount of doctests.
  • The try! macro will now issue a deprecation warning. It is recommended to use the ? operator instead.
  • asinh(-0.0) now correctly returns -0.0. Previously this returned 0.0.

New in Rust 1.38.0 (Sep 26, 2019)

  • Language:
  • The #[global_allocator] attribute can now be used in submodules.
  • The #[deprecated] attribute can now be used on macros.
  • Compiler:
  • Added pipelined compilation support to rustc. This will improve compilation times in some cases. For further information please refer to the "Evaluating pipelined rustc compilation" thread.
  • Added tier 3 support for the aarch64-uwp-windows-msvc, i686-uwp-windows-gnu, i686-uwp-windows-msvc, x86_64-uwp-windows-gnu, and x86_64-uwp-windows-msvc targets.
  • Added tier 3 support for the armv7-unknown-linux-gnueabi and armv7-unknown-linux-musleabi targets.
  • Added tier 3 support for the hexagon-unknown-linux-musl target.
  • Added tier 3 support for the riscv32i-unknown-none-elf target.
  • Libraries:
  • ascii::EscapeDefault now implements Clone and Display.
  • Derive macros for prelude traits (e.g. Clone, Debug, Hash) are now available at the same path as the trait. (e.g. The Clone derive macro is available at std::clone::Clone). This also makes all built-in macros available in std/core root. e.g. std::include_bytes!.
  • str::Chars now implements Debug.
  • slice::{concat, connect, join} now accepts &[T] in addition to &T.
  • *const T and *mut T now implement marker::Unpin.
  • Arc<[T]> and Rc<[T]> now implement FromIterator<T>.
  • Added euclidean remainder and division operations (div_euclid, rem_euclid) to all numeric primitives. Additionally checked, overflowing, and wrapping versions are available for all integer primitives.
  • thread::AccessError now implements Clone, Copy, Eq, Error, and PartialEq.
  • iter::{StepBy, Peekable, Take} now implement DoubleEndedIterator.
  • Stabilized APIs:
  • <*const T>::cast
  • <*mut T>::cast
  • Duration::as_secs_f32
  • Duration::as_secs_f64
  • Duration::div_duration_f32
  • Duration::div_duration_f64
  • Duration::div_f32
  • Duration::div_f64
  • Duration::from_secs_f32
  • Duration::from_secs_f64
  • Duration::mul_f32
  • Duration::mul_f64
  • any::type_name
  • Cargo:
  • Added pipelined compilation support to cargo.
  • You can now pass the --features option multiple times to enable multiple features.
  • Misc:
  • rustc will now warn about some incorrect uses of mem::{uninitialized, zeroed} that are known to cause undefined behaviour.
  • Compatibility Notes:
  • The x86_64-unknown-uefi platform can not be built with rustc 1.38.0.
  • The armv7-unknown-linux-gnueabihf platform is known to have issues with certain crates such as libc.

New in Rust 1.37.0 (Aug 16, 2019)

  • Language:
  • #[must_use] will now warn if the type is contained in a tuple, Box, or an array and unused.
  • You can now use the cfg and cfg_attr attributes on generic parameters.
  • You can now use enum variants through type alias. e.g. You can write the following:
  • type MyOption = Option<u8>;
  • fn increment_or_zero(x: MyOption) -> u8 {
  • match x {
  • MyOption::Some(y) => y + 1,
  • MyOption::None => 0,
  • You can now use _ as an identifier for consts. e.g. You can write const _: u32 = 5;.
  • You can now use #[repr(align(X)] on enums.
  • The ? Kleene macro operator is now available in the 2015 edition.
  • Compiler:
  • You can now enable Profile-Guided Optimization with the -C profile-generate and -C profile-use flags. For more information on how to use profile guided optimization, please refer to the rustc book.
  • The rust-lldb wrapper script should now work again.
  • Libraries:
  • mem::MaybeUninit<T> is now ABI-compatible with T.
  • Stabilized APIs:
  • BufReader::buffer
  • BufWriter::buffer
  • Cell::from_mut
  • Cell<[T]>::as_slice_of_cells
  • DoubleEndedIterator::nth_back
  • Option::xor
  • Wrapping::reverse_bits
  • i128::reverse_bits
  • i16::reverse_bits
  • i32::reverse_bits
  • i64::reverse_bits
  • i8::reverse_bits
  • isize::reverse_bits
  • slice::copy_within
  • u128::reverse_bits
  • u16::reverse_bits
  • u32::reverse_bits
  • u64::reverse_bits
  • u8::reverse_bits
  • usize::reverse_bits
  • Cargo:
  • Cargo.lock files are now included by default when publishing executable crates with executables.
  • You can now specify default-run="foo" in [package] to specify the default executable to use for cargo run.

New in Rust 1.36.0 (Jul 4, 2019)

  • Language:
  • Non-Lexical Lifetimes are now enabled on the 2015 edition.
  • The order of traits in trait objects no longer affects the semantics of that object. e.g. dyn Send + fmt::Debug is now equivalent to dyn fmt::Debug + Send, where this was previously not the case.
  • Libraries:
  • HashMap's implementation has been replaced with hashbrown::HashMap implementation.
  • TryFromSliceError now implements From<Infallible>.
  • mem::needs_drop is now available as a const fn.
  • alloc::Layout::from_size_align_unchecked is now available as a const fn.
  • String now implements BorrowMut<str>.
  • io::Cursor now implements Default.
  • Both NonNull::{dangling, cast} are now const fns.
  • The alloc crate is now stable. alloc allows you to use a subset of std (e.g. Vec, Box, Arc) in #![no_std] environments if the environment has access to heap memory allocation.
  • String now implements From<&String>.
  • You can now pass multiple arguments to the dbg! macro. dbg! will return a tuple of each argument when there is multiple arguments.
  • Result::{is_err, is_ok} are now #[must_use] and will produce a warning if not used.
  • Stabilized APIs:
  • VecDeque::rotate_left
  • VecDeque::rotate_right
  • Iterator::copied
  • io::IoSlice
  • io::IoSliceMut
  • Read::read_vectored
  • Write::write_vectored
  • str::as_mut_ptr
  • mem::MaybeUninit
  • pointer::align_offset
  • future::Future
  • task::Context
  • task::RawWaker
  • task::RawWakerVTable
  • task::Waker
  • task::Poll
  • Cargo:
  • Cargo will now produce an error if you attempt to use the name of a required dependency as a feature.
  • You can now pass the --offline flag to run cargo without accessing the network.
  • Compatibility Notes:
  • With the stabilisation of mem::MaybeUninit, mem::uninitialized use is no longer recommended, and will be deprecated in 1.38.0.

New in Rust 1.35.0 (May 24, 2019)

  • Language:
  • FnOnce, FnMut, and the Fn traits are now implemented for Box<FnOnce>, Box<FnMut>, and Box<Fn> respectively.
  • You can now coerce closures into unsafe function pointers. e.g.
  • unsafe fn call_unsafe(func: unsafe fn()) {
  • func()
  • pub fn main() {
  • unsafe { call_unsafe(|| {}); }
  • Compiler:
  • Added the armv6-unknown-freebsd-gnueabihf and armv7-unknown-freebsd-gnueabihf targets.
  • Added the wasm32-unknown-wasi target.
  • Libraries:
  • Thread will now show its ID in Debug output.
  • StdinLock, StdoutLock, and StderrLock now implement AsRawFd.
  • alloc::System now implements Default.
  • Expanded Debug output ({:#?}) for structs now has a trailing comma on the last field.
  • char::{ToLowercase, ToUppercase} now implement ExactSizeIterator.
  • All NonZero numeric types now implement FromStr.
  • Removed the Read trait bounds on the BufReader::{get_ref, get_mut, into_inner} methods.
  • You can now call the dbg! macro without any parameters to print the file and line where it is called.
  • In place ASCII case conversions are now up to 4× faster. e.g. str::make_ascii_lowercase
  • hash_map::{OccupiedEntry, VacantEntry} now implement Sync and Send.
  • Stabilized APIs:
  • f32::copysign
  • f64::copysign
  • RefCell::replace_with
  • RefCell::map_split
  • ptr::hash
  • Range::contains
  • RangeFrom::contains
  • RangeTo::contains
  • RangeInclusive::contains
  • RangeToInclusive::contains
  • Option::copied
  • Cargo:
  • You can now set cargo:rustc-cdylib-link-arg at build time to pass custom linker arguments when building a cdylib. Its usage is highly platform specific.
  • Misc:
  • The Rust toolchain is now available natively for musl based distros.

New in Rust 1.34.1 (May 14, 2019)

  • This patch release fixes two false positives and a panic when checking macros in Clippy. Clippy is a tool which provides a collection of lints to catch common mistakes and improve your Rust code.

New in Rust 1.34 (Apr 12, 2019)

  • Language:
  • You can now use #[deprecated = "reason"] as a shorthand for #[deprecated(note = "reason")]. This was previously allowed by mistake but had no effect.
  • You can now accept token streams in #[attr()],#[attr[]], and #[attr{}] procedural macros.
  • You can now write extern crate self as foo; to import your crate's root into the extern prelude.
  • Compiler:
  • You can now target riscv64imac-unknown-none-elf and riscv64gc-unknown-none-elf.
  • You can now enable linker plugin LTO optimisations with -C linker-plugin-lto. This allows rustc to compile your Rust code into LLVM bitcode allowing LLVM to perform LTO optimisations across C/C++ FFI boundaries.
  • You can now target powerpc64-unknown-freebsd.
  • Libraries:
  • The trait bounds have been removed on some of HashMap<K, V, S>'s and HashSet<T, S>'s basic methods. Most notably you no longer require the Hash trait to create an iterator.
  • The Ord trait bounds have been removed on some of BinaryHeap<T>'s basic methods. Most notably you no longer require the Ord trait to create an iterator.
  • The methods overflowing_neg and wrapping_neg are now const functions for all numeric types.
  • Indexing a str is now generic over all types that implement SliceIndex<str>.
  • str::trim, str::trim_matches, str::trim_{start, end}, and str::trim_{start, end}_matches are now #[must_use] and will produce a warning if their returning type is unused.
  • The methods checked_pow, saturating_pow, wrapping_pow, and overflowing_pow are now available for all numeric types. These are equivalvent to methods such as wrapping_add for the pow operation.
  • Stabilized APIs:
  • std & core:
  • Any::type_id
  • Error::type_id
  • atomic::AtomicI16
  • atomic::AtomicI32
  • atomic::AtomicI64
  • atomic::AtomicI8
  • atomic::AtomicU16
  • atomic::AtomicU32
  • atomic::AtomicU64
  • atomic::AtomicU8
  • convert::Infallible
  • convert::TryFrom
  • convert::TryInto
  • iter::from_fn
  • iter::successors
  • num::NonZeroI128
  • num::NonZeroI16
  • num::NonZeroI32
  • num::NonZeroI64
  • num::NonZeroI8
  • num::NonZeroIsize
  • slice::sort_by_cached_key
  • str::escape_debug
  • str::escape_default
  • str::escape_unicode
  • str::split_ascii_whitespace
  • std
  • Instant::checked_add
  • Instant::checked_sub
  • SystemTime::checked_add
  • SystemTime::checked_sub
  • Cargo:
  • You can now use alternative registries to crates.io.
  • Misc:
  • You can now use the ? operator in your documentation tests without manually adding fn main() -> Result<(), _> {}.
  • Compatibility Notes:
  • Command::before_exec is now deprecated in favor of the unsafe method Command::pre_exec.
  • Use of ATOMIC_{BOOL, ISIZE, USIZE}_INIT is now deprecated. As you can now use const functions in static variables.

New in Rust 1.32.0 (Jan 18, 2019)

  • Version 1.32.0 (2019-01-17)
  • Language
  • 2018 edition
  • You can now use the ? operator in macro definitions. The ? operator allows you to specify zero or one repetitions similar to the * and + operators.
  • Module paths with no leading keyword like super, self, or crate, will now always resolve to the item (enum, struct, etc.) available in the module if present, before resolving to a external crate or an item the prelude. E.g.
  • enum Color { Red, Green, Blue }
  • use Color::*;
  • All editions
  • You can now match against PhantomData<T> types.
  • You can now match against literals in macros with the literal specifier. This will match against a literal of any type. E.g. 1, 'A', "Hello World"
  • Self can now be used as a constructor and pattern for unit and tuple structs. E.g.
  • struct Point(i32, i32);
  • impl Point {
  • pub fn new(x: i32, y: i32) -> Self {
  • Self(x, y)
  • pub fn is_origin(&self) -> bool {
  • match self {
  • Self(0, 0) => true,
  • _ => false,
  • Self can also now be used in type definitions. E.g.
  • enum List<T>
  • where
  • Self: PartialOrd<Self> // can write `Self` instead of `List<T>`
  • Nil,
  • Cons(T, Box<Self>) // likewise here
  • You can now mark traits with #[must_use]. This provides a warning if a impl Trait or dyn Trait is returned and unused in the program.
  • Compiler
  • The default allocator has changed from jemalloc to the default allocator on your system. The compiler itself on Linux & macOS will still use jemalloc, but programs compiled with it will use the system allocator.
  • Added the aarch64-pc-windows-msvc target.
  • Libraries
  • PathBuf now implements FromStr.
  • Box<[T]> now implements FromIterator<T>.
  • The dbg! macro has been stabilized. This macro enables you to easily debug expressions in your rust program. E.g.
  • let a = 2;
  • let b = dbg!(a * 2) + 1;
  • // ^-- prints: [src/main.rs:4] a * 2 = 4
  • assert_eq!(b, 5);
  • The following APIs are now const functions and can be used in a const context.
  • Cell::as_ptr
  • UnsafeCell::get
  • char::is_ascii
  • iter::empty
  • ManuallyDrop::new
  • ManuallyDrop::into_inner
  • RangeInclusive::start
  • RangeInclusive::end
  • NonNull::as_ptr
  • slice::as_ptr
  • str::as_ptr
  • Duration::as_secs
  • Duration::subsec_millis
  • Duration::subsec_micros
  • Duration::subsec_nanos
  • CStr::as_ptr
  • Ipv4Addr::is_unspecified
  • Ipv6Addr::new
  • Ipv6Addr::octets
  • Stabilized APIs
  • i8::to_be_bytes
  • i8::to_le_bytes
  • i8::to_ne_bytes
  • i8::from_be_bytes
  • i8::from_le_bytes
  • i8::from_ne_bytes
  • i16::to_be_bytes
  • i16::to_le_bytes
  • i16::to_ne_bytes
  • i16::from_be_bytes
  • i16::from_le_bytes
  • i16::from_ne_bytes
  • i32::to_be_bytes
  • i32::to_le_bytes
  • i32::to_ne_bytes
  • i32::from_be_bytes
  • i32::from_le_bytes
  • i32::from_ne_bytes
  • i64::to_be_bytes
  • i64::to_le_bytes
  • i64::to_ne_bytes
  • i64::from_be_bytes
  • i64::from_le_bytes
  • i64::from_ne_bytes
  • i128::to_be_bytes
  • i128::to_le_bytes
  • i128::to_ne_bytes
  • i128::from_be_bytes
  • i128::from_le_bytes
  • i128::from_ne_bytes
  • isize::to_be_bytes
  • isize::to_le_bytes
  • isize::to_ne_bytes
  • isize::from_be_bytes
  • isize::from_le_bytes
  • isize::from_ne_bytes
  • u8::to_be_bytes
  • u8::to_le_bytes
  • u8::to_ne_bytes
  • u8::from_be_bytes
  • u8::from_le_bytes
  • u8::from_ne_bytes
  • u16::to_be_bytes
  • u16::to_le_bytes
  • u16::to_ne_bytes
  • u16::from_be_bytes
  • u16::from_le_bytes
  • u16::from_ne_bytes
  • u32::to_be_bytes
  • u32::to_le_bytes
  • u32::to_ne_bytes
  • u32::from_be_bytes
  • u32::from_le_bytes
  • u32::from_ne_bytes
  • u64::to_be_bytes
  • u64::to_le_bytes
  • u64::to_ne_bytes
  • u64::from_be_bytes
  • u64::from_le_bytes
  • u64::from_ne_bytes
  • u128::to_be_bytes
  • u128::to_le_bytes
  • u128::to_ne_bytes
  • u128::from_be_bytes
  • u128::from_le_bytes
  • u128::from_ne_bytes
  • usize::to_be_bytes
  • usize::to_le_bytes
  • usize::to_ne_bytes
  • usize::from_be_bytes
  • usize::from_le_bytes
  • usize::from_ne_bytes
  • Cargo
  • You can now run cargo c as an alias for cargo check.
  • Usernames are now allowed in alt registry URLs.
  • Misc
  • libproc_macro has been added to the rust-src distribution.
  • Compatibility Notes
  • The argument types for AVX's _mm256_stream_si256, _mm256_stream_pd, _mm256_stream_ps have been changed from *const to *mut as the previous implementation was unsound.

New in Rust 1.31.1 (Dec 21, 2018)

  • Fix Rust failing to build on powerpc-unknown-netbsd
  • Fix broken go-to-definition in RLS
  • Fix infinite loop on hover in RLS

New in Rust 1.30.0 (Oct 26, 2018)

  • Language:
  • Procedural macros are now available. These kinds of macros allow for more powerful code generation. There is a new chapter available in the Rust Programming Language book that goes further in depth.
  • You can now use keywords as identifiers using the raw identifiers syntax (r#), e.g. let r#for = true;
  • Using anonymous parameters in traits is now deprecated with a warning and will be a hard error in the 2018 edition.
  • You can now use crate in paths. This allows you to refer to the crate root in the path, e.g. use crate::foo; refers to foo in src/lib.rs.
  • Using a external crate no longer requires being prefixed with ::. Previously, using a external crate in a module without a use statement required let json = ::serde_json::from_str(foo); but can now be written as let json = serde_json::from_str(foo);.
  • You can now apply the #[used] attribute to static items to prevent the compiler from optimising them away, even if they appear to be unused, e.g. #[used] static FOO: u32 = 1;
  • You can now import and reexport macros from other crates with the use syntax. Macros exported with #[macro_export] are now placed into the root module of the crate. If your macro relies on calling other local macros, it is recommended to export with the #[macro_export(local_inner_macros)] attribute so users won't have to import those macros.
  • You can now catch visibility keywords (e.g. pub, pub(crate)) in macros using the vis specifier.
  • Non-macro attributes now allow all forms of literals, not just strings. Previously, you would write #[attr("true")], and you can now write #[attr(true)].
  • You can now specify a function to handle a panic in the Rust runtime with the #[panic_handler] attribute.
  • Compiler:
  • Added the riscv32imc-unknown-none-elf target.
  • Added the aarch64-unknown-netbsd target
  • Libraries:
  • ManuallyDrop now allows the inner type to be unsized.
  • Stabilized APIs:
  • Ipv4Addr::BROADCAST
  • Ipv4Addr::LOCALHOST
  • Ipv4Addr::UNSPECIFIED
  • Ipv6Addr::LOCALHOST
  • Ipv6Addr::UNSPECIFIED
  • Iterator::find_map
  • The following methods are replacement methods for trim_left, trim_right, trim_left_matches, and trim_right_matches, which will be deprecated in 1.33.0:
  • str::trim_end_matches
  • str::trim_end
  • str::trim_start_matches
  • str::trim_start
  • Cargo:
  • cargo run doesn't require specifying a package in workspaces.
  • cargo doc now supports --message-format=json. This is equivalent to calling rustdoc --error-format=json.
  • You can specify which edition to create a project in cargo with cargo new --edition. Currently only 2015 is a valid option.
  • Cargo will now provide a progress bar for builds.
  • Misc:
  • rustdoc allows you to specify what edition to treat your code as with the --edition option.
  • rustdoc now has the --color (specify whether to output color) and --error-format (specify error format, e.g. json) options.
  • We now distribute a rust-gdbgui script that invokes gdbgui with Rust debug symbols.
  • Attributes from Rust tools such as rustfmt or clippy are now available, e.g. #[rustfmt::skip] will skip formatting the next item.

New in Rust 1.29.2 (Oct 13, 2018)

  • Workaround for an aliasing-related LLVM bug, which caused miscompilation.
  • The rls-preview component on the windows-gnu targets has been restored.

New in Rust 1.29 (Sep 14, 2018)

  • Compiler:
  • Bumped minimum LLVM version to 5.0.
  • Added powerpc64le-unknown-linux-musl target.
  • Added aarch64-unknown-hermit and x86_64-unknown-hermit targets.
  • Libraries:
  • Once::call_once now no longer requires Once to be 'static.
  • BuildHasherDefault now implements PartialEq and Eq.
  • Box<CStr>, Box<OsStr>, and Box<Path> now implement Clone.
  • Implemented PartialEq<&str> for OsString and PartialEq<OsString> for &str.
  • Cell<T> now allows T to be unsized.
  • SocketAddr is now stable on Redox.
  • Stabilized APIs:
  • Arc::downcast
  • Iterator::flatten
  • Rc::downcast
  • Cargo:
  • Cargo can silently fix some bad lockfiles You can use --locked to disable this behaviour.
  • cargo-install will now allow you to cross compile an install using --target
  • Added the cargo-fix subcommand to automatically move project code from 2015 edition to 2018.
  • cargo doc can now optionally document private types using the --document-private-items flag.
  • Misc:
  • rustdoc now has the --cap-lints option which demotes all lints above the specified level to that level. For example --cap-lints warn will demote deny and forbid lints to warn.
  • rustc and rustdoc will now have the exit code of 1 if compilation fails, and 101 if there is a panic.
  • A preview of clippy has been made available through rustup. You can install the preview with rustup component add clippy-preview
  • Compatibility Notes:
  • str::{slice_unchecked, slice_unchecked_mut} are now deprecated. Use str::get_unchecked(begin..end) instead.
  • std::env::home_dir is now deprecated for its unintuitive behaviour. Consider using the home_dir function from https://crates.io/crates/dirs instead.
  • rustc will no longer silently ignore invalid data in target spec.

New in Rust 1.28 (Aug 3, 2018)

  • Language:
  • The #[repr(transparent)] attribute is now stable. This attribute allows a Rust newtype wrapper (struct NewType<T>(T);) to be represented as the inner type across Foreign Function Interface (FFI) boundaries.
  • The keywords pure, sizeof, alignof, and offsetof have been unreserved and can now be used as identifiers.
  • The GlobalAlloc trait and #[global_allocator] attribute are now stable. This will allow users to specify a global allocator for their program.
  • Unit test functions marked with the #[test] attribute can now return Result<(), E: Debug> in addition to ().
  • The lifetime specifier for macro_rules! is now stable. This allows macros to easily target lifetimes.
  • Compiler:
  • The s and z optimisation levels are now stable. These optimisations prioritise making smaller binary sizes. z is the same as s with the exception that it does not vectorise loops, which typically results in an even smaller binary.
  • The short error format is now stable. Specified with --error-format=short this option will provide a more compressed output of rust error messages.
  • Added a lint warning when you have duplicated macro_exports.
  • Reduced the number of allocations in the macro parser. This can improve compile times of macro heavy crates on average by 5%.
  • Libraries:
  • Implemented Default for &mut str.
  • Implemented From<bool> for all integer and unsigned number types.
  • Implemented Extend for ().
  • The Debug implementation of time::Duration should now be more easily human readable. Previously a Duration of one second would printed as Duration { secs: 1, nanos: 0 } and will now be printed as 1s.
  • Implemented From<&String> for Cow<str>, From<&Vec<T>> for Cow<[T]>, From<Cow<CStr>> for CString, From<CString>, From<CStr>, From<&CString> for Cow<CStr>, From<OsString>, From<OsStr>, From<&OsString> for Cow<OsStr>, From<&PathBuf> for Cow<Path>, and From<Cow<Path>> for PathBuf.
  • Implemented Shl and Shr for Wrapping<u128> and Wrapping<i128>.
  • DirEntry::metadata now uses fstatat instead of lstat when possible. This can provide up to a 40% speed increase.
  • Improved error messages when using format!.
  • Stabilized APIs:
  • Iterator::step_by
  • Path::ancestors
  • SystemTime::UNIX_EPOCH
  • alloc::GlobalAlloc
  • alloc::Layout
  • alloc::LayoutErr
  • alloc::System
  • alloc::alloc
  • alloc::alloc_zeroed
  • alloc::dealloc
  • alloc::realloc
  • alloc::handle_alloc_error
  • btree_map::Entry::or_default
  • fmt::Alignment
  • hash_map::Entry::or_default
  • iter::repeat_with
  • num::NonZeroUsize
  • num::NonZeroU128
  • num::NonZeroU16
  • num::NonZeroU32
  • num::NonZeroU64
  • num::NonZeroU8
  • ops::RangeBounds
  • slice::SliceIndex
  • slice::from_mut
  • slice::from_ref
  • {Any + Send + Sync}::downcast_mut
  • {Any + Send + Sync}::downcast_ref
  • {Any + Send + Sync}::is
  • Cargo:
  • Cargo will now no longer allow you to publish crates with build scripts that modify the src directory. The src directory in a crate should be considered to be immutable.
  • Misc:
  • The suggestion_applicability field in rustc's json output is now stable. This will allow dev tools to check whether a code suggestion would apply to them.
  • Compatibility Notes:
  • Rust will consider trait objects with duplicated constraints to be the same type as without the duplicated constraint. For example the below code will now fail to compile.
  • trait Trait {}
  • impl Trait + Send {
  • fn test(&self) { println!("one"); } //~ ERROR duplicate definitions with name `test`
  • impl Trait + Send + Send {
  • fn test(&self) { println!("two"); }

New in Rust 1.27.2 (Jul 21, 2018)

  • Language:
  • The #[repr(transparent)] attribute is now stable. This attribute allows a Rust newtype wrapper (struct NewType<T>(T);) to be represented as the inner type across Foreign Function Interface (FFI) boundaries.
  • The keywords pure, sizeof, alignof, and offsetof have been unreserved and can now be used as identifiers.
  • The GlobalAlloc trait and #[global_allocator] attribute are now stable. This will allow users to specify a global allocator for their program.
  • Unit test functions marked with the #[test] attribute can now return Result<(), E: Debug> in addition to ().
  • The lifetime specifier for macro_rules! is now stable. This allows macros to easily target lifetimes.
  • Compiler:
  • The s and z optimisation levels are now stable. These optimisations prioritise making smaller binary sizes. z is the same as s with the exception that it does not vectorise loops, which typically results in an even smaller binary.
  • The short error format is now stable. Specified with --error-format=short this option will provide a more compressed output of rust error messages.
  • Added a lint warning when you have duplicated macro_exports.
  • Reduced the number of allocations in the macro parser. This can improve compile times of macro heavy crates on average by 5%.
  • Libraries:
  • Implemented Default for &mut str.
  • Implemented From<bool> for all integer and unsigned number types.
  • Implemented Extend for ().
  • The Debug implementation of time::Duration should now be more easily human readable. Previously a Duration of one second would printed as Duration { secs: 1, nanos: 0 } and will now be printed as 1s.
  • Implemented From<&String> for Cow<str>, From<&Vec<T>> for Cow<[T]>, From<Cow<CStr>> for CString, From<CString>, From<CStr>, From<&CString> for Cow<CStr>, From<OsString>, From<OsStr>, From<&OsString> for Cow<OsStr>, From<&PathBuf> for Cow<Path>, and From<Cow<Path>> for PathBuf.
  • Implemented Shl and Shr for Wrapping<u128> and Wrapping<i128>.
  • DirEntry::metadata now uses fstatat instead of lstat when possible. This can provide up to a 40% speed increase.
  • Improved error messages when using format!.
  • Stabilized APIs:
  • Iterator::step_by
  • Path::ancestors
  • btree_map::Entry::or_default
  • fmt::Alignment
  • hash_map::Entry::or_default
  • iter::repeat_with
  • num::NonZeroUsize
  • num::NonZeroU128
  • num::NonZeroU16
  • num::NonZeroU32
  • num::NonZeroU64
  • num::NonZeroU8
  • ops::RangeBounds
  • slice::SliceIndex
  • slice::from_mut
  • slice::from_ref
  • {Any + Send + Sync}::downcast_mut
  • {Any + Send + Sync}::downcast_ref
  • {Any + Send + Sync}::is
  • Cargo:
  • Cargo will now no longer allow you to publish crates with build scripts that modify the src directory. The src directory in a crate should be considered to be immutable.
  • Misc:
  • The suggestion_applicability field in rustc's json output is now stable. This will allow dev tools to check whether a code suggestion would apply to them.

New in Rust 1.28.0 (Jul 11, 2018)

  • Language:
  • The #[repr(transparent)] attribute is now stable. This attribute allows a Rust newtype wrapper (struct NewType<T>(T);) to be represented as the inner type across Foreign Function Interface (FFI) boundaries.
  • The keywords pure, sizeof, alignof, and offsetof have been unreserved and can now be used as identifiers.
  • The GlobalAlloc trait and #[global_allocator] attribute are now stable. This will allow users to specify a global allocator for their program.
  • Unit test functions marked with the #[test] attribute can now return Result<(), E: Debug> in addition to ().
  • The lifetime specifier for macro_rules! is now stable. This allows macros to easily target lifetimes.
  • Compiler:
  • The s and z optimisation levels are now stable. These optimisations prioritise making smaller binary sizes. z is the same as s with the exception that it does not vectorise loops, which typically results in an even smaller binary.
  • The short error format is now stable. Specified with --error-format=short this option will provide a more compressed output of rust error messages.
  • Added a lint warning when you have duplicated macro_exports.
  • Reduced the number of allocations in the macro parser. This can improve compile times of macro heavy crates on average by 5%.
  • Libraries:
  • Implemented Default for &mut str.
  • Implemented From<bool> for all integer and unsigned number types.
  • Implemented Extend for ().
  • The Debug implementation of time::Duration should now be more easily human readable. Previously a Duration of one second would printed as Duration { secs: 1, nanos: 0 } and will now be printed as 1s.
  • Implemented From<&String> for Cow<str>, From<&Vec<T>> for Cow<[T]>, From<Cow<CStr>> for CString, From<CString>, From<CStr>, From<&CString> for Cow<CStr>, From<OsString>, From<OsStr>, From<&OsString> for Cow<OsStr>, From<&PathBuf> for Cow<Path>, and From<Cow<Path>> for PathBuf.
  • Implemented Shl and Shr for Wrapping<u128> and Wrapping<i128>.
  • DirEntry::metadata now uses fstatat instead of lstat when possible. This can provide up to a 40% speed increase.
  • Improved error messages when using format!.
  • Stabilized APIs:
  • Iterator::step_by
  • Path::ancestors
  • btree_map::Entry::or_default
  • fmt::Alignment
  • hash_map::Entry::or_default
  • iter::repeat_with
  • num::NonZeroUsize
  • num::NonZeroU128
  • num::NonZeroU16
  • num::NonZeroU32
  • num::NonZeroU64
  • num::NonZeroU8
  • ops::RangeBounds
  • slice::SliceIndex
  • slice::from_mut
  • slice::from_ref
  • {Any + Send + Sync}::downcast_mut
  • {Any + Send + Sync}::downcast_ref
  • {Any + Send + Sync}::is
  • Cargo:
  • Cargo will now no longer allow you to publish crates with build scripts that modify the src directory. The src directory in a crate should be considered to be immutable.
  • Misc:
  • The suggestion_applicability field in rustc's json output is now stable. This will allow dev tools to check whether a code suggestion would apply to them.
  • Compatibility Notes:
  • Rust will no longer consider trait objects with duplicated constraints to have implementations. For example the below code will now fail to compile.
  • trait Trait {}
  • impl Trait + Send {
  • fn test(&self) { println!("one"); } //~ ERROR duplicate definitions with name `test`
  • impl Trait + Send + Send {
  • fn test(&self) { println!("two"); }

New in Rust 1.27.0 (Jul 11, 2018)

  • Language:
  • Removed 'proc' from the reserved keywords list. This allows proc to be used as an identifer.
  • The dyn syntax is now available. This syntax is equivalent to the bare Trait syntax, and should make it clearer when being used in tandem with impl Trait. Since it is equivalent to the following syntax: &Trait == &dyn Trait, &mut Trait == &mut dyn Trait, and Box<Trait> == Box<dyn Trait>.
  • Attributes on generic parameters such as types and lifetimes are now stable. e.g. fn foo<#[lifetime_attr] 'a, #[type_attr] T: 'a>() {}
  • The #[must_use] attribute can now also be used on functions as well as types. It provides a lint that by default warns users when the value returned by a function has not been used.
  • Compiler:
  • Added the armv5te-unknown-linux-musl target.
  • Libraries:
  • SIMD (Single Instruction Multiple Data) on x86/x86_64 is now stable. This includes arch::x86 & arch::x86_64 modules which contain SIMD intrinsics, a new macro called is_x86_feature_detected!, the #[target_feature(enable="")] attribute, and adding target_feature = "" to the cfg attribute.
  • A lot of methods for [u8], f32, and f64 previously only available in std are now available in core.
  • The generic Rhs type parameter on ops::{Shl, ShlAssign, Shr} now defaults to Self.
  • std::str::replace now has the #[must_use] attribute to clarify that the operation isn't done in place.
  • Clone::clone, Iterator::collect, and ToOwned::to_owned now have the #[must_use] attribute to warn about unused potentially expensive allocations.
  • Stabilized APIs:
  • DoubleEndedIterator::rfind
  • DoubleEndedIterator::rfold
  • DoubleEndedIterator::try_rfold
  • Duration::from_micros
  • Duration::from_nanos
  • Duration::subsec_micros
  • Duration::subsec_millis
  • HashMap::remove_entry
  • Iterator::try_fold
  • Iterator::try_for_each
  • NonNull::cast
  • Option::filter
  • String::replace_range
  • Take::set_limit
  • hint::unreachable_unchecked
  • os::unix::process::parent_id
  • ptr::swap_nonoverlapping
  • slice::rsplit_mut
  • slice::rsplit
  • slice::swap_with_slice
  • Cargo:
  • cargo-metadata now includes authors, categories, keywords, readme, and repository fields.
  • cargo-metadata now includes a package's metadata table.
  • Added the --target-dir optional argument. This allows you to specify a different directory than target for placing compilation artifacts.
  • Cargo will be adding automatic target inference for binaries, benchmarks, examples, and tests in the Rust 2018 edition. If your project specifies specific targets e.g. using [[bin]] and have other binaries in locations where cargo would infer a binary, Cargo will produce a warning. You can disable this feature ahead of time by setting any of the following autobins, autobenches, autoexamples, autotests to false.
  • Cargo will now cache compiler information. This can be disabled by setting CARGO_CACHE_RUSTC_INFO=0 in your environment.
  • Misc:
  • Added “The Rustc book” into the official documentation. “The Rustc book” documents and teaches how to use the rustc compiler.
  • All books available on doc.rust-lang.org are now searchable.
  • Compatibility Notes:
  • Calling a CharExt or StrExt method directly on core will no longer work. e.g. ::core::prelude::v1::StrExt::is_empty("") will not compile, "".is_empty() will still compile.
  • Debug output on atomic::{AtomicBool, AtomicIsize, AtomicPtr, AtomicUsize} will only print the inner type. e.g. print!("{:?}", AtomicBool::new(true)) will print true not AtomicBool(true).
  • The maximum number for repr(align(N)) is now 2²⁹. Previously you could enter higher numbers but they were not supported by LLVM. Up to 512MB alignment should cover all use cases.

New in Rust 0.9 (Jan 10, 2014)

  • Language:
  • The `float` type has been removed. Use `f32` or `f64` instead.
  • A new facility for enabling experimental features (feature gating) has been added, using the crate-level `#[feature(foo)]` attribute.
  • Managed boxes (@) are now behind a feature gate
  • feature(managed_boxes)]`) in preperation for future removal. Use the standard library's `Gc` or `Rc` types instead.
  • mut` has been removed. Use `std::cell::{Cell, RefCell}` instead.
  • Jumping back to the top of a loop is now done with `continue` instead of loop`.
  • Strings can no longer be mutated through index assignment.
  • Raw strings can be created via the basic `r"foo"` syntax or with matched
  • hash delimiters, as in `r###"foo"###`.
  • fn` is now written `proc (args) -> retval { ... }` and may only be called once.
  • The `&fn` type is now written `|args| -> ret` to match the literal form.
  • fn`s have been removed.
  • do` only works with procs in order to make it obvious what the cost of `do` is.
  • Single-element tuple-like structs can no longer be dereferenced to obtain the inner value. A more comprehensive solution for overloading the dereference operator will be provided in the future.
  • The `#[link(...)]` attribute has been replaced with crate_id = "name#vers"]`.
  • Empty `impl`s must be terminated with empty braces and may not be
  • terminated with a semicolon.
  • Keywords are no longer allowed as lifetime names; the `self` lifetime no longer has any special meaning.
  • The old `fmt!` string formatting macro has been removed.
  • printf!` and `printfln!` (old-style formatting) removed in favor of
  • print!` and `println!`.
  • mut` works in patterns now, as in `let (mut x, y) = (1, 2);`.
  • The `extern mod foo (name = "bar")` syntax has been removed. Use extern mod foo = "bar"` instead.
  • New reserved keywords: `alignof`, `offsetof`, `sizeof`.
  • Macros can have attributes.
  • Macros can expand to items with attributes.
  • Macros can expand to multiple items.
  • The `asm!` macro is feature-gated (`#[feature(asm)]`).
  • Comments may be nested.
  • Values automatically coerce to trait objects they implement, without an explicit `as`.
  • Enum discriminants are no longer an entire word but as small as needed to
  • contain all the variants. The `repr` attribute can be used to override the discriminant size, as in `#[repr(int)]` for integer-sized, and repr(C)]` to match C enums.
  • Non-string literals are not allowed in attributes (they never worked).
  • The FFI now supports variadic functions.
  • Octal numeric literals, as in `0o7777`.
  • The `concat!` syntax extension performs compile-time string concatenation.
  • The `#[fixed_stack_segment]` and `#[rust_stack]` attributes have been
  • removed as Rust no longer uses segmented stacks.
  • Non-ascii identifiers are feature-gated (`#[feature(non_ascii_idents)]`).
  • Ignoring all fields of an enum variant or tuple-struct is done with `..`,
  • not `*`; ignoring remaining fields of a struct is also done with `..`,
  • not `_`; ignoring a slice of a vector is done with `..`, not `.._`.
  • rustc` supports the "win64" calling convention via `extern "win64"`.
  • rustc` supports the "system" calling convention, which defaults to the
  • preferred convention for the target platform, "stdcall" on 32-bit Windows,
  • "C" elsewhere.
  • The `type_overflow` lint (default: warn) checks literals for overflow.
  • The `unsafe_block` lint (default: allow) checks for usage of `unsafe`.
  • The `attribute_usage` lint (default: warn) warns about unknown
  • attributes.
  • The `unknown_features` lint (default: warn) warns about unknown
  • feature gates.
  • The `dead_code` lint (default: warn) checks for dead code.
  • Rust libraries can be linked statically to one another
  • link_args]` is behind the `link_args` feature gate.
  • Native libraries are now linked with `#[link(name = "foo")]`
  • Native libraries can be statically linked to a rust crate
  • link(name = "foo", kind = "static")]`).
  • link(name = "foo", kind = "framework")]`).
  • The `#[thread_local]` attribute creates thread-local (not task-local)
  • variables. Currently behind the `thread_local` feature gate.
  • The `return` keyword may be used in closures.
  • Types that can be copied via a memcpy implement the `Pod` kind.
  • The `cfg` attribute can now be used on struct fields and enum variants.
  • Libraries
  • std: The `option` and `result` API's have been overhauled to make them
  • simpler, more consistent, and more composable.
  • std: The entire `std::io` module has been replaced with one that is
  • more comprehensive and that properly interfaces with the underlying
  • scheduler. File, TCP, UDP, Unix sockets, pipes, and timers are all
  • implemented.
  • std: `io::util` contains a number of useful implementations of
  • Reader` and `Writer`, including `NullReader`, `NullWriter`,
  • ZeroReader`, `TeeReader`.
  • std: The reference counted pointer type `extra::rc` moved into std.
  • std: The `Gc` type in the `gc` module will replace `@` (it is currently
  • just a wrapper around it).
  • std: The `Either` type has been removed.
  • std: `fmt::Default` can be implemented for any type to provide default
  • formatting to the `format!` macro, as in `format!("{}", myfoo)`.
  • std: The `rand` API continues to be tweaked.
  • std: The `rust_begin_unwind` function, useful for insterting breakpoints
  • on failure in gdb, is now named `rust_fail`.
  • std: The `each_key` and `each_value` methods on `HashMap` have been
  • replaced by the `keys` and `values` iterators.
  • std: Functions dealing with type size and alignment have moved from the
  • sys` module to the `mem` module.
  • std: The `path` module was written and API changed.
  • std: `str::from_utf8` has been changed to cast instead of allocate.
  • std: `starts_with` and `ends_with` methods added to vectors via the
  • ImmutableEqVector` trait, which is in the prelude.
  • std: Vectors can be indexed with the `get_opt` method, which returns `None`
  • if the index is out of bounds.
  • std: Task failure no longer propagates between tasks, as the model was
  • complex, expensive, and incompatible with thread-based tasks.
  • std: The `Any` type can be used for dynamic typing.
  • std: `~Any` can be passed to the `fail!` macro and retrieved via
  • task::try`.
  • std: Methods that produce iterators generally do not have an `_iter`
  • suffix now.
  • std: `cell::Cell` and `cell::RefCell` can be used to introduce mutability
  • roots (mutable fields, etc.). Use instead of e.g. `@mut`.
  • std: `util::ignore` renamed to `prelude::drop`.
  • std: Slices have `sort` and `sort_by` methods via the `MutableVector`
  • trait.
  • std: `vec::raw` has seen a lot of cleanup and API changes.
  • std: The standard library no longer includes any C++ code, and very
  • minimal C, eliminating the dependency on libstdc++.
  • std: Runtime scheduling and I/O functionality has been factored out into
  • extensible interfaces and is now implemented by two different crates:
  • libnative, for native threading and I/O; and libgreen, for green threading
  • and I/O. This paves the way for using the standard library in more limited
  • embeded environments.
  • std: The `comm` module has been rewritten to be much faster, have a
  • simpler, more consistent API, and to work for both native and green
  • threading.
  • std: All libuv dependencies have been moved into the rustuv crate.
  • native: New implementations of runtime scheduling on top of OS threads.
  • native: New native implementations of TCP, UDP, file I/O, process spawning,
  • and other I/O.
  • green: The green thread scheduler and message passing types are almost
  • entirely lock-free.
  • extra: The `flatpipes` module had bitrotted and was removed.
  • extra: All crypto functions have been removed and Rust now has a policy of
  • not reimplementing crypto in the standard library. In the future crypto
  • will be provided by external crates with bindings to established libraries.
  • extra: `c_vec` has been modernized.
  • extra: The `sort` module has been removed. Use the `sort` method on
  • mutable slices.
  • Tooling:
  • The `rust` and `rusti` commands have been removed, due to lack of
  • maintenance.
  • rustdoc` was completely rewritten.
  • rustdoc` can test code examples in documentation.
  • rustpkg` can test packages with the argument, 'test'.
  • rustpkg` supports arbitrary dependencies, including C libraries.
  • rustc`'s support for generating debug info is improved again.
  • rustc` has better error reporting for unbalanced delimiters.
  • rustc`'s JIT support was removed due to bitrot.
  • Executables and static libraries can be built with LTO (-Z lto)
  • rustc` adds a `--dep-info` flag for communicating dependencies to
  • build tools.

New in Rust 0.2 (Mar 30, 2012)

  • 1500 changes, numerous bugfixes
  • New docs and doc tooling
  • New port: FreeBSD x86_64
  • Compilation model enhancements:
  • Generics now specialized, multiply instantiated
  • Functions now inlined across separate crates
  • Scheduling, stack and threading fixes:
  • Noticeably improved message-passing performance
  • Explicit schedulers
  • Callbacks from C
  • Helgrind clean
  • Experimental new language features:
  • Operator overloading
  • Region pointers
  • Classes
  • Various language extensions:
  • C-callback function types: 'crust fn ...'
  • Infinite-loop construct: 'loop { ... }'
  • Shorten 'mutable' to 'mut'
  • Required mutable-local qualifier: 'let mut ...'
  • Basic glob-exporting: 'export foo::*;'
  • Alt now exhaustive, 'alt check' for runtime-checked
  • Block-function form of 'for' loop, with 'break' and 'ret'.
  • New library code:
  • AST quasi-quote syntax extension
  • Revived libuv interface
  • New modules: core::{future, iter}, std::arena
  • Merged per-platform std::{os*, fs*} to core::{libc, os}
  • Extensive cleanup, regularization in libstd, libcore