A language empowering everyone to build reliable and efficient software

Rust for Mac

Join our mailing list

Stay up to date with latest software releases, news, software discounts, deals and more.

Download Rust 1.66.1

  -  203 MB  -  Open Source

What's new in this version:

Rust 1.66.1
- Fixes Cargo not verifying SSH host keys when cloning dependencies or registry indexes with SSH

Rust 1.66.0
- 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

- 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

- 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

- Add Rustdoc warning for invalid HTML tags in the documentation

- 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

Rust 1.65.0
- 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

- 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

- 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

- 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.

Rust 1.63.0
- 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

- 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

- 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::<[T]>::len
- ToOwned::clone_into
- Ipv6Addr::to_ipv4_mapped
- Unix::io::AsFd
- Unix::io::BorrowedFd<'fd>
- Unix::io::OwnedFd
- Windows::io::AsHandle
- Windows::io::BorrowedHandle<'handle>
- Windows::io::OwnedHandle
- Windows::io::HandleOrInvalid
- Windows::io::HandleOrNull
- Windows::io::InvalidHandleError
- Windows::io::NullHandleError
- Windows::io::AsSocket
- Windows::io::BorrowedSocket<'handle>
- Windows::io::OwnedSocket
- Thread::scope
- Thread::Scope
- Thread::ScopedJoinHandle

These APIs are now usable in const contexts:
- Array::from_ref
- Slice::from_ref
- Intrinsics::copy
- Intrinsics::copy_nonoverlapping
- <*const T>::copy_to
- <*const T>::copy_to_nonoverlapping
- <*mut T>::copy_to
- <*mut T>::copy_to_nonoverlapping
- <*mut T>::copy_from
- <*mut T>::copy_from_nonoverlapping
- Str::from_utf8
- Utf8Error::error_len
- Utf8Error::valid_up_to
- Condvar::new
- Mutex::new
- RwLock::new

- Stabilize the --config path command-line argument
- Expose rust-version in the environment as CARGO_PKG_RUST_VERSION

Rust 1.62.0
- 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

- 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*

- 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<[u8]>
- From for Arc<[u8]>
- FusedIterator for EncodeWide
- RDM intrinsics on aarch64

- Create clippy lint against unexpectedly late drop for temporaries in match scrutinee expressions

- Added the cargo add command for adding dependencies to Cargo.toml from the command-line. docs
- Package ID specs now support [email protected] 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
- rustdoc: Remove .woff font files
- Enforce Copy bounds for repeat elements while considering lifetimes

Internal Changes:
- Unify ReentrantMutex implementations across all platforms

Rust 1.61.0
- Custom exit codes from main
- More capabilities for const fn
- Static handles for locked stdio
- Stabilized APIs
- Other changes

Rust 1.58.1
- The non_send_fields_in_send_ty Clippy lint was discovered to have too many false positives and has been moved to the experimental lints group (called "nursery")
- The useless_format Clippy lint has been updated to handle captured identifiers in format strings, introduced in Rust 1.58.0
- A regression in Rustfmt preventing generated files from being formatted when passed through the standard input has been fixed
- An incorrect error message displayed by rustc in some cases has been fixed

Rust 1.58.0
- 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

- 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.

- 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<T, P>: Clone not require T: Clone
- Implement Termination for Result<Infallible, E>. This allows writing fn main() -> Result<Infallible, ErrorType>, for a program whose successful exits never involve returning from main (for instance, a program that calls exit, or that uses exec to run another program).

Stabilized APIs:
- Metadata::is_symlink
- Path::is_symlink
- {integer}::saturating_div
- Option::unwrap_unchecked
- Result::unwrap_unchecked
- Result::unwrap_err_unchecked
- NonZero{unsigned}::is_power_of_two
- File::options
- These APIs are now usable in const contexts:
- Duration::new
- Duration::checked_add
- Duration::saturating_add
- Duration::checked_sub
- Duration::saturating_sub
- Duration::checked_mul
- Duration::saturating_mul
- Duration::checked_div
- MaybeUninit::as_ptr
- MaybeUninit::as_mut_ptr
- MaybeUninit::assume_init
- MaybeUninit::assume_init_ref

- Add --message-format for install command
- Warn when alias shadows external subcommand

- 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

Rust 1.57.0
- 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

- 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

- 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

- Stabilize custom profiles
- Compatibility notes

Internal changes:
- These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools
- Added an experimental backend for codegen with libgccjit

Rust 1.55.0
- 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::*;).

- 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<[u8]>.

Stabilised APIs:
- Bound::cloned
- Drain::as_str
- IntoInnerError::into_error
- IntoInnerError::into_parts
- MaybeUninit::assume_init_mut
- MaybeUninit::assume_init_ref
- MaybeUninit::write
- array::map
- ops::ControlFlow
- x86::_bittest
- x86::_bittestandcomplement
- x86::_bittestandreset
- x86::_bittestandset
- x86_64::_bittest64
- x86_64::_bittestandcomplement64
- x86_64::_bittestandreset64
- x86_64::_bittestandset64

- Cargo 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

- 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

Rust 1.54.0
- You can now use macros for values in built-in attribute macros. While a seemingly minor addition on its own, this enables a lot of powerful functionality when combined correctly. Most notably you can now include external documentation in your crate by writing the following.
- #![doc = include_str!("README.md")]

You can also use this to include auto-generated modules:
- #[path = concat!(env!("OUT_DIR"), "/generated.rs")] mod generated
- You can now cast between unsized slice types (and types which contain unsized slices) in const fn
- You can now use multiple generic lifetimes with impl Trait where the lifetimes don't explicitly outlive another. In code this means that you can now have impl Trait<'a, 'b> where as before you could only have impl Trait<'a, 'b> where 'b: 'a.

- 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

- 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

- 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

Rust 1.53.0
- You can now use unicode for identifiers. This allows multilingual identifiers but still doesn't allow glyphs that are not considered characters such as ◆ or 🦀. More specifically you can now use any identifier that matches the UAX #31 "Unicode Identifier and Pattern Syntax" standard. This is the same standard as languages like Python, however Rust uses NFC normalization which may be different from other languages.
- You can now specify "or patterns" inside pattern matches. Previously you could only use | (OR) on complete patterns. E.g.
- Added the :pat_param macro_rules! matcher. This matcher has the same semantics as the :pat matcher. This is to allow :pat to change semantics to being a pattern fragment in a future edition.

- 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

- Abort messages will now forward to android_set_abort_message on Android platforms when available
- slice::IterMut<'_, T> now implements AsRef<[T]>
- Arrays of any length now implement IntoIterator. Currently calling .into_iter() as a method on an array will return impl Iterator<Item=&T>, but this may change in a future edition to change Item to T. Calling IntoIterator::into_iter directly on arrays will provide impl Iterator<Item=T> as expected.
- leading_zeros, and trailing_zeros are now available on all NonZero integer types.
- {f32, f64}::from_str now parse and print special values (NaN, -0) according to IEEE RFC 754.
- You can now index into slices using (Bound, Bound)
- Add the BITS associated constant to all numeric types

Rust 1.52.1
- Change log not available for this version

Rust 1.52.0
- 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

- 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

- 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::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 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

- 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.

Rust 1.51.0
- 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.

- 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

- 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

- 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 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

- 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

Rust 1.50.0
- 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

- 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

- 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

- 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

- 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

- 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. E.g
- #[derive(Debug)]
- struct Person {
- name: String,
- age: u8,
- let person = Person {
- name: String::from("Alice"),
- age: 20,
- // `name` is moved out of person, but `age` is referenced
- let Person { name, ref age } = person;
- println!("{} {}", name, age);

- 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

- 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

- 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

Join our mailing list

Stay up to date with latest software releases, news, software discounts, deals and more.