Rust Changelog

What's new in Rust 1.77.1

Apr 1, 2024
  • Revert stripping debuginfo by default for Windows This fixes a regression in 1.77 by reverting to the previous default. Platforms other than Windows are not affected.
  • Internal: Fix heading anchor rendering in doc pages

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
  • Libraries:
  • Implement From for Cow.
  • Remove special-case handling of vec.split_off(0).
  • Stabilized APIs:
  • array::each_ref
  • array::each_mut
  • core::net
  • f32::round_ties_even
  • f64::round_ties_even
  • mem::offset_of!
  • slice::first_chunk
  • slice::first_chunk_mut
  • slice::split_first_chunk
  • slice::split_first_chunk_mut
  • slice::last_chunk
  • slice::last_chunk_mut
  • slice::split_last_chunk
  • slice::split_last_chunk_mut
  • slice::chunk_by
  • slice::chunk_by_mut
  • Bound::map
  • File::create_new
  • Mutex::clear_poison
  • RwLock::clear_poison
  • Cargo:
  • Extend the build directive syntax with cargo::.
  • Stabilize metadata id format as PackageIDSpec.
  • Pull out cargo-util-schemas as a crate.
  • Strip all debuginfo when debuginfo is not requested.
  • Inherit jobserver from env for all kinds of runners.
  • Deprecate rustc plugin support in cargo.
  • Rustdoc:
  • Allows links in markdown headings.
  • Search for tuples and unit by type with ().
  • Clean up the source sidebar's hide button.
  • Prevent JS injection from localStorage.
  • Misc:
  • Recommend version-sorting for all sorting in style guide.
  • 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 more weirdness to weird-exprs.rs.

New in Rust 1.76.0 (Feb 9, 2024)

  • Language:
  • Document Rust ABI compatibility between various types
  • Also: guarantee that char and u32 are ABI-compatible
  • Warn against ambiguous wide pointer comparisons
  • Add lint ambiguous_wide_pointer_comparisons that supersedes clippy::vtable_address_comparisons
  • Compiler:
  • Lint pinned #[must_use] pointers (in particular, Box 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
  • 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 29, 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
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Override Waker::clone_from to avoid cloning Wakers unnecessarily.
  • Implement BufRead for VecDeque.
  • 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.1 (Dec 19, 2023)

  • Resolved spurious STATUS_ACCESS_VIOLATIONs in LLVM
  • Clarify guarantees for std::mem::discriminant
  • Fix some subtyping-related regressions

New in Rust 1.74.0 (Nov 16, 2023)

  • Language:
  • Codify that std::mem::Discriminant does not depend on any lifetimes in T
  • Replace private_in_public lint with private_interfaces and private_bounds per RFC 2145. Read more in RFC 2145.
  • Allow explicit #[repr(Rust)]
  • closure field capturing: don't depend on alignment of packed fields
  • Enable MIR-based drop-tracking for async blocks
  • Stabilize impl_trait_projections
  • Compiler:
  • stabilize combining +bundle and +whole-archive link modifiers
  • Stabilize PATH option for --print KIND=PATH
  • Enable ASAN/LSAN/TSAN for *-apple-ios-macabi
  • Promote loongarch64-unknown-none* to Tier 2
  • Add i686-pc-windows-gnullvm as a tier 3 target
  • Libraries:
  • Implement From for ChildStdin/out/err
  • Implement From for Vec where T: Clone
  • impl Step for IP addresses
  • Implement From for Rc and Arc
  • impl TryFrom for u16
  • Stabilize io_error_other feature
  • Stabilize the Saturating type
  • Stabilize const_transmute_copy
  • Stabilized APIs:
  • core::num::Saturating
  • impl From for std::process::Stdio
  • impl From for std::process::Stdio
  • impl From for std::process::Child{Stdin, Stdout, Stderr}
  • impl From for std::process::Child{Stdin, Stdout, Stderr}
  • std::ffi::OsString::from_encoded_bytes_unchecked
  • std::ffi::OsString::into_encoded_bytes
  • std::ffi::OsStr::from_encoded_bytes_unchecked
  • std::ffi::OsStr::as_encoded_bytes
  • std::io::Error::other
  • impl TryFrom for u16
  • impl From for Vec
  • impl From for Vec
  • impl From for Arc
  • impl From for Rc
  • These APIs are now stable in const contexts:
  • core::mem::transmute_copy
  • str::is_ascii
  • [u8]::is_ascii
  • Cargo:
  • fix: Set MSRV for internal packages
  • config: merge lists in precedence order
  • fix(update): Clarify meaning of --aggressive as --recursive
  • fix(update): Make -p more convenient by being positional
  • feat(help): Add styling to help output
  • feat(pkgid): Allow incomplete versions when unambigious
  • feat: stabilize credential-process and registry-auth
  • feat(cli): Add '-n' to dry-run
  • Add support for target.'cfg(..)'.linker
  • Stabilize --keep-going
  • feat: Stabilize lints
  • Rustdoc:
  • Add warning block support in rustdoc
  • Accept additional user-defined syntax classes in fenced code blocks
  • rustdoc-search: add support for type parameters
  • rustdoc: show inner enum and struct in type definition for concrete type
  • Compatibility Notes:
  • Raise minimum supported Apple OS versions
  • make Cell::swap panic if the Cells partially overlap
  • Reject invalid crate names in --extern
  • Don't resolve generic impls that may be shadowed by dyn built-in impls
  • The new impl From for Vec is known to cause some inference failures with overly-generic code. In those examples using the tui crate, the combination of AsRef and Into leaves the middle type ambiguous, and the new impl adds another possibility, so it now requires an explicit type annotation.
  • Internal Changes:
  • These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.

New in Rust 1.73.0 (Oct 8, 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 wasm32-wasi-preview1-threads as a tier 2 target.
  • 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
  • Libraries:
  • Add Read, Write and Seek impls for Arc.
  • Merge functionality of io::Sink into io::Empty.
  • Implement RefUnwindSafe for Backtrace
  • Make ExitStatus implement Default
  • impl SliceIndex for (Bound, Bound)
  • 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::::get
  • LocalKey::::set
  • LocalKey::::take
  • LocalKey::::replace
  • LocalKey::::with_borrow
  • LocalKey::::with_borrow_mut
  • LocalKey::::set
  • LocalKey::::take
  • LocalKey::::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.1 (Oct 8, 2023)

  • Adjust codegen change to improve LLVM codegen
  • rustdoc: Fix self ty params in objects with lifetimes
  • Fix regression in compile times
  • Resolve some ICE regressions in the compiler:
  • #115215
  • #115559

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, BufWriter and LineWriter
  • 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 Sync for mpsc::Sender
  • impl TryFrom 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.0 (Jul 14, 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.
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Rework handling of recursive panics. Additional panics are allowed while unwinding, as long as they are caught before escaping a Drop implementation, but panicking within a panic hook is now an immediate abort.
  • Loosen From for Box bound to T: Clone.
  • Remove unnecessary T: Send bound in Error for mpsc::SendError and TrySendError.
  • Fix docs for alloc::realloc to match Layout requirements that the size must not exceed isize::MAX.
  • Document const {} syntax for std::thread_local. This syntax was stabilized in Rust 1.59, but not previously mentioned in release notes.
  • Stabilized APIs:
  • CStr::is_empty
  • BuildHasher::hash_one
  • NonZeroI*::is_positive
  • NonZeroI*::is_negative
  • NonZeroI*::checked_neg
  • NonZeroI*::overflowing_neg
  • NonZeroI*::saturating_neg
  • NonZeroI*::wrapping_neg
  • Neg for NonZeroI*
  • Neg for &NonZeroI*
  • From for (T...) (array to N-tuple for N in 1..=12)
  • From for [T; N] (N-tuple to array for N in 1..=12)
  • windows::io::AsHandle for Box
  • windows::io::AsHandle for Rc
  • windows::io::AsHandle for Arc
  • windows::io::AsSocket for Box
  • windows::io::AsSocket for Rc
  • windows::io::AsSocket for Arc
  • These APIs are now stable in const contexts:
  • ::read
  • ::read_unaligned
  • ::read
  • ::read_unaligned
  • ptr::read
  • ptr::read_unaligned
  • ::split_at
  • Cargo:
  • Allow named debuginfo options in Cargo.toml.
  • Add workspace_default_members to the output of cargo metadata.
  • cargo add now considers rust-version when selecting packages.
  • Automatically inherit workspace fields when running cargo new/cargo init.
  • Rustdoc:
  • Add a new rustdoc::unescaped_backticks lint for broken inline code.
  • Support strikethrough with single tildes. (~~old~~ vs. ~new~)
  • Misc:
  • Compatibility Notes:
  • Remove structural match from TypeId. Code that uses a constant TypeId in a pattern will potentially be broken. Known cases have already been fixed -- in particular, users of the log crate's kv_unstable feature should update to log v0.4.18 or later.
  • Add a sysroot crate to represent the standard library crates. This does not affect stable users, but may require adjustment in tools that build their own standard library.
  • Cargo optimizes its usage under rustup. When Cargo detects it will run rustc pointing to a rustup proxy, it'll try bypassing the proxy and use the underlying binary directly. There are assumptions around the interaction with rustup and RUSTUP_TOOLCHAIN. However, it's not expected to affect normal users.
  • When querying a package, Cargo tries only the original name, all hyphens, and all underscores to handle misspellings. Previously, Cargo tried each combination of hyphens and underscores, causing excessive requests to crates.io.
  • Cargo now disallows RUSTUP_HOME and RUSTUP_TOOLCHAIN in the [env] configuration table. This is considered to be not a use case Cargo would like to support, since it will likely cause problems or lead to confusion.
  • 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.

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 29, 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.1 (Mar 29, 2023)

  • Fix miscompilation in produced Windows MSVC artifacts This was introduced by enabling ThinLTO for the distributed rustc which led to miscompilations in the resulting binary. Currently this is believed to be limited to the -Zdylib-lto flag used for rustc compilation, rather than a general bug in ThinLTO, so only rustc artifacts should be affected.
  • Fix --enable-local-rust builds
  • Treat $prefix-clang as clang in linker detection code
  • Fix panic in compiler code

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 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.1 (Jan 11, 2023)

  • Added validation of SSH host keys for git URLs in Cargo (CVE-2022-46176)

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 for Box
  • 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
  • Compatibility Notes:
  • Only apply ProceduralMasquerade hack to older versions of rental
  • Don't export __heap_base and __data_end on wasm32-wasi.
  • Don't export __wasm_init_memory on WebAssembly.
  • Only export __tls_* on wasm32-unknown-unknown.
  • Don't link to libresolv in libstd on Darwin
  • Update libstd's libc to 0.2.135 (to make libstd no longer pull in libiconv.dylib on Darwin)
  • Opaque types no longer imply lifetime bounds This is a soundness fix which may break code that was erroneously relying on this behavior.
  • Make order_dependent_trait_objects show up in future-breakage reports
  • Change std::process::Command spawning to default to inheriting the parent's signal mask
  • 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 4, 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 and let_underscore_lock 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
  • ::cast_mut
  • ::cast_const
  • These APIs are now stable in const contexts:
  • ::offset_from
  • ::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.
  • Combining three or more languages (e.g. Objective C, C++ and Rust) into one binary may hit linker limitations when using lld. For more information, see issue 102754.
  • 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.64.0 (Sep 22, 2022)

  • Language:
  • Unions with mutable references or tuples of allowed types are now allowed
  • It is now considered valid to deallocate memory pointed to by a shared reference &T if every byte in T is inside an UnsafeCell
  • Unused tuple struct fields are now warned against in an allow-by-default lint, unused_tuple_struct_fields, similar to the existing warning for unused struct fields. This lint will become warn-by-default in the future.
  • Compiler:
  • Add Nintendo Switch as tier 3 target
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Only compile #[used] as llvm.compiler.used for ELF targets
  • Add the --diagnostic-width compiler flag to define the terminal width.
  • Add support for link-flavor rust-lld for iOS, tvOS and watchOS
  • Libraries:
  • Remove restrictions on compare-exchange memory ordering.
  • You can now write! or writeln! into an OsString: Implement fmt::Write for OsString
  • Make RwLockReadGuard covariant
  • Implement FusedIterator for std::net::[Into]Incoming
  • impl AsRawFd for {Arc,Box}
  • ptr::copy and ptr::swap are doing untyped copies
  • Add cgroupv1 support to available_parallelism
  • Mitigate many incorrect uses of mem::uninitialized
  • Stabilized APIs:
  • future::IntoFuture
  • future::poll_fn
  • task::ready!
  • num::NonZero*::checked_mul
  • num::NonZero*::checked_pow
  • num::NonZero*::saturating_mul
  • num::NonZero*::saturating_pow
  • num::NonZeroI*::abs
  • num::NonZeroI*::checked_abs
  • num::NonZeroI*::overflowing_abs
  • num::NonZeroI*::saturating_abs
  • num::NonZeroI*::unsigned_abs
  • num::NonZeroI*::wrapping_abs
  • num::NonZeroU*::checked_add
  • num::NonZeroU*::checked_next_power_of_two
  • num::NonZeroU*::saturating_add
  • os::unix::process::CommandExt::process_group
  • os::windows::fs::FileTypeExt::is_symlink_dir
  • os::windows::fs::FileTypeExt::is_symlink_file
  • These types were previously stable in std::ffi, but are now also available in core and alloc:
  • core::ffi::CStr
  • core::ffi::FromBytesWithNulError
  • alloc::ffi::CString
  • alloc::ffi::FromVecWithNulError
  • alloc::ffi::IntoStringError
  • alloc::ffi::NulError
  • These types were previously stable in std::os::raw, but are now also available in core::ffi and std::ffi:
  • ffi::c_char
  • ffi::c_double
  • ffi::c_float
  • ffi::c_int
  • ffi::c_long
  • ffi::c_longlong
  • ffi::c_schar
  • ffi::c_short
  • ffi::c_uchar
  • ffi::c_uint
  • ffi::c_ulong
  • ffi::c_ulonglong
  • ffi::c_ushort
  • These APIs are now usable in const contexts:
  • slice::from_raw_parts
  • Cargo:
  • Packages can now inherit settings from the workspace so that the settings can be centralized in one place. See workspace.package and workspace.dependencies for more details on how to define these common settings.
  • Cargo commands can now accept multiple --target flags to build for multiple targets at once, and the build.target config option may now take an array of multiple targets.
  • The --jobs argument can now take a negative number to count backwards from the max CPUs.
  • cargo add will now update Cargo.lock.
  • Added the --crate-type flag to cargo rustc to override the crate type.
  • Significantly improved the performance fetching git dependencies from GitHub when using a hash in the rev field.
  • Misc:
  • The rust-analyzer rustup component is now available on the stable channel.
  • Compatibility Notes:
  • The minimum required versions for all -linux-gnu targets are now at least kernel 3.2 and glibc 2.17, for targets that previously supported older versions: Increase the minimum linux-gnu versions
  • Network primitives are now implemented with the ideal Rust layout, not the C system layout. This can cause problems when transmuting the types.
  • Add assertion that transmute_copy's U is not larger than T
  • A soundness bug in BTreeMap was fixed that allowed data it was borrowing to be dropped before the container.
  • The Drop behavior of C-like enums cast to ints has changed. These are already discouraged by a compiler warning.
  • Relate late-bound closure lifetimes to parent fn in NLL
  • Errors at const-eval time are now in future incompatibility reports
  • On the thumbv6m-none-eabi target, some incorrect asm! statements were erroneously accepted if they used the high registers (r8 to r14) as an input/output operand. This is no longer accepted.
  • impl Trait was accidentally accepted as the associated type value of return-position impl Trait, without fulfilling all the trait bounds of that associated type, as long as the hidden type satisfies said bounds. This has been fixed.
  • 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.
  • Windows builds now use profile-guided optimization, providing 10-20% improvements to compiler performance: Utilize PGO for windows x64 rustc dist builds
  • Stop keeping metadata in memory before writing it to disk
  • compiletest: strip debuginfo by default for mode=ui
  • Many improvements to generated code for derives, including performance improvements:
  • Don't use match-destructuring for derived ops on structs.
  • Many small deriving cleanups
  • More derive output improvements
  • Clarify deriving code
  • Final derive output improvements
  • Stop injecting #[allow(unused_qualifications)] in generated derive implementations
  • Improve derive(Debug)
  • Bump to clap 3
  • fully move dropck to mir
  • Optimize Vec::insert for the case where index == len.
  • Convert rust-analyzer to an in-tree tool

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.
  • 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::::len
  • ToOwned::clone_into
  • Ipv6Addr::to_ipv4_mapped
  • unix::io::AsFd
  • unix::io::BorrowedFd
  • windows::io::OwnedHandle
  • windows::io::HandleOrInvalid
  • windows::io::HandleOrNull
  • windows::io::InvalidHandleError
  • windows::io::NullHandleError
  • windows::io::AsSocket
  • windows::io::BorrowedSocket

New in Rust 1.62.1 (Jul 20, 2022)

  • Language:
  • Stabilize #[derive(Default)] on enums with a #[default] variant
  • Teach flow sensitive checks that visibly uninhabited call expressions never return
  • 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*
  • * Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • 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 Default for AssertUnwindSafe
  • From for Rc
  • From for Arc
  • 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: doctests are now run on unexported macro_rules! macros, matching other private items
  • rustdoc: Remove .woff font files
  • Enforce Copy bounds for repeat elements while considering lifetimes
  • Windows: Fix potentinal unsoundness by aborting if File reads or writes cannot complete synchronously.
  • Internal Changes:
  • Unify ReentrantMutex implementations across all platforms
  • These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.

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*
  • * Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • 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 Default for AssertUnwindSafe
  • From for Rc
  • From for Arc
  • 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
  • These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.

New in Rust 1.61.0 (May 20, 2022)

  • Language:
  • const fn signatures can now include generic trait bounds
  • const fn signatures can now use impl Trait in argument and return position
  • Function pointers can now be created, cast, and passed around in a const fn
  • Recursive calls can now set the value of a function's opaque impl Trait return type
  • Compiler:
  • Linking modifier syntax in #[link] attributes and on the command line, as well as the whole-archive modifier specifically, are now supported
  • The char type is now described as UTF-32 in debuginfo
  • The #[target_feature] attribute can now be used with aarch64 features
  • X86 #[target_feature = "adx"] is now stable
  • Libraries:
  • ManuallyDrop is now documented to have the same layout as T
  • #[ignore = "…"] messages are printed when running tests
  • Consistently show absent stdio handles on Windows as NULL handles
  • Make std::io::stdio::lock() return 'static handles. Previously, the creation of locked handles to stdin/stdout/stderr would borrow the handles being locked, which prevented writing let out = std::io::stdout().lock(); because out would outlive the return value of stdout(). Such code now works, eliminating a common pitfall that affected many Rust users.
  • Vec::from_raw_parts is now less restrictive about its inputs
  • std::thread::available_parallelism now takes cgroup quotas into account. Since available_parallelism is often used to create a thread pool for parallel computation, which may be CPU-bound for performance, available_parallelism will return a value consistent with the ability to use that many threads continuously, if possible. For instance, in a container with 8 virtual CPUs but quotas only allowing for 50% usage, available_parallelism will return 4.
  • Stabilized APIs:
  • Pin::static_mut
  • Pin::static_ref
  • Vec::retain_mut
  • VecDeque::retain_mut
  • Write for Cursor
  • std::os::unix::net::SocketAddr::from_pathname
  • std::process::ExitCode and std::process::Termination. The stabilization of these two APIs now makes it possible for programs to return errors from main with custom exit codes.
  • std::thread::JoinHandle::is_finished
  • These APIs are now usable in const contexts:
  • ::offset and ::offset
  • ::wrapping_offset and ::wrapping_offset
  • ::add and ::add
  • ::sub and ::sub
  • ::wrapping_add and ::wrapping_add
  • ::wrapping_sub and ::wrapping_sub
  • ::as_mut_ptr
  • ::as_ptr_range
  • ::as_mut_ptr_range
  • Compatibility Notes:
  • Previously native static libraries were linked as whole-archive in some cases, but now rustc tries not to use whole-archive unless explicitly requested. This change may result in linking errors in some cases. To fix such errors, native libraries linked from the command line, build scripts, or #[link] attributes need to
  • (more common) either be reordered to respect dependencies between them (if a depends on b then a should go first and b second)
  • (less common) or be updated to use the +whole-archive modifier.
  • Catching a second unwind from FFI code while cleaning up from a Rust panic now causes the process to abort
  • Proc macros no longer see ident matchers wrapped in groups
  • The number of # in r# raw string literals is now required to be less than 256
  • When checking that a dyn type satisfies a trait bound, supertrait bounds are now enforced
  • cargo vendor now only accepts one value for each --sync flag
  • cfg predicates in all() and any() are always evaluated to detect errors, instead of short-circuiting. The compatibility considerations here arise in nightly-only code that used the short-circuiting behavior of all to write something like cfg(all(feature = "nightly", syntax-requiring-nightly)), which will now fail to compile. Instead, use either cfg_attr(feature = "nightly", ...) or nested uses of cfg.
  • bootstrap: static-libstdcpp is now enabled by default, and can now be disabled when llvm-tools is enabled
  • 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.
  • debuginfo: Refactor debuginfo generation for types
  • Remove the everybody loops pass

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
  • ::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 for ExitCode
  • Not for ! (the "never" type)
  • OpAssign for Wrapping
  • 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.
  • 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.

New in Rust 1.59.0 (Feb 24, 2022)

  • Language:
  • Stabilize default arguments for const generics
  • Stabilize destructuring assignment
  • Relax private in public lint on generic bounds and where clauses of trait impls
  • Stabilize asm! and global_asm! for x86, x86_64, ARM, Aarch64, and RISC-V
  • Compiler:
  • Stabilize new symbol mangling format, leaving it opt-in (-Csymbol-mangling-version=v0)
  • Emit LLVM optimization remarks when enabled with -Cremark
  • Fix sparc64 ABI for aggregates with floating point members
  • Warn when a #[test]-like built-in attribute macro is present multiple times.
  • Add support for riscv64gc-unknown-freebsd
  • Stabilize -Z emit-future-incompat as --json future-incompat
  • Libraries:
  • Remove unnecessary bounds for some Hash{Map,Set} methods
  • Stabilized APIs:
  • std::thread::available_parallelism
  • Result::copied
  • Result::cloned
  • arch::asm!
  • arch::global_asm!
  • ops::ControlFlow::is_break
  • ops::ControlFlow::is_continue
  • TryFrom for u8
  • char::TryFromCharError implementing Clone, Debug, Display, PartialEq, Copy, Eq, Error
  • iter::zip
  • NonZeroU8::is_power_of_two
  • NonZeroU16::is_power_of_two
  • NonZeroU32::is_power_of_two
  • NonZeroU64::is_power_of_two
  • NonZeroU128::is_power_of_two
  • DoubleEndedIterator for ToLowercase
  • DoubleEndedIterator for ToUppercase
  • TryFrom for [T; N]
  • UnwindSafe for Once
  • RefUnwindSafe for Once
  • armv8 neon intrinsics for aarch64
  • Const-stable:
  • mem::MaybeUninit::as_ptr
  • mem::MaybeUninit::assume_init
  • mem::MaybeUninit::assume_init_ref
  • ffi::CStr::from_bytes_with_nul_unchecked
  • Cargo:
  • Stabilize the strip profile option
  • Stabilize future-incompat-report
  • Support abbreviating --release as -r
  • Support term.quiet configuration
  • Remove --host from cargo {publish,search,login}
  • Compatibility Notes:
  • Refactor weak symbols in std::sys::unix This may add new, versioned, symbols when building with a newer glibc, as the standard library uses weak linkage rather than dynamically attempting to load certain symbols at runtime.
  • Deprecate crate_type and crate_name nested inside #![cfg_attr] This adds a future compatibility lint to supporting the use of cfg_attr wrapping either crate_type or crate_name specification within Rust files; it is recommended that users migrate to setting the equivalent command line flags.
  • Remove effect of #[no_link] attribute on name resolution This may expose new names, leading to conflicts with preexisting names in a given namespace and a compilation failure.
  • Cargo will document libraries before binaries.
  • Respect doc=false in dependencies, not just the root crate
  • Weaken guarantee around advancing underlying iterators in zip
  • Make split_inclusive() on an empty slice yield an empty output
  • Update std::env::temp_dir to use GetTempPath2 on Windows when available.
  • 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.
  • 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.1 (Jan 21, 2022)

  • Fix race condition in std::fs::remove_dir_all (CVE-2022-21658)
  • Handle captured arguments in the useless_format Clippy lint
  • Move non_send_fields_in_send_ty Clippy lint to nursery
  • Fix wrong error message displayed when some imports are missing
  • Fix rustfmt not formatting generated files from stdin

New in Rust 1.58.0 (Jan 14, 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
  • Make RSplit: Clone not require T: Clone
  • Implement Termination for Result. This allows writing fn main() -> Result, 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
  • 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
  • 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 3, 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

New in Rust 1.56.1 (Nov 1, 2021)

  • New lints to detect the presence of bidirectional-override Unicode codepoints in the compiled source code (CVE-2021-42574)

New in Rust 1.56.0 (Oct 22, 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*.
  • * Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • 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 for (Extend, Extend)
  • impl Default, Copy, Clone for std::io::Sink and std::io::Empty
  • impl From 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.
  • Stabilised APIs:
  • std::os::unix::fs::chroot
  • UnsafeCell::raw_get
  • BufWriter::into_parts
  • core::panic::{UnwindSafe, RefUnwindSafe, AssertUnwindSafe} These APIs were previously stable in std, but are now also available in core.
  • Vec::shrink_to
  • String::shrink_to
  • OsString::shrink_to
  • PathBuf::shrink_to
  • BinaryHeap::shrink_to
  • VecDeque::shrink_to
  • HashMap::shrink_to
  • HashSet::shrink_to
  • These APIs are now usable in const contexts:
  • std::mem::transmute
  • [T]::first
  • [T]::split_first
  • [T]::last
  • [T]::split_last
  • Cargo:
  • Cargo supports specifying a minimum supported Rust version in Cargo.toml. This has no effect at present on dependency version selection. We encourage crates to specify their minimum supported Rust version, and we encourage CI systems that support Rust code to include a crate's specified minimum version in the test matrix for that crate by default.
  • Compatibility notes:
  • Update to new argument parsing rules on Windows. This adjusts Rust's standard library to match the behavior of the standard libraries for C/C++. The rules have changed slightly over time, and this PR brings us to the latest set of rules (changed in 2008).
  • Disallow the aapcs calling convention on aarch64 This was already not supported by LLVM; this change surfaces this lack of support with a better error message.
  • Make SEMICOLON_IN_EXPRESSIONS_FROM_MACROS warn by default
  • Warn when an escaped newline skips multiple lines.
  • Calls to libc::getpid / std::process::id from Command::pre_exec may return different values on glibc

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 and AsRef.
  • 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
  • The following previously stable functions are now const:
  • str::from_utf8_unchecked
  • 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.
  • Compatibility Notes:
  • std functions that return an io::Error will no longer use the ErrorKind::Other variant. This is to better reflect that these kinds of errors could be categorised into newer more specific ErrorKind variants, and that they do not represent a user error.
  • Using environment variable names with process::Command on Windows now behaves as expected. Previously using envionment variables with Command would cause them to be ASCII-uppercased.
  • Rustdoc will now warn on using rustdoc lints that aren't prefixed with rustdoc::

New in Rust 1.54.0 (Jul 30, 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 where as before you could only have impl Trait where 'b: 'a.
  • Compiler:
  • Rustc will now search for custom JSON targets in /lib/rustlib//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 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 18, 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.
  • 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

New in Rust 1.52.1 (May 19, 2021)

  • This release disables incremental compilation, unless the user has explicitly opted in via the newly added RUSTC_FORCE_INCREMENTAL=1 environment variable.
  • This is due to the widespread, and frequently occuring, breakage encountered by Rust users due to newly enabled incremental verification in 1.52.0. Notably, Rust users should upgrade to 1.52.0 or 1.52.1: the bugs that are detected by newly added incremental verification are still present in past stable versions, and are not yet fixed on any channel. These bugs can lead to miscompilation of Rust binaries.
  • These problems only affect incremental builds, so release builds with Cargo should not be affected unless the user has explicitly opted into incremental. Debug and check builds are affected.

New in Rust 1.52.0 (May 7, 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 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. E.g.
  • - [x] Complete
  • - [ ] Todo
  • 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.
  • Refer to Rust's platform support page for more information on Rust's tiered platform support.
  • Libraries:
  • Box::downcast is now also implemented for any dyn Any + Send + Sync object.
  • str now implements AsMut.
  • u64 and u128 now implement From.
  • Error is now implemented for &T where T implements Error.
  • Poll::{map_ok, map_err} are now implemented for Poll.
  • unsigned_abs is now implemented for all signed integer types.
  • io::Empty now implements io::Seek.
  • rc::Weak and sync::Weak'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.
  • Misc:
  • You can now pass --include-ignored to tests (e.g. with cargo test -- --include-ignored) to include testing tests marked #[ignore].
  • Compatibility Notes:
  • WASI platforms no longer use the wasm-bindgen ABI, and instead use the wasm32 ABI.
  • rustc no longer promotes division, modulo and indexing operations to const that could fail.
  • The minimum version of glibc for the following platforms has been bumped to version 2.31 for the distributed artifacts.
  • armv5te-unknown-linux-gnueabi
  • sparc64-unknown-linux-gnu
  • thumbv7neon-unknown-linux-gnueabihf
  • armv7-unknown-linux-gnueabi
  • x86_64-unknown-linux-gnux32
  • Internal Only:
  • Consistently avoid constructing optimized MIR when not doing codegen

New in Rust 1.50.0 (Feb 11, 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 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.
  • 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 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 (Jan 4, 2021)

  • Language:
  • Unions can now implement Drop, and you can now have a field in a union with ManuallyDrop.
  • 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.
  • 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 21, 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= 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.
  • The matches! macro now supports having a trailing comma.
  • Vec now implements PartialEq where A: PartialEq.
  • 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
  • Cargo:
  • 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 = "")] 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.
  • 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.
  • The leading_ones, and trailing_ones methods have been stabilised for all integer types.
  • vec::IntoIter now implements AsRef.
  • All non-zero integer types (NonZeroU8) now implement TryFrom for their zero-able equivalent (e.g. TryFrom).
  • &[T] and &mut [T] now implement PartialEq.
  • (String, u16) now implements ToSocketAddrs.
  • vec::Drain

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.16.0 (Mar 27, 2017)

  • Language:
  • The compiler's dead_code lint now accounts for type aliases.
  • Uninhabitable enums (those without any variants) no longer permit wildcard match patterns
  • Clean up semantics of self in an import list
  • Self may appear in impl headers
  • Self may appear in struct expressions
  • Compiler:
  • rustc now supports --emit=metadata, which causes rustc to emit a .rmeta file containing only crate metadata. This can be used by tools like the Rust Language Service to perform metadata-only builds.
  • Levenshtein based typo suggestions now work in most places, while previously they worked only for fields and sometimes for local variables. Together with the overhaul of "no resolution"/"unexpected resolution" errors (#38154) they result in large and systematic improvement in resolution diagnostics.
  • Fix transmute:: where T requires a bigger alignment than U
  • rustc: use -Xlinker when specifying an rpath with ',' in it
  • rustc no longer attempts to provide "consider using an explicit lifetime" suggestions. They were inaccurate.
  • Stabilized APIs:
  • VecDeque::truncate
  • VecDeque::resize
  • String::insert_str
  • Duration::checked_add
  • Duration::checked_sub
  • Duration::checked_div
  • Duration::checked_mul
  • str::replacen
  • str::repeat
  • SocketAddr::is_ipv4
  • SocketAddr::is_ipv6
  • IpAddr::is_ipv4
  • IpAddr::is_ipv6
  • Vec::dedup_by
  • Vec::dedup_by_key
  • Result::unwrap_or_default
  • ::wrapping_offset
  • ::wrapping_offset
  • CommandExt::creation_flags
  • File::set_permissions
  • String::split_off
  • Libraries:
  • [T]::binary_search and [T]::binary_search_by_key now take their argument by Borrow parameter
  • All public types in std implement Debug
  • IpAddr implements From and From
  • Ipv6Addr implements From
  • Ctrl-Z returns from Stdin.read() when reading from the console on Windows
  • std: Fix partial writes in LineWriter
  • std: Clamp max read/write sizes on Unix
  • Use more specific panic message for &str slicing errors
  • TcpListener::set_only_v6 is deprecated. This functionality cannot be achieved in std currently.
  • writeln!, like println!, now accepts a form with no string or formatting arguments, to just print a newline
  • Implement iter::Sum and iter::Product for Result
  • Reduce the size of static data in std_unicode::tables
  • char::EscapeDebug, EscapeDefault, EscapeUnicode, CaseMappingIter, ToLowercase, ToUppercase, implement Display
  • Duration implements Sum
  • String implements ToSocketAddrs
  • Cargo:
  • The cargo check command does a type check of a project without building it
  • crates.io will display CI badges from Travis and AppVeyor, if specified in Cargo.toml
  • crates.io will display categories listed in Cargo.toml
  • Compilation profiles accept integer values for debug, in addition to true and false. These are passed to rustc as the value to -C debuginfo
  • Implement cargo --version --verbose
  • All builds now output 'dep-info' build dependencies compatible with make and ninja
  • Build all workspace members with build --all
  • Document all workspace members with doc --all
  • Path deps outside workspace are not members
  • Misc:
  • rustdoc has a --sysroot argument that, like rustc, specifies the path to the Rust implementation
  • The armv7-linux-androideabi target no longer enables NEON extensions, per Google's ABI guide
  • The stock standard library can be compiled for Redox OS
  • Rust has initial SPARC support. Tier 3. No builds available.
  • Rust has experimental support for Nvidia PTX. Tier 3. No builds available.
  • Fix backtraces on i686-pc-windows-gnu by disabling FPO
  • Compatibility Notes
  • Uninhabitable enums (those without any variants) no longer permit wildcard match patterns
  • In this release, references to uninhabited types can not be pattern-matched. This was accidentally allowed in 1.15.
  • The compiler's dead_code lint now accounts for type aliases.
  • Ctrl-Z returns from Stdin.read() when reading from the console on Windows
  • Clean up semantics of self in an import list

New in Rust 1.15.0 (Feb 9, 2017)

  • Language:
  • Basic procedural macros allowing custom #[derive], aka "macros 1.1", are stable. This allows popular code-generating crates like Serde and Diesel to work ergonomically. RFC 1681.
  • Tuple structs may be empty. Unary and empty tuple structs may be instantiated with curly braces. Part of RFC 1506.
  • A number of minor changes to name resolution have been activated. They add up to more consistent semantics, allowing for future evolution of Rust macros. Specified in RFC 1560, see its section on "changes" for details of what is different. The breaking changes here have been transitioned through the legacy_imports lint since 1.14, with no known regressions.
  • In macro_rules, path fragments can now be parsed as type parameter bounds
  • ?Sized can be used in where clauses
  • There is now a limit on the size of monomorphized types and it can be modified with the #![type_size_limit] crate attribute, similarly to the #![recursion_limit] attribute
  • Compiler:
  • On Windows, the compiler will apply dllimport attributes when linking to extern functions. Additional attributes and flags can control which library kind is linked and its name. RFC 1717.
  • Rust-ABI symbols are no longer exported from cdylibs
  • The --test flag works with procedural macro crates
  • Fix extern "aapcs" fn ABI
  • The -C no-stack-check flag is deprecated. It does nothing.
  • The format! expander recognizes incorrect printf and shell-style formatting directives and suggests the correct format.
  • Only report one error for all unused imports in an import list
  • Compiler Performance:
  • Avoid unnecessary mk_ty calls in Ty::super_fold_with
  • Avoid more unnecessary mk_ty calls in Ty::super_fold_with
  • Don't clone in UnificationTable::probe
  • Remove scope_auxiliary to cut RSS by 10%
  • Use small vectors in type walker
  • Macro expansion performance was improved
  • Change HirVec to HirVec in hir::Expr
  • Replace FNV with a faster hash function
  • Stabilized APIs:
  • std::iter::Iterator::min_by
  • std::iter::Iterator::max_by
  • std::os::*::fs::FileExt
  • std::sync::atomic::Atomic*::get_mut
  • std::sync::atomic::Atomic*::into_inner
  • std::vec::IntoIter::as_slice
  • std::vec::IntoIter::as_mut_slice
  • std::sync::mpsc::Receiver::try_iter
  • std::os::unix::process::CommandExt::before_exec
  • std::rc::Rc::strong_count
  • std::rc::Rc::weak_count
  • std::sync::Arc::strong_count
  • std::sync::Arc::weak_count
  • std::char::encode_utf8
  • std::char::encode_utf16
  • std::cell::Ref::clone
  • std::io::Take::into_inner
  • Libraries:
  • The standard sorting algorithm has been rewritten for dramatic performance improvements. It is a hybrid merge sort, drawing influences from Timsort. Previously it was a naive merge sort.
  • Iterator::nth no longer has a Sized bound
  • Extend is specialized for Vec where T: Copy to improve performance.
  • chars().count() is much faster and so are chars().last() and char_indices().last()
  • Fix ARM Objective-C ABI in std::env::args
  • Chinese characters display correctly in fmt::Debug
  • Derive Default for Duration
  • Support creation of anonymous pipes on WinXP/2k
  • mpsc::RecvTimeoutError implements Error
  • Don't pass overlapped handles to processes
  • Cargo:
  • In this release, Cargo build scripts no longer have access to the OUT_DIR environment variable at build time via env!("OUT_DIR"). They should instead check the variable at runtime with std::env. That the value was set at build time was a bug, and incorrect when cross-compiling. This change is known to cause breakage.
  • Add --all flag to cargo test
  • Compile statically against the MSVC CRT
  • Mix feature flags into fingerprint/metadata shorthash
  • Link OpenSSL statically on OSX
  • Apply new fingerprinting to build dir outputs
  • Test for bad path overrides with summaries
  • Require cargo install --vers to take a semver version
  • Fix retrying crate downloads for network errors
  • Implement string lookup for build.rustflags config key
  • Emit more info on --message-format=json
  • Assume build.rs in the same directory as Cargo.toml is a build script
  • Don't ignore errors in workspace manifest
  • Fix --message-format JSON when rustc emits non-JSON warnings
  • Tooling:
  • Test runners (binaries built with --test) now support a --list argument that lists the tests it contains
  • Test runners now support a --exact argument that makes the test filter match exactly, instead of matching only a substring of the test name
  • rustdoc supports a --playground-url flag
  • rustdoc provides more details about #[should_panic] errors
  • Misc:
  • The Rust build system is now written in Rust. The Makefiles may continue to be used in this release by passing --disable-rustbuild to the configure script, but they will be deleted soon. Note that the new build system uses a different on-disk layout that will likely affect any scripts building Rust.
  • Rust supports i686-unknown-openbsd. Tier 3 support. No testing or releases.
  • Rust supports the MSP430. Tier 3 support. No testing or releases.
  • Rust supports the ARMv5TE architecture. Tier 3 support. No testing or releases.
  • Compatibility Notes:
  • A number of minor changes to name resolution have been activated. They add up to more consistent semantics, allowing for future evolution of Rust macros. Specified in RFC 1560, see its section on "changes" for details of what is different. The breaking changes here have been transitioned through the legacy_imports lint since 1.14, with no known regressions.
  • In this release, Cargo build scripts no longer have access to the OUT_DIR environment variable at build time via env!("OUT_DIR"). They should instead check the variable at runtime with std::env. That the value was set at build time was a bug, and incorrect when cross-compiling. This change is known to cause breakage.
  • Higher-ranked lifetimes are no longer allowed to appear only in associated types. The hr_lifetime_in_assoc_type lint has been a warning since 1.10 and is now an error by default. It will become a hard error in the near future.
  • The semantics relating modules to file system directories are changing in minor ways. This is captured in the new legacy_directory_ownership lint, which is a warning in this release, and will become a hard error in the future.
  • Rust-ABI symbols are no longer exported from cdylibs
  • Once Peekable peeks a None it will return that None without re-querying the underlying iterator

New in Rust 1.13.0 (Nov 21, 2016)

  • Language:
  • Stabilize the ? operator. ? is a simple way to propagate errors, like the try! macro, described in RFC 0243.
  • Stabilize macros in type position. Described in RFC 873.
  • Stabilize attributes on statements. Described in RFC 0016.
  • Fix #[derive] for empty tuple structs/variants
  • Fix lifetime rules for 'if' conditions
  • Avoid loading and parsing unconfigured non-inline modules
  • Compiler:
  • Add the -C link-arg argument
  • Remove the old AST-based backend from rustc_trans
  • Don't enable NEON by default on armv7 Linux
  • Fix debug line number info for macro expansions
  • Do not emit "class method" debuginfo for types that are not DICompositeType
  • Warn about multiple conflicting #[repr] hints
  • When sizing DST, don't double-count nested struct prefixes
  • Default RUST_MIN_STACK to 16MiB for now
  • Improve rlib metadata format. Reduces rlib size significantly.
  • Reject macros with empty repetitions to avoid infinite loop
  • Expand macros without recursing to avoid stack overflows
  • Diagnostics:
  • Replace macro backtraces with labeled local uses
  • Improve error message for missplaced doc comments
  • Buffer unix and lock windows to prevent message interleaving
  • Update lifetime errors to specifically note temporaries
  • Special case a few colors for Windows
  • Suggest use self when such an import resolves
  • Be more specific when type parameter shadows primitive type
  • Many minor improvements
  • Compile-time Optimizations:
  • Compute and cache HIR hashes at beginning
  • Don't hash types in loan paths
  • Cache projections in trans
  • Optimize the parser's last token handling
  • Only instantiate #[inline] functions in codegen units referencing them. This leads to big improvements in cases where crates export define many inline functions without using them directly.
  • Lazily allocate TypedArena's first chunk
  • Don't allocate during default HashSet creation
  • Stabilized APIs:
  • checked_abs
  • wrapping_abs
  • overflowing_abs
  • RefCell::try_borrow
  • RefCell::try_borrow_mut
  • Libraries:
  • Add assert_ne! and debug_assert_ne!
  • Make vec_deque::Drain, hash_map::Drain, and hash_set::Drain covariant
  • Implement AsRef for std::slice::Iter
  • Implement Debug for std::vec::IntoIter
  • CString: avoid excessive growth just to 0-terminate
  • Implement CoerceUnsized for {Cell, RefCell, UnsafeCell}
  • Use arc4rand on FreeBSD
  • memrchr: Correct aligned offset computation
  • Improve Demangling of Rust Symbols
  • Use monotonic time in condition variables
  • Implement Debug for std::path::{Components,Iter}
  • Implement conversion traits for char
  • Fix illegal instruction caused by overflow in channel cloning
  • Zero first byte of CString on drop
  • Inherit overflow checks for sum and product
  • Add missing Eq implementations
  • Implement Debug for DirEntry
  • When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno
  • SipHasher is deprecated. Use DefaultHasher.
  • Implement more traits for std::io::ErrorKind
  • Optimize BinaryHeap bounds checking
  • Work around pointer aliasing issue in Vec::extend_from_slice, extend_with_element
  • Fix overflow checking in unsigned pow()
  • Cargo:
  • This release includes security fixes to both curl and OpenSSL.
  • Fix transitive doctests when panic=abort
  • Add --all-features flag to cargo
  • Reject path-based dependencies in cargo package
  • Don't parse the home directory more than once
  • Don't try to generate Cargo.lock on empty workspaces
  • Update OpenSSL to 1.0.2j
  • Add license and license_file to cargo metadata output
  • Make crates-io registry URL optional in config; ignore all changes to source.crates-io
  • Don't download dependencies from other platforms
  • Build transitive dev-dependencies when needed
  • Add support for per-target rustflags in .cargo/config
  • Avoid updating registry when adding existing deps
  • Warn about path overrides that won't work
  • Use workspaces during cargo install
  • Leak mspdbsrv.exe processes on Windows
  • Add --message-format flag
  • Pass target environment for rustdoc
  • Use CommandExt::exec for cargo run on Unix
  • Update curl and curl-sys
  • Call rustdoc test with the correct cfg flags of a package
  • Tooling:
  • rustdoc: Add the --sysroot argument
  • rustdoc: Fix a couple of issues with the search results
  • rustdoc: remove the ! from macro URLs and titles
  • gdb: Fix pretty-printing special-cased Rust types
  • rustdoc: Filter more incorrect methods inherited through Deref
  • Misc:
  • Remove unmaintained style guide
  • Add s390x support
  • Initial work at Haiku OS support
  • Add mips-uclibc targets
  • Crate-ify compiler-rt into compiler-builtins
  • Add rustc version info (git hash + date) to dist tarball
  • Many documentation improvements
  • Compatibility Notes:
  • SipHasher is deprecated. Use DefaultHasher.
  • Deny (by default) transmuting from fn item types to pointer-sized types. Continuing the long transition to zero-sized fn items, per RFC 401.
  • Fix #[derive] for empty tuple structs/variants. Part of RFC 1506.
  • Issue deprecation warnings for safe accesses to extern statics
  • Fix lifetime rules for 'if' conditions.
  • Inherit overflow checks for sum and product.
  • Forbid user-defined macros named "macro_rules".

New in Rust 1.12.0 (Oct 3, 2016)

  • Highlights:
  • rustc translates code to LLVM IR via its own "middle" IR (MIR). This translation pass is far simpler than the previous AST->LLVM pass, and creates opportunities to perform new optimizations directly on the MIR. It was previously described on the Rust blog.
  • rustc presents a new, more readable error format, along with machine-readable JSON error output for use by IDEs. Most common editors supporting Rust have been updated to work with it. It was previously described on the Rust blog.
  • Compiler:
  • rustc translates code to LLVM IR via its own "middle" IR (MIR). This translation pass is far simpler than the previous AST->LLVM pass, and creates opportunities to perform new optimizations directly on the MIR. It was previously described on the Rust blog.
  • Print the Rust target name, not the LLVM target name, with --print target-list
  • The computation of TypeId is correct in some cases where it was previously producing inconsistent results
  • The mips-unknown-linux-gnu target uses hardware floating point by default
  • The rustc arguments, --print target-cpus, --print target-features, --print relocation-models, and --print code-models print the available options to the -C target-cpu, -C target-feature, -C relocation-model and -C code-model code generation arguments
  • rustc supports three new MUSL targets on ARM: arm-unknown-linux-musleabi, arm-unknown-linux-musleabihf, and armv7-unknown-linux-musleabihf. These targets produce statically-linked binaries. There are no binary release builds yet though.
  • Diagnostics:
  • rustc presents a new, more readable error format, along with machine-readable JSON error output for use by IDEs. Most common editors supporting Rust have been updated to work with it. It was previously described on the Rust blog.
  • In error descriptions, references are now described in plain English, instead of as "&-ptr"
  • In error type descriptions, unknown numeric types are named {integer} or {float} instead of _
  • rustc emits a clearer error when inner attributes follow a doc comment
  • Language:
  • macro_rules! invocations can be made within macro_rules! invocations
  • macro_rules! meta-variables are hygienic
  • macro_rules! tt matchers can be reparsed correctly, making them much more useful
  • macro_rules! stmt matchers correctly consume the entire contents when inside non-braces invocations
  • Semicolons are properly required as statement delimeters inside macro_rules! invocations
  • cfg_attr works on path attributes
  • Stabilized APIs:
  • Cell::as_ptr
  • RefCell::as_ptr
  • IpAddr::is_unspecified
  • IpAddr::is_loopback
  • IpAddr::is_multicast
  • Ipv4Addr::is_unspecified
  • Ipv6Addr::octets
  • LinkedList::contains
  • VecDeque::contains
  • ExitStatusExt::from_raw. Both on Unix and Windows.
  • Receiver::recv_timeout
  • RecvTimeoutError
  • BinaryHeap::peek_mut
  • PeekMut
  • iter::Product
  • iter::Sum
  • OccupiedEntry::remove_entry
  • VacantEntry::into_key
  • Libraries:
  • The format! macro and friends now allow a single argument to be formatted in multiple styles
  • The lifetime bounds on [T]::binary_search_by and [T]::binary_search_by_key have been adjusted to be more flexible
  • Option implements From for its contained type
  • Cell, RefCell and UnsafeCell implement From for their contained type
  • RwLock panics if the reader count overflows
  • vec_deque::Drain, hash_map::Drain and hash_set::Drain are covariant
  • vec::Drain and binary_heap::Drain are covariant
  • Cow implements FromIterator for char, &str and String
  • Sockets on Linux are correctly closed in subprocesses via SOCK_CLOEXEC
  • hash_map::Entry, hash_map::VacantEntry and hash_map::OccupiedEntry implement Debug
  • btree_map::Entry, btree_map::VacantEntry and btree_map::OccupiedEntry implement Debug
  • String implements AddAssign
  • Variadic extern fn pointers implement the Clone, PartialEq, Eq, PartialOrd, Ord, Hash, fmt::Pointer, and fmt::Debug traits
  • FileType implements Debug
  • References to Mutex and RwLock are unwind-safe
  • mpsc::sync_channel Receivers return any available message before reporting a disconnect
  • Unicode definitions have been updated to 9.0
  • env iterators implement DoubleEndedIterator
  • Cargo:
  • Support local mirrors of registries
  • Add support for command aliases
  • Allow opt-level="s" / opt-level="z" in profile overrides
  • Make cargo doc --open --target work as expected
  • Speed up noop registry updates
  • Update OpenSSL
  • Fix --panic=abort with plugins
  • Always pass -C metadata to the compiler
  • Fix depending on git repos with workspaces
  • Add a --lib flag to cargo new
  • Add http.cainfo for custom certs
  • Indicate the compilation profile after compiling
  • Allow enabling features for dependencies with --features
  • Add --jobs flag to cargo package
  • Add --dry-run to cargo publish
  • Add support for RUSTDOCFLAGS
  • Performance:
  • panic::catch_unwind is more optimized
  • panic::catch_unwind no longer accesses thread-local storage on entry:
  • Tooling:
  • Test binaries now support a --test-threads argument to specify the number of threads used to run tests, and which acts the same as the RUST_TEST_THREADS environment variable
  • The test runner now emits a warning when tests run over 60 seconds
  • rustdoc: Fix methods in search results
  • rust-lldb warns about unsupported versions of LLDB
  • Rust releases now come with source packages that can be installed by rustup via rustup component add rust-src. The resulting source code can be used by tools and IDES, located in the sysroot under lib/rustlib/src.
  • Misc:
  • The compiler can now be built against LLVM 3.9
  • Many minor improvements to the documentation.
  • The Rust exception handling "personality" routine is now written in Rust:
  • Compatibility Notes:
  • When printing Windows OsStrs, unpaired surrogate codepoints are escaped with the lowercase format instead of the uppercase
  • When formatting strings, if "precision" is specified, the "fill", "align" and "width" specifiers are no longer ignored
  • The Debug impl for strings no longer escapes all non-ASCII characters

New in Rust 1.10.0 (Jul 8, 2016)

  • Language:
  • Allow concat_idents! in type positions as well as in expression positions.
  • Copy types are required to have a trivial implementation of Clone. RFC 1521.
  • Single-variant enums support the #[repr(..)] attribute.
  • Fix #[derive(RustcEncodable)] in the presence of other encode methods.
  • panic! can be converted to a runtime abort with the -C panic=abort flag. RFC 1513.
  • Add a new crate type, 'cdylib'. cdylibs are dynamic libraries suitable for loading by non-Rust hosts. RFC 1510. Note that Cargo does not yet directly support cdylibs.
  • Stabilized APIs:
  • os::windows::fs::OpenOptionsExt::access_mode
  • os::windows::fs::OpenOptionsExt::share_mode
  • os::windows::fs::OpenOptionsExt::custom_flags
  • os::windows::fs::OpenOptionsExt::attributes
  • os::windows::fs::OpenOptionsExt::security_qos_flags
  • os::unix::fs::OpenOptionsExt::custom_flags
  • sync::Weak::new
  • Default for sync::Weak
  • panic::set_hook
  • panic::take_hook
  • panic::PanicInfo
  • panic::PanicInfo::payload
  • panic::PanicInfo::location
  • panic::Location
  • panic::Location::file
  • panic::Location::line
  • ffi::CStr::from_bytes_with_nul
  • ffi::CStr::from_bytes_with_nul_unchecked
  • ffi::FromBytesWithNulError
  • fs::Metadata::modified
  • fs::Metadata::accessed
  • fs::Metadata::created
  • sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange
  • sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak
  • collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key
  • os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}
  • SocketAddr::is_unnamed
  • SocketAddr::as_pathname
  • UnixStream::connect
  • UnixStream::pair
  • UnixStream::try_clone
  • UnixStream::local_addr
  • UnixStream::peer_addr
  • UnixStream::set_read_timeout
  • UnixStream::set_write_timeout
  • UnixStream::read_timeout
  • UnixStream::write_timeout
  • UnixStream::set_nonblocking
  • UnixStream::take_error
  • UnixStream::shutdown
  • Read/Write/RawFd impls for UnixStream
  • UnixListener::bind
  • UnixListener::accept
  • UnixListener::try_clone
  • UnixListener::local_addr
  • UnixListener::set_nonblocking
  • UnixListener::take_error
  • UnixListener::incoming
  • RawFd impls for UnixListener
  • UnixDatagram::bind
  • UnixDatagram::unbound
  • UnixDatagram::pair
  • UnixDatagram::connect
  • UnixDatagram::try_clone
  • UnixDatagram::local_addr
  • UnixDatagram::peer_addr
  • UnixDatagram::recv_from
  • UnixDatagram::recv
  • UnixDatagram::send_to
  • UnixDatagram::send
  • UnixDatagram::set_read_timeout
  • UnixDatagram::set_write_timeout
  • UnixDatagram::read_timeout
  • UnixDatagram::write_timeout
  • UnixDatagram::set_nonblocking
  • UnixDatagram::take_error
  • UnixDatagram::shutdown
  • RawFd impls for UnixDatagram
  • {BTree,Hash}Map::values_mut
  • ::binary_search_by_key:
  • Libraries:
  • The abs_sub method of floats is deprecated. The semantics of this minor method are subtle and probably not what most people want.
  • Add implementation of Ord for Cell and RefCell where T: Ord.
  • On Linux, if HashMaps can't be initialized with getrandom they will fall back to /dev/urandom temporarily to avoid blocking during early boot.
  • Implemented negation for wrapping numerals.
  • Implement Clone for binary_heap::IntoIter.
  • Implement Display and Hash for std::num::Wrapping.
  • Add Default implementation for &CStr, CString.
  • Implement From and Into for VecDeque.
  • Implement Default for UnsafeCell, fmt::Error, Condvar, Mutex, RwLock.
  • Cargo:
  • Cargo.toml supports the profile.*.panic option. This controls the runtime behavior of the panic! macro and can be either "unwind" (the default), or "abort". RFC 1513.
  • Don't throw away errors with -p arguments.
  • Report status to stderr instead of stdout.
  • Build scripts are passed a CARGO_MANIFEST_LINKS environment variable that corresponds to the links field of the manifest.
  • Ban keywords from crate names.
  • Canonicalize CARGO_HOME on Windows.
  • Retry network requests. By default they are retried twice, which can be customized with the net.retry value in .cargo/config.
  • Don't print extra error info for failing subcommands.
  • Add --force flag to cargo install.
  • Don't use flock on NFS mounts.
  • Prefer building cargo install artifacts in temporary directories. Makes it possible to install multiple crates in parallel.
  • Add cargo test --doc.
  • Add cargo --explain.
  • Don't print warnings when -q is passed.
  • Add cargo doc --lib and --bin.
  • Don't require build script output to be UTF-8.
  • Correctly attempt multiple git usernames.
  • Performance:
  • rustc memory usage was reduced by refactoring the context used for type checking.
  • Speed up creation of HashMaps by caching the random keys used to initialize the hash state.
  • The find implementation for Chain iterators is 2x faster.
  • Trait selection optimizations speed up type checking by 15%.
  • Efficient trie lookup for boolean Unicode properties. 10x faster than the previous lookup tables.
  • Special case #[derive(Copy, Clone)] to avoid bloat.
  • Usability:
  • Many incremental improvements to documentation and rustdoc.
  • rustdoc: List blanket trait impls.
  • rustdoc: Clean up ABI rendering.
  • Indexing with the wrong type produces a more informative error.
  • Improve diagnostics for constants being used in irrefutable patterns.
  • When many method candidates are in scope limit the suggestions to 10.
  • Remove confusing suggestion when calling a fn type.
  • Do not suggest changing &mut self to &mut mut self.
  • Misc:
  • Update i686-linux-android features to match Android ABI.
  • Update aarch64-linux-android features to match Android ABI.
  • std no longer prints backtraces on platforms where the running module must be loaded with env::current_exe, which can't be relied on.
  • This release includes std binaries for the i586-unknown-linux-gnu, i686-unknown-linux-musl, and armv7-linux-androideabi targets. The i586 target is for old x86 hardware without SSE2, and the armv7 target is for Android running on modern ARM architectures.
  • The rust-gdb and rust-lldb scripts are distributed on all Unix platforms.
  • On Unix the runtime aborts by calling libc::abort instead of generating an illegal instruction.
  • Rust is now bootstrapped from the previous release of Rust, instead of a snapshot from an arbitrary commit.
  • Compatibility Notes:
  • AtomicBool is now bool-sized, not word-sized.
  • target_env for Linux ARM targets is just gnu, not gnueabihf, gnueabi, etc.
  • Consistently panic on overflow in Duration::new.
  • Change String::truncate to panic less.
  • Add :block to the follow set for :ty and :path. Affects how macros are parsed.
  • Fix macro hygiene bug.
  • Feature-gated attributes on macro-generated macro invocations are now rejected.
  • Suppress fallback and ambiguity errors during type inference. This caused some minor changes to type inference.

New in Rust 1.9.0 (May 27, 2016)

  • Language:
  • The #[deprecated] attribute when applied to an API will generate warnings when used. The warnings may be suppressed with #[allow(deprecated)]. RFC 1270.
  • fn item types are zero sized, and each fn names a unique type. This will break code that transmutes fns, so calling transmute on a fn type will generate a warning for a few cycles, then will be converted to an error.
  • Field and method resolution understand visibility, so private fields and methods cannot prevent the proper use of public fields and methods.
  • The parser considers unicode codepoints in the PATTERN_WHITE_SPACE category to be whitespace.
  • Stabilized APIs:
  • std::panic
  • std::panic::catch_unwind (renamed from recover)
  • std::panic::resume_unwind (renamed from propagate)
  • std::panic::AssertUnwindSafe (renamed from AssertRecoverSafe)
  • std::panic::UnwindSafe (renamed from RecoverSafe)
  • str::is_char_boundary
  • ::as_ref
  • ::as_ref
  • ::as_mut
  • AsciiExt::make_ascii_uppercase
  • AsciiExt::make_ascii_lowercase
  • char::decode_utf16
  • char::DecodeUtf16
  • char::DecodeUtf16Error
  • char::DecodeUtf16Error::unpaired_surrogate
  • BTreeSet::take
  • BTreeSet::replace
  • BTreeSet::get
  • HashSet::take
  • HashSet::replace
  • HashSet::get
  • OsString::with_capacity
  • OsString::clear
  • OsString::capacity
  • OsString::reserve
  • OsString::reserve_exact
  • OsStr::is_empty
  • OsStr::len
  • std::os::unix::thread
  • RawPthread
  • JoinHandleExt
  • JoinHandleExt::as_pthread_t
  • JoinHandleExt::into_pthread_t
  • HashSet::hasher
  • HashMap::hasher
  • CommandExt::exec
  • File::try_clone
  • SocketAddr::set_ip
  • SocketAddr::set_port
  • SocketAddrV4::set_ip
  • SocketAddrV4::set_port
  • SocketAddrV6::set_ip
  • SocketAddrV6::set_port
  • SocketAddrV6::set_flowinfo
  • SocketAddrV6::set_scope_id
  • slice::copy_from_slice
  • ptr::read_volatile
  • ptr::write_volatile
  • OpenOptions::create_new
  • TcpStream::set_nodelay
  • TcpStream::nodelay
  • TcpStream::set_ttl
  • TcpStream::ttl
  • TcpStream::set_only_v6
  • TcpStream::only_v6
  • TcpStream::take_error
  • TcpStream::set_nonblocking
  • TcpListener::set_ttl
  • TcpListener::ttl
  • TcpListener::set_only_v6
  • TcpListener::only_v6
  • TcpListener::take_error
  • TcpListener::set_nonblocking
  • UdpSocket::set_broadcast
  • UdpSocket::broadcast
  • UdpSocket::set_multicast_loop_v4
  • UdpSocket::multicast_loop_v4
  • UdpSocket::set_multicast_ttl_v4
  • UdpSocket::multicast_ttl_v4
  • UdpSocket::set_multicast_loop_v6
  • UdpSocket::multicast_loop_v6
  • UdpSocket::set_multicast_ttl_v6
  • UdpSocket::multicast_ttl_v6
  • UdpSocket::set_ttl
  • UdpSocket::ttl
  • UdpSocket::set_only_v6
  • UdpSocket::only_v6
  • UdpSocket::join_multicast_v4
  • UdpSocket::join_multicast_v6
  • UdpSocket::leave_multicast_v4
  • UdpSocket::leave_multicast_v6
  • UdpSocket::take_error
  • UdpSocket::connect
  • UdpSocket::send
  • UdpSocket::recv
  • UdpSocket::set_nonblocking
  • Libraries:
  • std::sync::Once is poisoned if its initialization function fails.
  • cell::Ref and cell::RefMut can contain unsized types.
  • Most types implement fmt::Debug.
  • The default buffer size used by BufReader and BufWriter was reduced to 8K, from 64K. This is in line with the buffer size used by other languages.
  • Instant, SystemTime and Duration implement += and -=. Duration additionally implements *= and /=.
  • Skip is a DoubleEndedIterator.
  • From is implemented for Ipv4Addr.
  • Chain implements BufRead.
  • HashMap, HashSet and iterators are covariant.
  • Cargo:
  • Cargo can now run concurrently.
  • Top-level overrides allow specific revisions of crates to be overridden through the entire crate graph. This is intended to make upgrades easier for large projects, by allowing crates to be forked temporarily until they've been upgraded and republished.
  • Cargo exports a CARGO_PKG_AUTHORS environment variable.
  • Cargo will pass the contents of the RUSTFLAGS variable to rustc on the commandline. rustc arguments can also be specified in the build.rustflags configuration key.
  • Performance:
  • The time complexity of comparing variables for equivalence during type unification is reduced from O(n!) to O(n). This leads to major compilation time improvement in some scenarios.
  • ToString is specialized for str, giving it the same performance as to_owned.
  • Spawning processes with Command::output no longer creates extra threads.
  • #[derive(PartialEq)] and #[derive(PartialOrd)] emit less code for C-like enums.
  • Misc:
  • Passing the --quiet flag to a test runner will produce much-abbreviated output.
  • The Rust Project now publishes std binaries for the mips-unknown-linux-musl, mipsel-unknown-linux-musl, and i586-pc-windows-msvc targets.
  • Compatibility Notes:
  • std::sync::Once is poisoned if its initialization function fails.
  • It is illegal to define methods with the same name in overlapping inherent impl blocks.
  • fn item types are zero sized, and each fn names a unique type. This will break code that transmutes fns, so calling transmute on a fn type will generate a warning for a few cycles, then will be converted to an error.
  • Improvements to const evaluation may trigger new errors when integer literals are out of range.

New in Rust 1.8.0 (Apr 16, 2016)

  • LANGUAGE:
  • Rust supports overloading of compound assignment statements like += by implementing the AddAssign, SubAssign, MulAssign, DivAssign, RemAssign, BitAndAssign, BitOrAssign, BitXorAssign, ShlAssign, or ShrAssign traits. RFC 953.
  • Empty structs can be defined with braces, as in struct Foo { }, in addition to the non-braced form, struct Foo;. RFC 218.
  • LIBRARIES:
  • The write! and writeln! macros correctly emit errors if any of their arguments can't be formatted.
  • Various I/O functions support large files on 32-bit Linux.
  • The Unix-specific raw modules, which contain a number of redefined C types are deprecated, including os::raw::unix, os::raw::macos, and os::raw::linux. These modules defined types such as ino_t and dev_t. The inconsistency of these definitions across platforms was making it difficult to implement std correctly. Those that need these definitions should use the libc crate. RFC 1415.
  • The Unix-specific MetadataExt traits, including os::unix::fs::MetadataExt, which expose values such as inode numbers no longer return platform-specific types, but instead return widened integers. RFC 1415.
  • btree_set::{IntoIter, Iter, Range} are covariant.
  • Atomic loads and stores are not volatile.
  • All types in sync::mpsc implement fmt::Debug.
  • Stabilized APIs:
  • str::encode_utf16 (renamed from utf16_units)
  • str::EncodeUtf16 (renamed from Utf16Units)
  • Ref::map
  • RefMut::map
  • ptr::drop_in_place
  • time::Instant
  • time::SystemTime
  • Instant::now
  • Instant::duration_since (renamed from duration_from_earlier)
  • Instant::elapsed
  • SystemTime::now
  • SystemTime::duration_since (renamed from duration_from_earlier)
  • SystemTime::elapsed
  • Various Add/Sub impls for Time and SystemTime
  • SystemTimeError
  • SystemTimeError::duration
  • Various impls for SystemTimeError
  • UNIX_EPOCH
  • AddAssign, SubAssign, MulAssign, DivAssign, RemAssign, BitAndAssign, BitOrAssign, BitXorAssign, ShlAssign, ShrAssign.
  • PERFORMANCE:
  • Inlining hash functions lead to a 3% compile-time improvement in some workloads.
  • When using jemalloc, its symbols are unprefixed so that it overrides the libc malloc implementation. This means that for rustc, LLVM is now using jemalloc, which results in a 6% compile-time improvement on a specific workload.
  • Avoid quadratic growth in function size due to cleanups.
  • MISC:
  • 32-bit MSVC builds finally implement unwinding. i686-pc-windows-msvc is now considered a tier-1 platform.
  • The --print targets flag prints a list of supported targets.
  • The --print cfg flag prints the cfgs defined for the current target.
  • rustc can be built with an new Cargo-based build system, written in Rust. It will eventually replace Rust's Makefile-based build system. To enable it configure with configure --rustbuild.
  • Errors for non-exhaustive match patterns now list up to 3 missing variants while also indicating the total number of missing variants if more than 3.
  • Executable stacks are disabled on Linux and BSD.
  • The Rust Project now publishes binary releases of the standard library for a number of tier-2 targets: armv7-unknown-linux-gnueabihf, powerpc-unknown-linux-gnu, powerpc64-unknown-linux-gnu, powerpc64le-unknown-linux-gnu x86_64-rumprun-netbsd. These can be installed with tools such as multirust.
  • CARGO:
  • cargo init creates a new Cargo project in the current directory. It is otherwise like cargo new.
  • Cargo has configuration keys for -v and --color. verbose and color, respectively, go in the [term] section of .cargo/config.
  • Configuration keys that evaluate to strings or integers can be set via environment variables. For example the build.jobs key can be set via CARGO_BUILD_JOBS. Environment variables take precedence over config files.
  • Target-specific dependencies support Rust cfg syntax for describing targets so that dependencies for multiple targets can be specified together. RFC 1361.
  • The environment variables CARGO_TARGET_ROOT, RUSTC, and RUSTDOC take precedence over the build.target-dir, build.rustc, and build.rustdoc configuration values.
  • The child process tree is killed on Windows when Cargo is killed.
  • The build.target configuration value sets the target platform, like --target.
  • COMPATIBILITY NOTES:
  • Unstable compiler flags have been further restricted. Since 1.0 -Z flags have been considered unstable, and other flags that were considered unstable additionally required passing -Z unstable-options to access. Unlike unstable language and library features though, these options have been accessible on the stable release channel. Going forward, new unstable flags will not be available on the stable release channel, and old unstable flags will warn about their usage. In the future, all unstable flags will be unavailable on the stable release channel.
  • It is no longer possible to match on empty enum variants using the Variant(..) syntax. This has been a warning since 1.6.
  • The Unix-specific MetadataExt traits, including os::unix::fs::MetadataExt, which expose values such as inode numbers no longer return platform-specific types, but instead return widened integers. RFC 1415.
  • Modules sourced from the filesystem cannot appear within arbitrary blocks, but only within other modules.
  • --cfg compiler flags are parsed strictly as identifiers.
  • On Unix, stack overflow triggers a runtime abort instead of a SIGSEGV.
  • Command::spawn and its equivalents return an error if any of its command-line arguments contain interior NULs.
  • Tuple and unit enum variants from other crates are in the type namespace.
  • On Windows rustc emits .lib files for the staticlib library type instead of .a files. Additionally, for the MSVC toolchain, rustc emits import libraries named foo.dll.lib instead of foo.lib.

New in Rust 1.7.0 (Mar 4, 2016)

  • LIBRARIES:
  • Validating UTF-8 is faster by a factor of between 7 and 14x for ASCII input. This means that creating Strings and strs from bytes is faster.
  • The performance of LineWriter (and thus io::stdout) was improved by using memchr to search for newlines.
  • f32::to_degrees and f32::to_radians are stable. The f64 variants were stabilized previously.
  • BTreeMap was rewritten to use less memory and improve the performance of insertion and iteration, the latter by as much as 5x.
  • BTreeSet and its iterators, Iter, IntoIter, and Range are covariant over their contained type.
  • LinkedList and its iterators, Iter and IntoIter are covariant over their contained type.
  • str::replace now accepts a Pattern, like other string searching methods.
  • Any is implemented for unsized types.
  • Hash is implemented for Duration.
  • Stabilized APIs:
  • Path:
  • Path::strip_prefix (renamed from relative_from)
  • path::StripPrefixError (new error type returned from strip_prefix)
  • Ipv4Addr:
  • Ipv4Addr::is_loopback
  • Ipv4Addr::is_private
  • Ipv4Addr::is_link_local
  • Ipv4Addr::is_multicast
  • Ipv4Addr::is_broadcast
  • Ipv4Addr::is_documentation
  • Ipv6Addr:
  • Ipv6Addr::is_unspecified
  • Ipv6Addr::is_loopback
  • Ipv6Addr::is_multicast
  • Vec:
  • Vec::as_slice
  • Vec::as_mut_slice
  • String:
  • String::as_str
  • String::as_mut_str
  • Slices:
  • ::clone_from_slice, which now requires the two slices to be the same length
  • ::sort_by_key
  • checked, saturated, and overflowing operations
  • i32::checked_rem, i32::checked_neg, i32::checked_shl, i32::checked_shr
  • i32::saturating_mul
  • i32::overflowing_add, i32::overflowing_sub, i32::overflowing_mul, i32::overflowing_div
  • i32::overflowing_rem, i32::overflowing_neg, i32::overflowing_shl, i32::overflowing_shr
  • u32::checked_rem, u32::checked_neg, u32::checked_shl, u32::checked_shl
  • u32::saturating_mul
  • u32::overflowing_add, u32::overflowing_sub, u32::overflowing_mul, u32::overflowing_div
  • u32::overflowing_rem, u32::overflowing_neg, u32::overflowing_shl, u32::overflowing_shr
  • and checked, saturated, and overflowing operations for other primitive types
  • FFI:
  • ffi::IntoStringError
  • CString::into_string
  • CString::into_bytes
  • CString::into_bytes_with_nul
  • From for Vec
  • IntoStringError:
  • IntoStringError::into_cstring
  • IntoStringError::utf8_error
  • Error for IntoStringError
  • Hashing:
  • std::hash::BuildHasher
  • BuildHasher::Hasher
  • BuildHasher::build_hasher
  • std::hash::BuildHasherDefault
  • HashMap::with_hasher
  • HashMap::with_capacity_and_hasher
  • HashSet::with_hasher
  • HashSet::with_capacity_and_hasher
  • std::collections::hash_map::RandomState
  • RandomState::new
  • MISC:
  • When running tests with --test, rustdoc will pass --cfg arguments to the compiler.
  • The compiler is built with RPATH information by default. This means that it will be possible to run rustc when installed in unusual configurations without configuring the dynamic linker search path explicitly.
  • rustc passes --enable-new-dtags to GNU ld. This makes any RPATH entries (emitted with -C rpath) not take precedence over LD_LIBRARY_PATH.
  • CARGO:
  • cargo rustc accepts a --profile flag that runs rustc under any of the compilation profiles, 'dev', 'bench', or 'test'.
  • The rerun-if-changed build script directive no longer causes the build script to incorrectly run twice in certain scenarios.
  • COMPATIBILITY NOTES:
  • Soundness fixes to the interactions between associated types and lifetimes, specified in RFC 1214, now generate errors for code that violates the new rules. This is a significant change that is known to break existing code, so it has emitted warnings for the new error cases since 1.4 to give crate authors time to adapt. The details of what is changing are subtle; read the RFC for more.
  • Several bugs in the compiler's visibility calculations were fixed. Since this was found to break significant amounts of code, the new errors will be emitted as warnings for several release cycles, under the private_in_public lint.
  • Defaulted type parameters were accidentally accepted in positions that were not intended. In this release, defaulted type parameters appearing outside of type definitions will generate a warning, which will become an error in future releases.
  • Parsing "." as a float results in an error instead of 0. That is, ".".parse::() returns Err, not Ok(0).
  • Borrows of closure parameters may not outlive the closure.

New in Rust 1.6.0 (Mar 4, 2016)

  • Language:
  • The #![no_std] attribute causes a crate to not be linked to the standard library, but only the core library, as described in RFC 1184. The core library defines common types and traits but has no platform dependencies whatsoever, and is the basis for Rust software in environments that cannot support a full port of the standard library, such as operating systems. Most of the core library is now stable.
  • Libraries:
  • Stabilized APIs: Read::read_exact, ErrorKind::UnexpectedEof (renamed from UnexpectedEOF), fs::DirBuilder, fs::DirBuilder::new, fs::DirBuilder::recursive, fs::DirBuilder::create, os::unix::fs::DirBuilderExt, os::unix::fs::DirBuilderExt::mode, vec::Drain, vec::Vec::drain, string::Drain, string::String::drain, vec_deque::Drain, vec_deque::VecDeque::drain, collections::hash_map::Drain, collections::hash_map::HashMap::drain, collections::hash_set::Drain, collections::hash_set::HashSet::drain, collections::binary_heap::Drain, collections::binary_heap::BinaryHeap::drain, Vec::extend_from_slice (renamed from push_all), Mutex::get_mut, Mutex::into_inner, RwLock::get_mut, RwLock::into_inner, Iterator::min_by_key (renamed from min_by), Iterator::max_by_key (renamed from max_by).
  • The core library is stable, as are most of its APIs.
  • The assert_eq! macro supports arguments that don't implement Sized, such as arrays. In this way it behaves more like assert!.
  • Several timer functions that take duration in milliseconds are deprecated in favor of those that take Duration. These include Condvar::wait_timeout_ms, thread::sleep_ms, and thread::park_timeout_ms.
  • The algorithm by which Vec reserves additional elements was tweaked to not allocate excessive space while still growing exponentially.
  • From conversions are implemented from integers to floats in cases where the conversion is lossless. Thus they are not implemented for 32-bit ints to f32, nor for 64-bit ints to f32 or f64. They are also not implemented for isize and usize because the implementations would be platform-specific. From is also implemented from f32 to f64.
  • From and From are implemented for Cow.
  • From is implemented for Box, Rc and Arc.
  • IntoIterator is implemented for &PathBuf and &Path.
  • BinaryHeap was refactored for modest performance improvements.
  • Sorting slices that are already sorted is 50% faster in some cases.
  • Cargo:
  • Cargo will look in $CARGO_HOME/bin for subcommands by default.
  • Cargo build scripts can specify their dependencies by emitting the rerun-if-changed key.
  • crates.io will reject publication of crates with dependencies that have a wildcard version constraint. Crates with wildcard dependencies were seen to cause a variety of problems, as described in RFC 1241. Since 1.5 publication of such crates has emitted a warning.
  • cargo clean accepts a --release flag to clean the release folder. A variety of artifacts that Cargo failed to clean are now correctly deleted.
  • Misc:
  • The unreachable_code lint warns when a function call's argument diverges.
  • The parser indicates failures that may be caused by confusingly-similar Unicode characters
  • Certain macro errors are reported at definition time, not expansion.
  • Compatibility Notes:
  • The compiler no longer makes use of the RUST_PATH environment variable when locating crates. This was a pre-cargo feature for integrating with the package manager that was accidentally never removed.
  • A number of bugs were fixed in the privacy checker that could cause previously-accepted code to break.
  • Modules and unit/tuple structs may not share the same name.
  • Bugs in pattern matching unit structs were fixed. The tuple struct pattern syntax (Foo(..)) can no longer be used to match unit structs. This is a warning now, but will become an error in future releases. Patterns that share the same name as a const are now an error.
  • A bug was fixed that causes rustc not to apply default type parameters when resolving certain method implementations of traits defined in other crates.

New in Rust 1.5.0 (Dec 10, 2015)

  • Highlights:
  • Stabilized APIs: BinaryHeap::from, BinaryHeap::into_sorted_vec, BinaryHeap::into_vec, Condvar::wait_timeout, FileTypeExt::is_block_device, FileTypeExt::is_char_device, FileTypeExt::is_fifo, FileTypeExt::is_socket, FileTypeExt, Formatter::alternate, Formatter::fill, Formatter::precision, Formatter::sign_aware_zero_pad, Formatter::sign_minus, Formatter::sign_plus, Formatter::width, Iterator::cmp, Iterator::eq, Iterator::ge, Iterator::gt, Iterator::le, Iterator::lt, Iterator::ne, Iterator::partial_cmp, Path::canonicalize, Path::exists, Path::is_dir, Path::is_file, Path::metadata, Path::read_dir, Path::read_link, Path::symlink_metadata, Utf8Error::valid_up_to, Vec::resize, VecDeque::as_mut_slices, VecDeque::as_slices, VecDeque::insert, VecDeque::shrink_to_fit, VecDeque::swap_remove_back, VecDeque::swap_remove_front, slice::split_first_mut, slice::split_first, slice::split_last_mut, slice::split_last, char::from_u32_unchecked, fs::canonicalize, str::MatchIndices, str::RMatchIndices, str::match_indices, str::rmatch_indices, str::slice_mut_unchecked, string::ParseError.
  • Rust applications hosted on crates.io can be installed locally to ~/.cargo/bin with the cargo install command. Among other things this makes it easier to augment Cargo with new subcommands: when a binary named e.g. cargo-foo is found in $PATH it can be invoked as cargo foo.
  • Crates with wildcard (*) dependencies will emit warnings when published. In 1.6 it will no longer be possible to publish crates with wildcard dependencies.
  • Breaking Changes:
  • The rules determining when a particular lifetime must outlive a particular value (known as 'dropck') have been modified to not rely on parametricity.
  • Implementations of AsRef and AsMut were added to Box, Rc, and Arc. Because these smart pointer types implement Deref, this causes breakage in cases where the interior type contains methods of the same name.
  • Correct a bug in Rc/Arc that caused dropck to be unaware that they could drop their content. Soundness fix.
  • All method invocations are properly checked for well-formedness. Soundness fix.
  • Traits whose supertraits contain Self are not object safe. Soundness fix.
  • Target specifications support a no_default_libraries setting that controls whether -nodefaultlibs is passed to the linker, and in turn the is_like_windows setting no longer affects the -nodefaultlibs flag.
  • #[derive(Show)], long-deprecated, has been removed.
  • The #[inline] and #[repr] attributes can only appear in valid locations.
  • Native libraries linked from the local crate are passed to the linker before native libraries from upstream crates.
  • Two rarely-used attributes, #[no_debug] and #[omit_gdb_pretty_printer_section] are feature gated.
  • Negation of unsigned integers, which has been a warning for several releases, is now behind a feature gate and will generate errors.
  • The parser accidentally accepted visibility modifiers on enum variants, a bug which has been fixed.
  • A bug was fixed that allowed use statements to import unstable features.
  • Language:
  • When evaluating expressions at compile-time that are not compile-time constants (const-evaluating expressions in non-const contexts), incorrect code such as overlong bitshifts and arithmetic overflow will generate a warning instead of an error, delaying the error until runtime. This will allow the const-evaluator to be expanded in the future backwards-compatibly.
  • The improper_ctypes lint no longer warns about using isize and usize in FFI.
  • Libraries:
  • Arc and Rc are covariant with respect to T instead of invariant.
  • Default is implemented for mutable slices.
  • FromStr is implemented for SockAddrV4 and SockAddrV6.
  • There are now From conversions between floating point types where the conversions are lossless.
  • Thera are now From conversions between integer types where the conversions are lossless.
  • fs::Metadata implements Clone.
  • The parse method accepts a leading "+" when parsing integers.
  • AsMut is implemented for Vec.
  • The clone_from implementations for String and BinaryHeap have been optimized and no longer rely on the default impl.
  • The extern "Rust", extern "C", unsafe extern "Rust" and unsafe extern "C" function types now implement Clone, PartialEq, Eq, PartialOrd, Ord, Hash, fmt::Pointer, and fmt::Debug for up to 12 arguments.
  • Dropping Vecs is much faster in unoptimized builds when the element types don't implement Drop.
  • A bug that caused in incorrect behavior when combining VecDeque with zero-sized types was resolved.
  • PartialOrd for slices is faster.
  • Miscellaneous:
  • Crate metadata size was reduced by 20%.
  • Improvements to code generation reduced the size of libcore by 3.3 MB and rustc's memory usage by 18MB.
  • Improvements to deref translation increased performance in unoptimized builds.
  • Various errors in trait resolution are deduplicated to only be reported once.
  • Rust has preliminary support for rumprun kernels.
  • Rust has preliminary support for NetBSD on amd64.

New in Rust 1.4.0 (Oct 30, 2015)

  • Breaking Changes:
  • [Several changes have been made to fix type soundness and improve the behavior of associated types][sound]. See [RFC 1214]. Although we have mostly introduced these changes as warnings this release, to become errors next release, there are still some scenarios that will see immediate breakage.
  • [The `str::lines` and `BufRead::lines` iterators treat `\r\n` as line breaks in addition to `\n`][crlf].
  • [Loans of `'static` lifetime extend to the end of a function][stat].
  • Language:
  • `use` statements that import multiple items [can now rename them][i], as in `use foo::{bar as kitten, baz as puppy}`.
  • [Binops work correctly on fat pointers][binfat].
  • `pub extern crate`, which does not behave as expected, [issues a warning][pec] until a better solution is found.
  • Libraries:
  • [Many APIs were stabilized][stab]: `::into_string`, [`Arc::downgrade`], [`Arc::get_mut`], [`Arc::make_mut`], [`Arc::try_unwrap`], [`Box::from_raw`], [`Box::into_raw`], [`CStr::to_str`], [`CStr::to_string_lossy`], [`CString::from_raw`], [`CString::into_raw`], [`IntoRawFd::into_raw_fd`], [`IntoRawFd`], `IntoRawHandle::into_raw_handle`, `IntoRawHandle`, `IntoRawSocket::into_raw_socket`, `IntoRawSocket`, [`Rc::downgrade`], [`Rc::get_mut`], [`Rc::make_mut`], [`Rc::try_unwrap`], [`Result::expect`], [`String::into_boxed_str`], [`TcpStream::read_timeout`], [`TcpStream::set_read_timeout`], [`TcpStream::set_write_timeout`], [`TcpStream::write_timeout`], [`UdpSocket::read_timeout`], [`UdpSocket::set_read_timeout`], [`UdpSocket::set_write_timeout`], [`UdpSocket::write_timeout`], `Vec::append`, `Vec::split_off`, [`VecDeque::append`], [`VecDeque::retain`], [`VecDeque::split_off`], [`rc::Weak::upgrade`], [`rc::Weak`], [`slice::Iter::as_slice`], [`slice::IterMut::into_slice`], [`str::CharIndices::as_str`], [`str::Chars::as_str`], [`str::split_at_mut`], [`str::split_at`], [`sync::Weak::upgrade`], [`sync::Weak`], [`thread::park_timeout`], [`thread::sleep`].
  • [Some APIs were deprecated][dep]: `BTreeMap::with_b`, `BTreeSet::with_b`, `Option::as_mut_slice`, `Option::as_slice`, `Result::as_mut_slice`, `Result::as_slice`, `f32::from_str_radix`, `f64::from_str_radix`.
  • [Reverse-searching strings is faster with the 'two-way' algorithm][s].
  • [`std::io::copy` allows `?Sized` arguments][cc].
  • The `Windows`, `Chunks`, and `ChunksMut` iterators over slices all [override `count`, `nth` and `last` with an O(1) implementation][it].
  • [`Default` is implemented for arrays up to `[T; 32]`][d].
  • [`IntoRawFd` has been added to the Unix-specific prelude, `IntoRawSocket` and `IntoRawHandle` to the Windows-specific prelude][pr].
  • [`Extend` and `FromIterator

New in Rust 1.3.0 (Sep 18, 2015)

  • ~900 changes, numerous bugfixes
  • Highlights:
  • The new object lifetime defaults have been turned on after a cycle of warnings about the change. Now types like &'a Box (or &'a Rc, etc) will change from being interpreted as &'a Box

New in Rust 1.2.0 (Aug 8, 2015)

  • Highlights:
  • Dynamically-sized-type coercions allow smart pointer types like Rc to contain types without a fixed size, arrays and trait objects, finally enabling use of Rc and completing the implementation of DST.
  • Parallel codegen is now working again, which can substantially speed up large builds in debug mode; It also gets another ~33% speedup when bootstrapping on a 4 core machine (using 8 jobs). It's not enabled by default, but will be "in the near future". It can be activated with the -C codegen-units=N flag to rustc.
  • This is the first release with experimental support for linking with the MSVC linker and lib C on Windows (instead of using the GNU variants via MinGW). It is yet recommended only for the most intrepid Rusticians.
  • Benchmark compilations are showing a 30% improvement in bootstrapping over 1.1.
  • Breaking Changes:
  • The to_uppercase and to_lowercase methods on char now do unicode case mapping, which is a previously-planned change in behavior and considered a bugfix.
  • mem::align_of now specifies the minimum alignment for T, which is usually the alignment programs are interested in, and the same value reported by clang's alignof. mem::min_align_of is deprecated. This is not known to break real code.
  • The #[packed] attribute is no longer silently accepted by the compiler. This attribute did nothing and code that mentioned it likely did not work as intended.
  • Associated type defaults are now behind the associated_type_defaults feature gate. In 1.1 associated type defaults did not work, but could be mentioned syntactically. As such this breakage has minimal impact.
  • Language:
  • Patterns with ref mut now correctly invoke DerefMut when matching against dereferencable values.
  • Libraries:
  • The Extend trait, which grows a collection from an iterator, is implemented over iterators of references, for String, Vec, LinkedList, VecDeque, EnumSet, BinaryHeap, VecMap, BTreeSet and BTreeMap. RFC.
  • The iter::once function returns an iterator that yields a single element, and iter::empty returns an iterator that yields no elements.
  • The matches and rmatches methods on str return iterators over substring matches.
  • Cell and RefCell both implement Eq.
  • A number of methods for wrapping arithmetic are added to the integral types, wrapping_div, wrapping_rem, wrapping_neg, wrapping_shl, wrapping_shr. These are in addition to the existing wrapping_add, wrapping_sub, and wrapping_mul methods, and alternatives to the Wrapping type.. It is illegal for the default arithmetic operations in Rust to overflow; the desire to wrap must be explicit.
  • The {:#?} formatting specifier displays the alternate, pretty-printed form of the Debug formatter. This feature was actually introduced prior to 1.0 with little fanfare.
  • fmt::Formatter implements fmt::Write, a fmt-specific trait for writing data to formatted strings, similar to io::Write.
  • fmt::Formatter adds 'debug builder' methods, debug_struct, debug_tuple, debug_list, debug_set, debug_map. These are used by code generators to emit implementations of Debug.
  • str has new to_uppercase and to_lowercase methods that convert case, following Unicode case mapping.
  • It is now easier to handle poisoned locks. The PoisonError type, returned by failing lock operations, exposes into_inner, get_ref, and get_mut, which all give access to the inner lock guard, and allow the poisoned lock to continue to operate. The is_poisoned method of RwLock and Mutex can poll for a poisoned lock without attempting to take the lock.
  • On Unix the FromRawFd trait is implemented for Stdio, and AsRawFd for ChildStdin, ChildStdout, ChildStderr. On Windows the FromRawHandle trait is implemented for Stdio, and AsRawHandle for ChildStdin, ChildStdout, ChildStderr.
  • io::ErrorKind has a new variant, InvalidData, which indicates malformed input.
  • Misc:
  • rustc employs smarter heuristics for guessing at typos.
  • rustc emits more efficient code for no-op conversions between unsafe pointers.
  • Fat pointers are now passed in pairs of immediate arguments, resulting in faster compile times and smaller code.

New in Rust 1.1.0 (Jun 26, 2015)

  • Highlights:
  • The [std::fs module has been expanded][fs-expand] to expand the set of functionality exposed:
  • DirEntry now supports optimizations like file_type and metadata which don't incur a syscall on some platforms.
  • A symlink_metadata function has been added.
  • The fs::Metadata structure now lowers to its OS counterpart, providing access to all underlying information.
  • The compiler now contains extended explanations of many errors. When an error with an explanation occurs the compiler suggests using the --explain flag to read the explanation. Error explanations are also available online.
  • Thanks to multiple improvements to type checking, as well as other work, the time to bootstrap the compiler decreased by 32%.
  • Libraries:
  • The str::split_whitespace method splits a string on unicode whitespace boundaries.
  • On both Windows and Unix, new extension traits provide conversion of I/O types to and from the underlying system handles. On Unix, these traits are [FrowRawFd] and AsRawFd, on Windows FromRawHandle and AsRawHandle. These are implemented for File, TcpStream, TcpListener, and UpdSocket. Further implementations for std::process will be stabilized later.
  • On Unix, std::os::unix::symlink creates symlinks. On Windows, symlinks can be created with std::os::windows::symlink_dir and std::os::windows::symlink_file.
  • The mpsc::Receiver type can now be converted into an iterator with into_iter on the IntoIterator trait.
  • Ipv4Addr can be created from u32 with the From implementation of the From trait.
  • The Debug implementation for RangeFull creates output that is more consistent with other implementations.
  • Debug is implemented for File.
  • The Default implementation for Arc no longer requires Sync + Send.
  • The Iterator methods count, nth, and last have been overridden for slices to have O(1) performance instead of O(n).
  • Incorrect handling of paths on Windows has been improved in both the compiler and the standard library.
  • AtomicPtr gained a Default implementation.
  • In accordance with Rust's policy on arithmetic overflow abs now panics on overflow when debug assertions are enabled.
  • The Cloned iterator, which was accidentally left unstable for 1.0 has been stabilized.
  • The Incoming iterator, which iterates over incoming TCP connections, and which was accidentally unnamable in 1.0, is now properly exported.
  • BinaryHeap no longer corrupts itself when functions called by sift_up or sift_down panic.
  • The split_off method of LinkedList no longer corrupts the list in certain scenarios.
  • Misc:
  • Type checking performance has improved notably with multiple improvements.
  • The compiler suggests code changes for more errors.
  • rustc and it's build system have experimental support for building toolchains against MUSL instead of glibc on Linux.
  • The compiler defines the target_env cfg value, which is used for distinguishing toolchains that are otherwise for the same platform. Presently this is set to gnu for common GNU Linux targets and for MinGW targets, and musl for MUSL Linux targets.
  • The cargo rustc command invokes a build with custom flags to rustc.
  • Android executables are always position independent.
  • The drop_with_repr_extern lint warns about mixing repr(C) with Drop.

New in Rust 1.0.0 (May 18, 2015)

  • Highlights:
  • The vast majority of the standard library is now #[stable]. It is no longer possible to use unstable features with a stable build of the compiler.
  • Many popular crates on crates.io now work on the stable release channel.
  • Arithmetic on basic integer types now checks for overflow in debug builds.
  • Language:
  • Several restrictions have been added to trait coherence in order to make it easier for upstream authors to change traits without breaking downsteam code.
  • Digits of binary and octal literals are lexed more eagerly to improve error messages and macro behavior. For example, 0b1234 is now lexed as 0b1234 instead of two tokens, 0b1 and 234.
  • Trait bounds are always invariant, eleminating the need for the PhantomFn and MarkerTrait lang items, which have been removed.
  • "-" is no longer a valid character in crate names, the extern crate "foo" as bar syntax has been replaced with extern crate foo as bar, and Cargo now automatically translates "-" in package names to underscore for the crate name.
  • Lifetime shadowing is an error.
  • Send no longer implies 'static.
  • UFCS now supports trait-less associated paths like MyType::default().
  • Primitive types now have inherent methods, obviating the need for extension traits like SliceExt.
  • Methods with Self: Sized in their where clause are considered object-safe, allowing many extension traits like IteratorExt to be merged into the traits they extended.
  • You can now refer to associated types whose corresponding trait bounds appear only in a where clause.
  • The final bits of OIBIT landed, meaning that traits like Send and Sync are now library-defined.
  • A Reflect trait was introduced, which means that downcasting via the Any trait is effectively limited to concrete types. This helps retain the potentially-important "parametricity" property: generic code cannot behave differently for different type arguments except in minor ways.
  • The unsafe_destructor feature is now deprecated in favor of the new dropck. This change is a major reduction in unsafe code.
  • Libraries:
  • The thread_local module has been renamed to std::thread.
  • The methods of IteratorExt have been moved to the Iterator trait itself.
  • Several traits that implement Rust's conventions for type conversions, AsMut, AsRef, From, and Into have been centralized in the std::convert module.
  • The FromError trait was removed in favor of From.
  • The basic sleep function has moved to std::thread::sleep_ms.
  • The splitn function now takes an n parameter that represents the number of items yielded by the returned iterator instead of the number of 'splits'.
  • On Unix, all file descriptors are CLOEXEC by default.
  • Derived implementations of PartialOrd now order enums according to their explicitly-assigned discriminants.
  • Methods for searching strings are generic over Patterns, implemented presently by &char, &str, FnMut(char) -> bool and some others.
  • In method resolution, object methods are resolved before inherent methods.
  • String::from_str has been deprecated in favor of the From impl, String::from.
  • io::Error implements Sync.
  • The words method on &str has been replaced with split_whitespace, to avoid answering the tricky question, 'what is a word?'
  • The new path and IO modules are complete and #[stable]. This was the major library focus for this cycle.
  • The path API was revised to normalize ., adjusting the tradeoffs in favor of the most common usage.
  • A large number of remaining APIs in std were also stabilized during this cycle; about 75% of the non-deprecated API surface is now stable.
  • The new string pattern API landed, which makes the string slice API much more internally consistent and flexible.
  • A new set of generic conversion traits replaced many existing ad hoc traits.
  • Generic numeric traits were completely removed. This was made possible thanks to inherent methods for primitive types, and the removal gives maximal flexibility for designing a numeric hierarchy in the future.
  • The Fn traits are now related via inheritance and provide ergonomic blanket implementations.
  • The Index and IndexMut traits were changed to take the index by value, enabling code like hash_map["string"] to work.
  • Copy now inherits from Clone, meaning that all Copy data is known to be Clone as well.
  • Misc:
  • Many errors now have extended explanations that can be accessed with the --explain flag to rustc.
  • Many new examples have been added to the standard library documentation.
  • rustdoc has received a number of improvements focused on completion and polish.
  • Metadata was tuned, shrinking binaries by 27%.
  • Much headway was made on ecosystem-wide CI, making it possible to compare builds for breakage.

New in Rust 1.0.0 Beta 2 (Apr 18, 2015)

  • ~1100 changes, numerous bugfixes
  • Highlights:
  • The big news is that the vast majority of the standard library is now #[stable] -- 75% of the non-deprecated API surface at last count. Numerous crates are now running on stable Rust. Starting with this release, it is not possible to use unstable features on a stable build.
  • Arithmetic on basic integer types now checks for overflow in debug builds.
  • Language:
  • Send no longer implies 'static, which made possible the thread::scoped API. Scoped threads can borrow data from their parent's stack frame -- safely!
  • UFCS now supports trait-less associated paths like MyType::default().
  • Primitive types now have inherent methods, obviating the need for extension traits like SliceExt.
  • Methods with Self: Sized in their where clause are considered object-safe, allowing many extension traits like IteratorExt to be merged into the traits they extended.
  • You can now refer to associated types whose corresponding trait bounds appear only in a where clause.
  • The final bits of OIBIT landed, meaning that traits like Send and Sync are now library-defined.
  • A Reflect trait was introduced, which means that downcasting via the Any trait is effectively limited to concrete types. This helps retain the potentially-important "parametricity" property: generic code cannot behave differently for different type arguments except in minor ways.
  • The unsafe_destructor feature is now deprecated in favor of the new dropck. This change is a major reduction in unsafe code.
  • Trait coherence was revised again, this time with an eye toward API evolution over time.
  • Libraries:
  • The new path and IO modules are complete and #[stable]. This was the major library focus for this cycle.
  • The path API was revised to normalize ., adjusting the tradeoffs in favor of the most common usage.
  • A large number of remaining APIs in std were also stabilized during this cycle; about 75% of the non-deprecated API surface is now stable.
  • The new string pattern API landed, which makes the string slice API much more internally consistent and flexible.
  • A shiny framework for Debug implementations landed. This makes it possible to opt in to "pretty-printed" debugging output.
  • A new set of generic conversion traits replaced many existing ad hoc traits.
  • Generic numeric traits were completely removed. This was made possible thanks to inherent methods for primitive types, and the removal gives maximal flexibility for designing a numeric hierarchy in the future.
  • The Fn traits are now related via inheritance and provide ergonomic blanket implementations.
  • The Index and IndexMut traits were changed to take the index by value, enabling code like hash_map["string"] to work.
  • Copy now inherits from Clone, meaning that all Copy data is known to be Clone as well.
  • Infrastructure:
  • Metadata was tuned, shrinking binaries by 27%.
  • Much headway was made on ecosystem-wide CI, making it possible to compare builds for breakage.

New in Rust 1.0.0 Alpha 2 (Feb 21, 2015)

  • ~1300 changes, numerous bugfixes
  • Highlights:
  • The various I/O modules were overhauled to reduce unncessary abstractions and provide better interoperation with the underlying platform. The old io module remains temporarily at std::old_io.
  • The standard library now partipates in feature gating, so use of unstable libraries now requires a #![feature(...)] attribute. The impact of this change is described on the forum. RFC.
  • Language:
  • for loops now operate on the IntoIterator trait, which eliminates the need to call .iter(), etc. to iterate over collections. There are some new subtleties to remember though regarding what sort of iterators various types yield, in particular that for foo in bar { } yields values from a move iterator, destroying the original collection. RFC.
  • Objects now have default lifetime bounds, so you don't have to write when you don't care about storing references. RFC.
  • In types that implement Drop, lifetimes must outlive the value. This will soon make it possible to safely implement Drop for types where #[unsafe_destructor] is now required. Read the gorgeous RFC for details.
  • The fully qualified ::X syntax lets you set the Self type for a trait method or associated type. RFC.
  • References to types that implement Deref now automatically coerce to references to the dereferenced type U, e.g. &T where T: Deref automatically coerces to &U. This should eliminate many unsightly uses of &*, as when converting from references to vectors into references to slices. RFC.
  • The explicit closure kind syntax (|&:|, |&mut:|, |:|) is obsolete and closure kind is inferred from context.
  • Self is a keyword.
  • Libraries:
  • The Show and String formatting traits have been renamed to Debug and Display to more clearly reflect their related purposes. Automatically getting a string conversion to use with format!("{:?}", something_to_debug) is now written #[derive(Debug)].
  • Abstract OS-specific string types, std::ff::{OsString, OsStr}, provide strings in platform-specific encodings for easier interop with system APIs. RFC.
  • The boxed::into_raw and Box::frow_raw functions convert between Box and *mut T, a common pattern for creating raw pointers.
  • Tooling:
  • Certain long error messages of the form 'expected foo found bar' are now split neatly across multiple lines. Examples in the PR.
  • On Unix Rust can be uninstalled by running /usr/local/lib/rustlib/uninstall.sh.
  • The #[rustc_on_unimplemented] attribute, requiring the 'on_unimplemented' feature, lets rustc display custom error messages when a trait is expected to be implemented for a type but is not.
  • Misc:
  • Rust is tested against a LALR grammar, which parses almost all the Rust files that rustc does.

New in Rust 1.0.0 Alpha (Jan 10, 2015)

  • Highlights:
  • The language itself is considered feature complete for 1.0, though there will be many usability improvements and bugfixes before the final release.
  • Nearly 50% of the public API surface of the standard library has been declared 'stable'. Those interfaces are unlikely to change before 1.0.
  • The long-running debate over integer types has been settled: Rust will ship with types named isize and usize, rather than int and uint, for pointer-sized integers. Guidelines will be rolled out during the alpha cycle.
  • Most crates that are not std have been moved out of the Rust distribution into the Cargo ecosystem so they can evolve separately and don't need to be stabilized as quickly, including 'time', 'getopts', 'num', 'regex', and 'term'.
  • Documentation continues to be expanded with more API coverage, more examples, and more in-depth explanations. The guides have been consolidated into The Rust Programming Language.
  • "Rust By Example" is now maintained by the Rust team.
  • All official Rust binary installers now come with Cargo, the Rust package manager.
  • Language:
  • Closures have been completely redesigned to be implemented in terms of traits, can now be used as generic type bounds and thus monomorphized and inlined, or via an opaque pointer (boxed) as in the old system. The new system is often referred to as 'unboxed' closures.
  • Traits now support associated types, allowing families of related types to be defined together and used generically in powerful ways.
  • Enum variants are namespaced by their type names.
  • where clauses provide a more versatile and attractive syntax for specifying generic bounds, though the previous syntax remains valid.
  • Rust again picks a fallback (either i32 or f64) for uninferred numeric types.
  • Rust no longer has a runtime of any description, and only supports OS threads, not green threads.
  • At long last, Rust has been overhauled for 'dynamically-sized types' (DST), which integrates 'fat pointers' (object types, arrays, and str) more deeply into the type system, making it more consistent.
  • Rust now has a general range syntax, i..j, i.., and ..j that produce range types and which, when combined with the Index operator and multidispatch, leads to a convenient slice notation, [i..j].
  • The new range syntax revealed an ambiguity in the fixed-length array syntax, so now fixed length arrays are written [T; N].
  • The Copy trait is no longer implemented automatically. Unsafe pointers no longer implement Sync and Send so types containing them don't automatically either. Sync and Send are now 'unsafe traits' so one can "forcibly" implement them via unsafe impl if a type confirms to the requirements for them even though the internals do not (e.g. structs containing unsafe pointers like Arc). These changes are intended to prevent some footguns and are collectively known as opt-in built-in traits (though Sync and Send will soon become pure library types unknown to the compiler).
  • Operator traits now take their operands by value, and comparison traits can use multidispatch to compare one type against multiple other types, allowing e.g. String to be compared with &str.
  • if let and while let are no longer feature-gated.
  • Rust has adopted a more uniform syntax for escaping unicode characters.
  • macro_rules! has been declared stable. Though it is a flawed system it is sufficiently popular that it must be usable for 1.0. Effort has gone into future-proofing it in ways that will allow other macro systems to be developed in parallel, and won't otherwise impact the evolution of the language.
  • The prelude has been pared back significantly such that it is the minimum necessary to support the most pervasive code patterns, and through generalized where clauses many of the prelude extension traits have been consolidated.
  • Rust's rudimentary reflection has been removed, as it incurred too much code generation for little benefit.
  • Struct variants are no longer feature-gated.
  • Trait bounds can be polymorphic over lifetimes. Also known as 'higher-ranked trait bounds', this crucially allows unboxed closures to work.
  • Macros invocations surrounded by parens or square brackets and not terminated by a semicolon are parsed as expressions, which makes expressions like vec![1i32, 2, 3].len() work as expected.
  • Trait objects now implement their traits automatically, and traits that can be coerced to objects now must be object safe.
  • Automatically deriving traits is now done with #[derive(...)] not #[deriving(...)] for consistency with other naming conventions.
  • Importing the containing module or enum at the same time as items or variants they contain is now done with self instead of mod, as in use foo::{self, bar}
  • Glob imports are no longer feature-gated.
  • The box operator and box patterns have been feature-gated pending a redesign. For now unique boxes should be allocated like other containers, with Box::new.
  • Libraries:
  • A series of efforts to establish conventions for collections types has resulted in API improvements throughout the standard library.
  • New APIs for error handling provide ergonomic interop between error types, and new conventions describe more clearly the recommended error handling strategies in Rust.
  • The fail! macro has been renamed to panic! so that it is easier to discuss failure in the context of error handling without making clarifications as to whether you are referring to the 'fail' macro or failure more generally.
  • On Linux, OsRng prefers the new, more reliable getrandom syscall when available.
  • The 'serialize' crate has been renamed 'rustc-serialize' and moved out of the distribution to Cargo. Although it is widely used now, it is expected to be superceded in the near future.
  • The Show formatter, typically implemented with #[derive(Show)] is now requested with the {:?} specifier and is intended for use by all types, for uses such as println! debugging. The new String formatter must be implemented by hand, uses the {} specifier, and is intended for full-fidelity conversions of things that can logically be represented as strings.
  • Tooling:
  • Flexible target specification allows rustc's code generation to be configured to support otherwise-unsupported platforms.
  • Rust comes with rust-gdb and rust-lldb scripts that launch their respective debuggers with Rust-appropriate pretty-printing.
  • The Windows installation of Rust is distributed with the the MinGW components currently required to link binaries on that platform.
  • Misc:
  • Nullable enum optimizations have been extended to more types so that e.g. Option and Option take up no more space than the inner types themselves.
  • Work has begun on supporting AArch64.

New in Rust 0.11.0 (Jul 3, 2014)

  • 1700 changes, numerous bugfixes
  • Language:
  • ~[T] has been removed from the language. This type is superseded by the Vec type.
  • ~str has been removed from the language. This type is superseded by the String type.
  • ~T has been removed from the language. This type is superseded by the Box type.
  • @T has been removed from the language. This type is superseded by the standard library's std::gc::Gc type.
  • Struct fields are now all private by default.
  • Vector indices and shift amounts are both required to be a `uint` instead of any integral type.
  • Byte character, byte string, and raw byte string literals are now all supported by prefixing the normal literal with a `b`.
  • Multiple ABIs are no longer allowed in an ABI string
  • The syntax for lifetimes on closures/procedures has been tweaked slightly: ` T`
  • Floating point modulus has been removed from the language; however it is still provided by a library implementation.
  • Private enum variants are now disallowed.
  • The `priv` keyword has been removed from the language.
  • A closure can no longer be invoked through a &-pointer.
  • The `use foo, bar, baz;` syntax has been removed from the language.
  • The transmute intrinsic no longer works on type parameters.
  • Statics now allow blocks/items in their definition.
  • Trait bounds are separated from objects with + instead of : now.
  • Objects can no longer be read while they are mutably borrowed.
  • The address of a static is now marked as insignificant unless the
  • #[inline(never)] attribute is placed it.
  • The #[unsafe_destructor] attribute is now behind a feature gate.
  • Struct literals are no longer allowed in ambiguous positions such as if, while, match, and for..in.
  • Declaration of lang items and intrinsics are now feature-gated by default.
  • Integral literals no longer default to `int`, and floating point literals no longer default to `f64`. Literals must be suffixed with an appropriate type if inference cannot determine the type of the literal.
  • The Box type is no longer implicitly borrowed to &mut T.
  • Procedures are now required to not capture borrowed references.
  • Libraries:
  • The standard library is now a "facade" over a number of underlying libraries. This means that development on the standard library should be speeder due to smaller crates, as well as a clearer line between all dependencies.
  • A new library, libcore, lives under the standard library's facade which is Rust's "0-assumption" library, suitable for embedded and kernel development for example.
  • A regex crate has been added to the standard distribution. This crate includes statically compiled regular expressions.
  • The unwrap/unwrap_err methods on Result require a Show bound for better error messages.
  • The return types of the std::comm primitives have been centralized around the Result type.
  • A number of I/O primitives have gained the ability to time out their operations.
  • A number of I/O primitives have gained the ability to close their reading/writing halves to cancel pending operations.
  • Reverse iterator methods have been removed in favor of `rev()` on their forward-iteration counterparts.
  • A bitflags! macro has been added to enable easy interop with C and management of bit flags.
  • A debug_assert! macro is now provided which is disabled when `--cfg ndebug` is passed to the compiler.
  • A graphviz crate has been added for creating .dot files.
  • The std::cast module has been migrated into std::mem.
  • The std::local_data api has been migrated from freestanding functions to being based on methods.
  • The Pod trait has been renamed to Copy.
  • jemalloc has been added as the default allocator for types.
  • The API for allocating memory has been changed to use proper alignment and sized deallocation
  • Connecting a TcpStream or binding a TcpListener is now based on a string address and a u16 port. This allows connecting to a hostname as opposed to an IP.
  • The Reader trait now contains a core method, read_at_least(), which correctly handles many repeated 0-length reads.
  • The process-spawning API is now centered around a builder-style Command struct.
  • The :? printing qualifier has been moved from the standard library to an external libdebug crate.
  • Eq/Ord have been renamed to PartialEq/PartialOrd. TotalEq/TotalOrd have been renamed to Eq/Ord.
  • The select/plural methods have been removed from format!. The escapes for { and } have also changed from \{ and \} to {{ and }}, respectively.
  • The TaskBuilder API has been re-worked to be a true builder, and extension traits for spawning native/green tasks have been added.
  • Tooling:
  • All breaking changes to the language or libraries now have their commit message annotated with `[breaking-change]` to allow for easy discovery of breaking changes.
  • The compiler will now try to suggest how to annotate lifetimes if a lifetime-related error occurs.
  • Debug info continues to be improved greatly with general bug fixes and better support for situations like link time optimization (LTO).
  • Usage of syntax extensions when cross-compiling has been fixed.
  • Functionality equivalent to GCC & Clang's -ffunction-sections, -fdata-sections and --gc-sections has been enabled by default
  • The compiler is now stricter about where it will load module files from when a module is declared via `mod foo;`.
  • The #[phase(syntax)] attribute has been renamed to #[phase(plugin)].
  • Syntax extensions are now discovered via a "plugin registrar" type which will be extended in the future to other various plugins.
  • Lints have been restructured to allow for dynamically loadable lints.
  • A number of rustdoc improvements:
  • The HTML output has been visually redesigned.
  • Markdown is now powered by hoedown instead of sundown.
  • Searching heuristics have been greatly improved.
  • The search index has been reduced in size by a great amount.
  • Cross-crate documentation via `pub use` has been greatly improved.
  • Primitive types are now hyperlinked and documented.
  • Documentation has been moved from static.rust-lang.org/doc to doc.rust-lang.org
  • A new sandbox, play.rust-lang.org, is available for running and sharing rust code examples on-line.
  • Unused attributes are now more robustly warned about.
  • The dead_code lint now warns about unused struct fields.
  • Cross-compiling to iOS is now supported.
  • Cross-compiling to mipsel is now supported.
  • Stability attributes are now inherited by default and no longer apply to intra-crate usage, only inter-crate usage.
  • Error message related to non-exhaustive match expressions have been greatly improved

New in Rust 0.10 (Apr 1, 2014)

  • ~1500 changes, numerous bugfixes
  • Language:
  • A new RFC process is now in place for modifying the language.
  • Patterns with `@`-pointers have been removed from the language.
  • Patterns with unique vectors have been removed from the language.
  • `@str` has been removed from the language.
  • `@[T]` has been removed from the language.
  • `@self` has been removed from the language.
  • `@Trait` has been removed from the language.
  • Headers on `~` allocations which contain `@` boxes inside the type for reference counting have been removed.
  • The semantics around the lifetimes of temporary expressions have changed, see #3511 and #11585 for more information.
  • Cross-crate syntax extensions are now possible, but feature gated. See #11151 for more information. This includes both `macro_rules!` macros as well as syntax extensions such as `format!`.
  • New lint modes have been added, and older ones have been turned on to be warn-by-default. * Unnecessary parentheses * Uppercase statics * Camel Case types * Uppercase variables * Publicly visible private types
  • Unsafe functions can no longer be coerced to closures.
  • Various obscure macros such as `log_syntax!` are now behind feature gates.
  • The #[simd] attribute is now behind a feature gate.
  • Visibility is no longer allowed on `extern crate` statements, and unnecessary visibility (`priv`) is no longer allowed on `use` statements.
  • Trailing commas are now allowed in argument lists and tuple patterns.
  • The `do` keyword has been removed, it is now a reserved keyword.
  • Default type parameters have been implemented, but are feature gated.
  • Borrowed variables through captures in closures are now considered soundly.
  • `extern mod` is now `extern crate`
  • The `Freeze` trait has been removed.
  • The `Share` trait has been added for types that can be shared among threads.
  • Labels in macros are now hygienic.
  • Expresson/statement macro invocations can be delimited with `{}` now.
  • Treatment of types allowed in `static mut` locations has been tweaked.
  • The `*` and `.` operators are now overloadable through the `Deref` and `DerefMut` traits.
  • `~Trait` and `proc` no longer have `Send` bounds by default.
  • Partial type hints are now supported with the `_` type marker.
  • An `Unsafe` type was introduced for interior mutability. It is now considered undefined to transmute from `&T` to `&mut T` without using the `Unsafe` type.
  • The #[linkage] attribute was implemented for extern statics/functions.
  • The inner attribute syntax has changed from `#[foo];` to `#![foo]`.
  • `Pod` was renamed to `Copy`.
  • Libraries:
  • The `libextra` library has been removed. It has now been decomposed into component libraries with smaller and more focused nuggets of functionality. The full list of libraries can be found on the documentation index page.
  • std: `std::condition` has been removed. All I/O errors are now propagated through the `Result` type. In order to assist with error handling, a `try!` macro for unwrapping errors with an early return and an lint for unused results has been added. See #12039 for more information.
  • std: The `vec` module has been renamed to `slice`.
  • std: A new vector type, `Vec`, has been added in preparation for DST. This will become the only growable vector in the future.
  • std: `std::io` now has more public-reexports. Types such as `BufferedReader` are now found at `std::io::BufferedReader` instead of `std::io::buffered::BufferedReader`.
  • std: `print` and `println` are no longer in the prelude, the `print!` and `println!` macros are intended to be used instead.
  • std: `Rc` now has a `Weak` pointer for breaking cycles, and it no longer attempts to statically prevent cycles.
  • std: The standard distribution is adopting the policy of pushing failure to the user rather than failing in libraries. Many functions (such as `slice::last()`) now return `Option` instead of `T` + failing.
  • std: `fmt::Default` has been renamed to `fmt::Show`, and it now has a new deriving mode: `#[deriving(Show)]`.
  • std: `ToStr` is now implemented for all types implementing `Show`.
  • std: The formatting trait methods now take `&self` instead of `&T`
  • std: The `invert()` method on iterators has been renamed to `rev()`
  • std: `std::num` has seen a reduction in the genericity of its traits, consolidating functionality into a few core traits.
  • std: Backtraces are now printed on task failure if the environment variable `RUST_BACKTRACE` is present.
  • std: Naming conventions for iterators have been standardized. More details can be found on the wiki's style guide.
  • std: `eof()` has been removed from the `Reader` trait. Specific types may still implement the function.
  • std: Networking types are now cloneable to allow simultaneous reads/writes.
  • std: `assert_approx_eq!` has been removed
  • std: The `e` and `E` formatting specifiers for floats have been added to print them in exponential notation.
  • std: The `Times` trait has been removed
  • std: Indications of variance and opting out of builtin bounds is done through marker types in `std::kinds::marker` now
  • std: `hash` has been rewritten, `IterBytes` has been removed, and `#[deriving(Hash)]` is now possible.
  • std: `SharedChan` has been removed, `Sender` is now cloneable.
  • std: `Chan` and `Port` were renamed to `Sender` and `Receiver`.
  • std: `Chan::new` is now `channel()`.
  • std: A new synchronous channel type has been implemented.
  • std: A `select!` macro is now provided for selecting over `Receiver`s.
  • std: `hashmap` and `trie` have been moved to `libcollections`
  • std: `run` has been rolled into `io::process`
  • std: `assert_eq!` now uses `{}` instead of `{:?}`
  • std: The equality and comparison traits have seen some reorganization.
  • std: `rand` has moved to `librand`.
  • std: `to_{lower,upper}case` has been implemented for `char`.
  • std: Logging has been moved to `liblog`.
  • collections: `HashMap` has been rewritten for higher performance and less memory usage.
  • native: The default runtime is now `libnative`. If `libgreen` is desired, it can be booted manually. The runtime guide has more information and examples.
  • native: All I/O functionality except signals has been implemented.
  • green: Task spawning with `libgreen` has been optimized with stack caching and various trimming of code.
  • green: Tasks spawned by `libgreen` now have an unmapped guard page.
  • sync: The `extra::sync` module has been updated to modern rust (and moved to the `sync` library), tweaking and improving various interfaces while dropping redundant functionality.
  • sync: A new `Barrier` type has been added to the `sync` library.
  • sync: An efficient mutex for native and green tasks has been implemented.
  • serialize: The `base64` module has seen some improvement. It treats newlines better, has non-string error values, and has seen general cleanup.
  • fourcc: A `fourcc!` macro was introduced
  • hexfloat: A `hexfloat!` macro was implemented for specifying floats via a hexadecimal literal.
  • Tooling:
  • `rustpkg` has been deprecated and removed from the main repository. Its replacement, `cargo`, is under development.
  • Nightly builds of rust are now available (INSERT URL HERE)
  • The memory usage of rustc has been improved many times throughout this release cycle.
  • The build process supports disabling rpath support for the rustc binary itself.
  • Code generation has improved in some cases, giving more information to the LLVM optimization passes to enable more extensive optimizations.
  • Debuginfo compatibility with lldb on OSX has been restored.
  • The master branch is now gated on an android bot, making building for android much more reliable.
  • Output flags have been centralized into one `--emit` flag.
  • Crate type flags have been centralized into one `--crate-type` flag.
  • Codegen flags have been consolidated behind a `-C` flag.
  • `rustdoc` now implements syntax highlighting and rendering markdown files.
  • `rustdoc --test` now tests all code blocks by default.
  • `rustdoc` now shows documented macros.
  • `rustdoc` inlines documentation for reexported types.
  • `rustdoc` search works across crates now.
  • Linking against outdated crates now has improved error messages.
  • Error messages with lifetimes will often suggest how to annotate the function to fix the error.
  • Many more types are documented in the standard library, and new guides were written.

New in Rust 0.9 (Jan 10, 2014)

  • ~1800 changes, numerous bugfixes
  • 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")]`).
  • Native OS X frameworks are now officially supported (`#[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.8 (Sep 27, 2013)

  • Language:
  • The `for` loop syntax has changed to work with the `Iterator` trait.
  • At long last, unwinding works on Windows.
  • Default methods are ready for use.
  • Many trait inheritance bugs fixed.
  • Owned and borrowed trait objects work more reliably.
  • `copy` is no longer a keyword. It has been replaced by the `Clone` trait.
  • rustc can omit emission of code for the `debug!` macro if it is passed
  • `--cfg ndebug`
  • mod.rs is now "blessed". When loading `mod foo;`, rustc will now look
  • for foo.rs, then foo/mod.rs, and will generate an error when both are
  • present.
  • Strings no longer contain trailing nulls. The new `std::c_str` module
  • provides new mechanisms for converting to C strings.
  • The type of foreign functions is now `extern "C" fn` instead of `*u8'.
  • The FFI has been overhauled such that foreign functions are called directly,
  • instead of through a stack-switching wrapper.
  • Calling a foreign function must be done through a Rust function with the
  • `#[fixed_stack_segment]` attribute.
  • The `externfn!` macro can be used to declare both a foreign function and
  • a `#[fixed_stack_segment]` wrapper at once.
  • `pub` and `priv` modifiers on `extern` blocks are no longer parsed.
  • `unsafe` is no longer allowed on extern fns - they are all unsafe.
  • `priv` is disallowed everywhere except for struct fields and enum variants.
  • `&T` (besides `&'static T`) is no longer allowed in `@T`.
  • `ref` bindings in irrefutable patterns work correctly now.
  • `char` is now prevented from containing invalid code points.
  • Casting to `bool` is no longer allowed.
  • `\0` is now accepted as an escape in chars and strings.
  • `yield` is a reserved keyword.
  • `typeof` is a reserved keyword.
  • Crates may be imported by URL with `extern mod foo = "url";`.
  • Explicit enum discriminants may be given as uints as in `enum E { V = 0u }`
  • Static vectors can be initialized with repeating elements,
  • e.g. `static foo: [u8, .. 100]: [0, .. 100];`.
  • Static structs can be initialized with functional record update,
  • e.g. `static foo: Foo = Foo { a: 5, .. bar };`.
  • `cfg!` can be used to conditionally execute code based on the crate
  • configuration, similarly to `#[cfg(...)]`.
  • The `unnecessary_qualification` lint detects unneeded module
  • prefixes (default: allow).
  • Arithmetic operations have been implemented on the SIMD types in
  • `std::unstable::simd`.
  • Exchange allocation headers were removed, reducing memory usage.
  • `format!` implements a completely new, extensible, and higher-performance
  • string formatting system. It will replace `fmt!`.
  • `print!` and `println!` write formatted strings (using the `format!`
  • extension) to stdout.
  • `write!` and `writeln!` write formatted strings (using the `format!`
  • extension) to the new Writers in `std::rt::io`.
  • The library section in which a function or static is placed may
  • be specified with `#[link_section = "..."]`.
  • The `proto!` syntax extension for defining bounded message protocols
  • was removed.
  • `macro_rules!` is hygienic for `let` declarations.
  • The `#[export_name]` attribute specifies the name of a symbol.
  • `unreachable!` can be used to indicate unreachable code, and fails
  • if executed.
  • Libraries:
  • std: Transitioned to the new runtime, written in Rust.
  • std: Added an experimental I/O library, `rt::io`, based on the new
  • runtime.
  • std: A new generic `range` function was added to the prelude, replacing
  • `uint::range` and friends.
  • std: `range_rev` no longer exists. Since range is an iterator it can be
  • reversed with `range(lo, hi).invert()`.
  • std: The `chain` method on option renamed to `and_then`; `unwrap_or_default`
  • renamed to `unwrap_or`.
  • std: The `iterator` module was renamed to `iter`.
  • std: Integral types now support the `checked_add`, `checked_sub`, and
  • `checked_mul` operations for detecting overflow.
  • std: Many methods in `str`, `vec`, `option, `result` were renamed for
  • consistency.
  • std: Methods are standardizing on conventions for casting methods:
  • `to_foo` for copying, `into_foo` for moving, `as_foo` for temporary
  • and cheap casts.
  • std: The `CString` type in `c_str` provides new ways to convert to and
  • from C strings.
  • std: `DoubleEndedIterator` can yield elements in two directions.
  • std: The `mut_split` method on vectors partitions an `&mut [T]` into
  • two splices.
  • std: `str::from_bytes` renamed to `str::from_utf8`.
  • std: `pop_opt` and `shift_opt` methods added to vectors.
  • std: The task-local data interface no longer uses @, and keys are
  • no longer function pointers.
  • std: The `swap_unwrap` method of `Option` renamed to `take_unwrap`.
  • std: Added `SharedPort` to `comm`.
  • std: `Eq` has a default method for `ne`; only `eq` is required
  • in implementations.
  • std: `Ord` has default methods for `le`, `gt` and `ge`; only `lt`
  • is required in implementations.
  • std: `is_utf8` performance is improved, impacting many string functions.
  • std: `os::MemoryMap` provides cross-platform mmap.
  • std: `ptr::offset` is now unsafe, but also more optimized. Offsets that
  • are not 'in-bounds' are considered undefined.
  • std: Many freestanding functions in `vec` removed in favor of methods.
  • std: Many freestanding functions on scalar types removed in favor of
  • methods.
  • std: Many options to task builders were removed since they don't make
  • sense in the new scheduler design.
  • std: More containers implement `FromIterator` so can be created by the
  • `collect` method.
  • std: More complete atomic types in `unstable::atomics`.
  • std: `comm::PortSet` removed.
  • std: Mutating methods in the `Set` and `Map` traits have been moved into
  • the `MutableSet` and `MutableMap` traits. `Container::is_empty`,
  • `Map::contains_key`, `MutableMap::insert`, and `MutableMap::remove` have
  • default implementations.
  • std: Various `from_str` functions were removed in favor of a generic
  • `from_str` which is available in the prelude.
  • std: `util::unreachable` removed in favor of the `unreachable!` macro.
  • extra: `dlist`, the doubly-linked list was modernized.
  • extra: Added a `hex` module with `ToHex` and `FromHex` traits.
  • extra: Added `glob` module, replacing `std::os::glob`.
  • extra: `rope` was removed.
  • extra: `deque` was renamed to `ringbuf`. `RingBuf` implements `Deque`.
  • extra: `net`, and `timer` were removed. The experimental replacements
  • are `std::rt::io::net` and `std::rt::io::timer`.
  • extra: Iterators implemented for `SmallIntMap`.
  • extra: Iterators implemented for `Bitv` and `BitvSet`.
  • extra: `SmallIntSet` removed. Use `BitvSet`.
  • extra: Performance of JSON parsing greatly improved.
  • extra: `semver` updated to SemVer 2.0.0.
  • extra: `term` handles more terminals correctly.
  • extra: `dbg` module removed.
  • extra: `par` module removed.
  • extra: `future` was cleaned up, with some method renames.
  • extra: Most free functions in `getopts` were converted to methods.
  • Other:
  • rustc's debug info generation (`-Z debug-info`) is greatly improved.
  • rustc accepts `--target-cpu` to compile to a specific CPU architecture,
  • similarly to gcc's `--march` flag.
  • rustc's performance compiling small crates is much better.
  • rustpkg has received many improvements.
  • rustpkg supports git tags as package IDs.
  • rustpkg builds into target-specific directories so it can be used for
  • cross-compiling.
  • The number of concurrent test tasks is controlled by the environment
  • variable RUST_TEST_TASKS.
  • The test harness can now report metrics for benchmarks.
  • All tools have man pages.
  • Programs compiled with `--test` now support the `-h` and `--help` flags.
  • The runtime uses jemalloc for allocations.
  • Segmented stacks are temporarily disabled as part of the transition to
  • the new runtime. Stack overflows are possible!
  • A new documentation backend, rustdoc_ng, is available for use. It is
  • still invoked through the normal `rustdoc` command.

New in Rust 0.7 (Jul 4, 2013)

  • Language:
  • `impl`s no longer accept a visibility qualifier. Put them on methods instead.
  • The borrow checker has been rewritten with flow-sensitivity, fixing many bugs and inconveniences.
  • The `self` parameter no longer implicitly means `&'self self`, and can be explicitly marked with a lifetime.
  • Overloadable compound operators (`+=`, etc.) have been temporarily removed due to bugs.
  • The `for` loop protocol now requires `for`-iterators to return `bool` so they compose better.
  • The `Durable` trait is replaced with the `'static` bounds.
  • Trait default methods work more often.
  • Structs with the `#[packed]` attribute have byte alignment and no padding between fields.
  • Type parameters bound by `Copy` must now be copied explicitly with the `copy` keyword.
  • It is now illegal to move out of a dereferenced unsafe pointer.
  • `Option` is now represented as a nullable pointer.
  • `@mut` does dynamic borrow checks correctly.
  • The `main` function is only detected at the topmost level of the crate. The `#[main]` attribute is still valid anywhere.
  • Struct fields may no longer be mutable. Use inherited mutability.
  • The `#[no_send]` attribute makes a type that would otherwise be `Send`, not.
  • The `#[no_freeze]` attribute makes a type that would otherwise be `Freeze`, not.
  • Unbounded recursion will abort the process after reaching the limit specified by the `RUST_MAX_STACK` environment variable (default: 1GB).
  • The `vecs_implicitly_copyable` lint mode has been removed. Vectors are never implicitly copyable.
  • `#[static_assert]` makes compile-time assertions about static bools.
  • At long last, 'argument modes' no longer exist.
  • The rarely used `use mod` statement no longer exists.
  • Syntax extensions:
  • `fail!` and `assert!` accept `~str`, `&'static str` or `fmt!`-style argument list.
  • `Encodable`, `Decodable`, `Ord`, `TotalOrd`, `TotalEq`, `DeepClone`, `Rand`, `Zero` and `ToStr` can all be automatically derived with `#[deriving(...)]`.
  • The `bytes!` macro returns a vector of bytes for string, u8, char, and unsuffixed integer literals.
  • Libraries:
  • The `core` crate was renamed to `std`.
  • The `std` crate was renamed to `extra`.
  • More and improved documentation.
  • std: `iterator` module for external iterator objects.
  • Many old-style (internal, higher-order function) iterators replaced by implementations of `Iterator`.
  • std: Many old internal vector and string iterators, incl. `any`, `all`. removed.
  • std: The `finalize` method of `Drop` renamed to `drop`.
  • std: The prelude no longer reexports any modules, only types and traits.
  • std: Prelude additions: `print`, `println`, `FromStr`, `ApproxEq`, `Equiv`, `Iterator`, `IteratorUtil`, many numeric traits, many tuple traits.
  • std: New numeric traits: `Fractional`, `Real`, `RealExt`, `Integer`, `Ratio`, `Algebraic`, `Trigonometric`, `Exponential`, `Primitive`.
  • std: Tuple traits and accessors defined for up to 12-tuples, e.g. `(0, 1, 2).n2()` or `(0, 1, 2).n2_ref()`.
  • std: Many types implement `Clone`.
  • std: `path` type renamed to `Path`.
  • std: `mut` module and `Mut` type removed.
  • std: Many standalone functions removed in favor of methods and iterators in `vec`, `str`. In the future methods will also work as functions.
  • std: `reinterpret_cast` removed. Use `transmute`.
  • std: ascii string handling in `std::ascii`.
  • std: `Rand` is implemented for ~/@.
  • std: `run` module for spawning processes overhauled.
  • std: Various atomic types added to `unstable::atomic`.
  • std: Various types implement `Zero`.
  • std: `LinearMap` and `LinearSet` renamed to `HashMap` and `HashSet`.
  • std: Borrowed pointer functions moved from `ptr` to `borrow`.
  • std: Added `os::mkdir_recursive`.
  • std: Added `os::glob` function performs filesystems globs.
  • std: `FuzzyEq` renamed to `ApproxEq`.
  • std: `Map` now defines `pop` and `swap` methods.
  • std: `Cell` constructors converted to static methods.
  • extra: `rc` module adds the reference counted pointers, `Rc` and `RcMut`.
  • extra: `flate` module moved from `std` to `extra`.
  • extra: `fileinput` module for iterating over a series of files.
  • extra: `Complex` number type and `complex` module.
  • extra: `Rational` number type and `rational` module.
  • extra: `BigInt`, `BigUint` implement numeric and comparison traits.
  • extra: `term` uses terminfo now, is more correct.
  • extra: `arc` functions converted to methods.
  • extra: Implementation of fixed output size variations of SHA-2.
  • Tooling:
  • `unused_variable` lint mode for unused variables (default: warn).
  • `unused_unsafe` lint mode for detecting unnecessary `unsafe` blocks (default: warn).
  • `unused_mut` lint mode for identifying unused `mut` qualifiers (default: warn).
  • `dead_assignment` lint mode for unread variables (default: warn).
  • `unnecessary_allocation` lint mode detects some heap allocations that are immediately borrowed so could be written without allocating (default: warn).
  • `missing_doc` lint mode (default: allow).
  • `unreachable_code` lint mode (default: warn).
  • The `rusti` command has been rewritten and a number of bugs addressed.
  • rustc outputs in color on more terminals.
  • rustc accepts a `--link-args` flag to pass arguments to the linker.
  • rustc accepts a `-Z print-link-args` flag for debugging linkage.
  • Compiling with `-g` will make the binary record information about dynamic borrowcheck failures for debugging.
  • rustdoc has a nicer stylesheet.
  • Various improvements to rustdoc.
  • Improvements to rustpkg (see the detailed release notes).

New in Rust 0.6 (Apr 5, 2013)

  • Syntax changes:
  • The self type parameter in traits is now spelled `Self`
  • The `self` parameter in trait and impl methods must now be explicitly named (for example: `fn f(&self) { }`). Implicit self is deprecated.
  • Static methods no longer require the `static` keyword and instead are distinguished by the lack of a `self` parameter
  • Replaced the `Durable` trait with the `'static` lifetime
  • The old closure type syntax with the trailing sigil has been removed in favor of the more consistent leading sigil
  • `super` is a keyword, and may be prefixed to paths
  • Trait bounds are separated with `+` instead of whitespace
  • Traits are implemented with `impl Trait for Type` instead of `impl Type: Trait`
  • Lifetime syntax is now `&'l foo` instead of `&l/foo`
  • The `export` keyword has finally been removed
  • The `move` keyword has been removed (see "Semantic changes")
  • The interior mutability qualifier on vectors, `[mut T]`, has been removed. Use `&mut [T]`, etc.
  • `mut` is no longer valid in `~mut T`. Use inherited mutability
  • `fail` is no longer a keyword. Use `fail!()`
  • `assert` is no longer a keyword. Use `assert!()`
  • `log` is no longer a keyword. use `debug!`, etc.
  • 1-tuples may be represented as `(T,)`
  • Struct fields may no longer be `mut`. Use inherited mutability, `@mut T`, `core::mut` or `core::cell`
  • `extern mod { ... }` is no longer valid syntax for foreign function modules. Use extern blocks: `extern { ... }`
  • Newtype enums removed. Use tuple-structs.
  • Trait implementations no longer support visibility modifiers
  • Pattern matching over vectors improved and expanded
  • `const` renamed to `static` to correspond to lifetime name, and make room for future `static mut` unsafe mutable globals.
  • Replaced `#[deriving_eq]` with `#[deriving(Eq)]`, etc.
  • `Clone` implementations can be automatically generated with `#[deriving(Clone)]`
  • Casts to traits must use a pointer sigil, e.g. `@foo as @Bar` instead of `foo as Bar`.
  • Fixed length vector types are now written as `[int, .. 3]` instead of `[int
  • 3]`.
  • Fixed length vector types can express the length as a constant expression. (ex: `[int, .. GL_BUFFER_SIZE - 2]`)
  • Semantic changes:
  • Types with owned pointers or custom destructors move by default, eliminating the `move` keyword
  • All foreign functions are considered unsafe
  • &mut is now unaliasable
  • Writes to borrowed @mut pointers are prevented dynamically
  • () has size 0
  • The name of the main function can be customized using #[main]
  • The default type of an inferred closure is &fn instead of @fn
  • `use` statements may no longer be "chained" - they cannot import identifiers imported by previous `use` statements
  • `use` statements are crate relative, importing from the "top" of the crate by default. Paths may be prefixed with `super::` or `self::` to change the search behavior.
  • Method visibility is inherited from the implementation declaration
  • Structural records have been removed
  • Many more types can be used in static items, including enums 'static-lifetime pointers and vectors
  • Pattern matching over vectors improved and expanded
  • Typechecking of closure types has been overhauled to improve inference and eliminate unsoundness
  • Macros leave scope at the end of modules, unless that module is tagged with #[macro_escape]
  • Libraries:
  • Added big integers to `std::bigint`
  • Removed `core::oldcomm` module
  • Added pipe-based `core::comm` module
  • Numeric traits have been reorganized under `core::num`
  • `vec::slice` finally returns a slice
  • `debug!` and friends don't require a format string, e.g. `debug!(Foo)`
  • Containers reorganized around traits in `core::container`
  • `core::dvec` removed, `~[T]` is a drop-in replacement
  • `core::send_map` renamed to `core::hashmap`
  • `std::map` removed; replaced with `core::hashmap`
  • `std::treemap` reimplemented as an owned balanced tree
  • `std::deque` and `std::smallintmap` reimplemented as owned containers
  • `core::trie` added as a fast ordered map for integer keys
  • Set types added to `core::hashmap`, `core::trie` and `std::treemap`
  • `Ord` split into `Ord` and `TotalOrd`. `Ord` is still used to overload the comparison operators, whereas `TotalOrd` is used by certain container types
  • Other:
  • Replaced the 'cargo' package manager with 'rustpkg'
  • Added all-purpose 'rust' tool
  • `rustc --test` now supports benchmarks with the `#[bench]` attribute
  • rustc now *attempts
  • to offer spelling suggestions
  • Improved support for ARM and Android
  • Preliminary MIPS backend
  • Improved foreign function ABI implementation for x86, x86_64
  • Various memory usage improvements
  • Rust code may be embedded in foreign code under limited circumstances
  • Inline assembler supported by new asm!() syntax extension.

New in Rust 0.5 (Dec 27, 2012)

  • Syntax changes:
  • Removed `

New in Rust 0.4 (Oct 17, 2012)

  • Syntax:
  • All keywords are now strict and may not be used as identifiers anywhere
  • Keyword removal: 'again', 'import', 'check', 'new', 'owned', 'send', 'of', 'with', 'to', 'class'.
  • Classes are replaced with simpler structs
  • Explicit method self types
  • `ret` became `return` and `alt` became `match`
  • `import` is now `use`; `use is now `extern mod`
  • `extern mod { ... }` is now `extern { ... }`
  • `use mod` is the recommended way to import modules
  • `pub` and `priv` replace deprecated export lists
  • The syntax of `match` pattern arms now uses fat arrow (=>)
  • `main` no longer accepts an args vector; use `os::args` instead
  • Semantics:
  • Trait implementations are now coherent, ala Haskell typeclasses
  • Trait methods may be static
  • Argument modes are deprecated
  • Borrowed pointers are much more mature and recommended for use
  • Strings and vectors in the static region are stored in constant memory
  • Typestate was removed
  • Resolution rewritten to be more reliable
  • Support for 'dual-mode' data structures (freezing and thawing)
  • Libraries:
  • Most binary operators can now be overloaded via the traits in `core::ops'
  • `std::net::url` for representing URLs
  • Sendable hash maps in `core::send_map`
  • `core::task' gained a (currently unsafe) task-local storage API
  • Concurrency:
  • An efficient new intertask communication primitive called the pipe, along with a number of higher-level channel types, in `core::pipes`
  • `std::arc`, an atomically reference counted, immutable, shared memory type
  • `std::sync`, various exotic synchronization tools based on arcs and pipes
  • Futures are now based on pipes and sendable
  • More robust linked task failure
  • Improved task builder API
  • Other:
  • Improved error reporting
  • Preliminary JIT support
  • Preliminary work on precise GC
  • Extensive architectural improvements to rustc
  • Begun a transition away from buggy C++-based reflection (shape) code to Rust-based (visitor) code
  • All hash functions and tables converted to secure, randomized SipHash

New in Rust 0.3.1 (Oct 4, 2012)

  • OS X bugfix release. There was a very minor makefile bug in 0.3 that affected the 'make
  • install' target in the 0.3 release on macs, only.

New in Rust 0.3.1 (Oct 4, 2012)

  • OS X bugfix release.

New in Rust 0.2 (Mar 30, 2012)

  • 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