rust-lang/rust
rust-lang/rust
Activity
Last release
Open issues
Open PRs
License
release notes
release notes
Published 3/25/2021
MinorContains new featuresstructs 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.
struct GenericArray<T, const LENGTH: usize> {
inner: [T; LENGTH]
}
impl<T, const LENGTH: usize> GenericArray<T, LENGTH> {
const fn last(&self) -> Option<&T> {
if LENGTH == 0 {
None
} else {
Some(&self.inner[LENGTH - 1])
}
}
}
-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.aarch64_be-unknown-linux-gnu, aarch64-unknown-linux-gnu_ilp32, and aarch64_be-unknown-linux-gnu_ilp32 targets.i386-unknown-linux-gnu and i486-unknown-linux-gnu targets.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<str>.u64 and u128 now implement From<char>.Error is now implemented for &T where T implements Error.Poll::{map_ok, map_err} are now implemented for Poll<Option<Result<T, E>>>.unsigned_abs is now implemented for all signed integer types.io::Empty now implements io::Seek.rc::Weak<T> and sync::Weak<T>'s methods such as as_ptr are now implemented for T: ?Sized types.Div and Rem by their NonZero variant is now implemented for all unsigned integers.Arc::decrement_strong_countArc::increment_strong_countOnce::call_once_forcePeekable::next_if_eqPeekable::next_ifSeek::stream_positionarray::IntoIterpanic::panic_anyptr::addr_of!ptr::addr_of_mut!slice::fill_withslice::split_inclusive_mutslice::split_inclusiveslice::strip_prefixslice::strip_suffixstr::split_inclusivesync::OnceStatetask::WakeVecDeque::rangeVecDeque::range_mutsplit-debuginfo profile option to control the -Csplit-debuginfo codegen option.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.Deref traits.--default-theme flag which sets the default theme to use for documentation.Various improvements to intra-doc links:
slice.Vec<T>.wasm-bindgen ABI, and instead use the wasm32 ABI.rustc no longer promotes division, modulo and indexing operations to const that could fail.armv5te-unknown-linux-gnueabisparc64-unknown-linux-gnuthumbv7neon-unknown-linux-gnueabihfarmv7-unknown-linux-gnueabix86_64-unknown-linux-gnux32atomic::spin_loop_hint has been deprecated. It's recommended to use hint::spin_loop instead.release notes
Published 3/25/2021
MinorContains new featuresstructs 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.
struct GenericArray<T, const LENGTH: usize> {
inner: [T; LENGTH]
}
impl<T, const LENGTH: usize> GenericArray<T, LENGTH> {
const fn last(&self) -> Option<&T> {
if LENGTH == 0 {
None
} else {
Some(&self.inner[LENGTH - 1])
}
}
}
-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.aarch64_be-unknown-linux-gnu, aarch64-unknown-linux-gnu_ilp32, and aarch64_be-unknown-linux-gnu_ilp32 targets.i386-unknown-linux-gnu and i486-unknown-linux-gnu targets.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<str>.u64 and u128 now implement From<char>.Error is now implemented for &T where T implements Error.Poll::{map_ok, map_err} are now implemented for Poll<Option<Result<T, E>>>.unsigned_abs is now implemented for all signed integer types.io::Empty now implements io::Seek.rc::Weak<T> and sync::Weak<T>'s methods such as as_ptr are now implemented for T: ?Sized types.Div and Rem by their NonZero variant is now implemented for all unsigned integers.Arc::decrement_strong_countArc::increment_strong_countOnce::call_once_forcePeekable::next_if_eqPeekable::next_ifSeek::stream_positionarray::IntoIterpanic::panic_anyptr::addr_of!ptr::addr_of_mut!slice::fill_withslice::split_inclusive_mutslice::split_inclusiveslice::strip_prefixslice::strip_suffixstr::split_inclusivesync::OnceStatetask::WakeVecDeque::rangeVecDeque::range_mutsplit-debuginfo profile option to control the -Csplit-debuginfo codegen option.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.Deref traits.--default-theme flag which sets the default theme to use for documentation.Various improvements to intra-doc links:
slice.Vec<T>.wasm-bindgen ABI, and instead use the wasm32 ABI.rustc no longer promotes division, modulo and indexing operations to const that could fail.armv5te-unknown-linux-gnueabisparc64-unknown-linux-gnuthumbv7neon-unknown-linux-gnueabihfarmv7-unknown-linux-gnueabix86_64-unknown-linux-gnux32atomic::spin_loop_hint has been deprecated. It's recommended to use hint::spin_loop instead.Empowering everyone to build reliable and efficient software.