Rust versions / 1.32
Rust release · Jan 17, 2019
Rust 1.32: what's new, what was stabilized
Short answerRust 1.32 was released on Jan 17, 2019: 72 newly stable APIs (i8::to_be_bytes, i8::to_le_bytes, i8::to_ne_bytes, i8::from_be_bytes, ...); 1 compatibility note that can affect existing code.
← Rust 1.31All versionsRust 1.33 →
72 APIs stabilized
i8::to_be_bytes, i8::to_le_bytes, i8::to_ne_bytes, i8::from_be_bytes, i8::from_le_bytes, i8::from_ne_bytes, i16::to_be_bytes, i16::to_le_bytes, i16::to_ne_bytes, i16::from_be_bytes, i16::from_le_bytes, i16::from_ne_bytes, i32::to_be_bytes, i32::to_le_bytes, i32::to_ne_bytes, i32::from_be_bytes, i32::from_le_bytes, i32::from_ne_bytes, i64::to_be_bytes, i64::to_le_bytes, i64::to_ne_bytes, i64::from_be_bytes, i64::from_le_bytes, i64::from_ne_bytes, i128::to_be_bytes, i128::to_le_bytes, i128::to_ne_bytes, i128::from_be_bytes, i128::from_le_bytes, i128::from_ne_bytes, isize::to_be_bytes, isize::to_le_bytes, isize::to_ne_bytes, isize::from_be_bytes, isize::from_le_bytes, isize::from_ne_bytes, u8::to_be_bytes, u8::to_le_bytes, u8::to_ne_bytes, u8::from_be_bytes, u8::from_le_bytes, u8::from_ne_bytes, u16::to_be_bytes, u16::to_le_bytes, u16::to_ne_bytes, u16::from_be_bytes, u16::from_le_bytes, u16::from_ne_bytes, u32::to_be_bytes, u32::to_le_bytes, u32::to_ne_bytes, u32::from_be_bytes, u32::from_le_bytes, u32::from_ne_bytes, u64::to_be_bytes, u64::to_le_bytes, u64::to_ne_bytes, u64::from_be_bytes, u64::from_le_bytes, u64::from_ne_bytes, u128::to_be_bytes, u128::to_le_bytes, u128::to_ne_bytes, u128::from_be_bytes, u128::from_le_bytes, u128::from_ne_bytes, usize::to_be_bytes, usize::to_le_bytes, usize::to_ne_bytes, usize::from_be_bytes, usize::from_le_bytes, usize::from_ne_bytes
Can it break my build?
The release lists these compatibility notes. Most only affect rare code, but read them before you raise your toolchain in CI:
- [The argument types for AVX's
Use it
rustup update stable # get the newest release
rustup install 1.32 # or exactly this one
rustup override set 1.32 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.32" under [package] in Cargo.toml. Cargo then refuses to build it on older compilers with a clear message, and with resolver 3 (the default on the 2024 edition, Rust 1.85+) it also prefers dependency versions that support it.
Full release notes
Language
2018 edition
- [You can now use the
?operator in macro definitions.][56245] The?operator allows you to specify zero or one repetitions similar to the*and+operators. - [Module paths with no leading keyword like
super,self, orcrate, will now always resolve to the item (enum,struct, etc.) available in the module if present, before resolving to a external crate or an item the prelude.][56759] E.g. ```rust enum Color { Red, Green, Blue }
use Color::*; ```
All editions
- [You can now match against
PhantomData<T>types.][55837] - [You can now match against literals in macros with the
literalspecifier.][56072] This will match against a literal of any type. E.g.1,'A',"Hello World" - [Self can now be used as a constructor and pattern for unit and tuple structs.][56365] E.g. ```rust struct Point(i32, i32);
impl Point { pub fn new(x: i32, y: i32) -> Self { Self(x, y) }
pub fn is_origin(&self) -> bool { match self { Self(0, 0) => true, _ => false, } } } ```
- [Self can also now be used in type definitions.][56366] E.g. ``
rust enum List<T> where Self: PartialOrd<Self> // can writeSelfinstead ofList<T>{ Nil, Cons(T, Box<Self>) // likewise here }`` - [You can now mark traits with
#[must_use].][55663] This provides a warning if aimpl Traitordyn Traitis returned and unused in the program.
Compiler
- [The default allocator has changed from jemalloc to the default allocator on your system.][55238] The compiler itself on Linux & macOS will still use jemalloc, but programs compiled with it will use the system allocator.
- [Added the
aarch64-pc-windows-msvctarget.][55702]
Libraries
- [
PathBufnow implementsFromStr.][55148] - [
Box<[T]>now implementsFromIterator<T>.][55843] - [The
dbg!macro has been stabilized.][56395] This macro enables you to easily debug expressions in your rust program. E.g. ``rust let a = 2; let b = dbg!(a * 2) + 1; // ^-- prints: [src/main.rs:4] a * 2 = 4 assert_eq!(b, 5);``
The following APIs are now const functions and can be used in a const context.
- [
Cell::as_ptr] - [
UnsafeCell::get] - [
char::is_ascii] - [
iter::empty] - [
ManuallyDrop::new] - [
ManuallyDrop::into_inner] - [
RangeInclusive::start] - [
RangeInclusive::end] - [
NonNull::as_ptr] - [
slice::as_ptr] - [
str::as_ptr] - [
Duration::as_secs] - [
Duration::subsec_millis] - [
Duration::subsec_micros] - [
Duration::subsec_nanos] - [
CStr::as_ptr] - [
Ipv4Addr::is_unspecified] - [
Ipv6Addr::new] - [
Ipv6Addr::octets]
Stabilized APIs
- [
i8::to_be_bytes] - [
i8::to_le_bytes] - [
i8::to_ne_bytes] - [
i8::from_be_bytes] - [
i8::from_le_bytes] - [
i8::from_ne_bytes] - [
i16::to_be_bytes] - [
i16::to_le_bytes] - [
i16::to_ne_bytes] - [
i16::from_be_bytes] - [
i16::from_le_bytes] - [
i16::from_ne_bytes] - [
i32::to_be_bytes] - [
i32::to_le_bytes] - [
i32::to_ne_bytes] - [
i32::from_be_bytes] - [
i32::from_le_bytes] - [
i32::from_ne_bytes] - [
i64::to_be_bytes] - [
i64::to_le_bytes] - [
i64::to_ne_bytes] - [
i64::from_be_bytes] - [
i64::from_le_bytes] - [
i64::from_ne_bytes] - [
i128::to_be_bytes] - [
i128::to_le_bytes] - [
i128::to_ne_bytes] - [
i128::from_be_bytes] - [
i128::from_le_bytes] - [
i128::from_ne_bytes] - [
isize::to_be_bytes] - [
isize::to_le_bytes] - [
isize::to_ne_bytes] - [
isize::from_be_bytes] - [
isize::from_le_bytes] - [
isize::from_ne_bytes] - [
u8::to_be_bytes] - [
u8::to_le_bytes] - [
u8::to_ne_bytes] - [
u8::from_be_bytes] - [
u8::from_le_bytes] - [
u8::from_ne_bytes] - [
u16::to_be_bytes] - [
u16::to_le_bytes] - [
u16::to_ne_bytes] - [
u16::from_be_bytes] - [
u16::from_le_bytes] - [
u16::from_ne_bytes] - [
u32::to_be_bytes] - [
u32::to_le_bytes] - [
u32::to_ne_bytes] - [
u32::from_be_bytes] - [
u32::from_le_bytes] - [
u32::from_ne_bytes] - [
u64::to_be_bytes] - [
u64::to_le_bytes] - [
u64::to_ne_bytes] - [
u64::from_be_bytes] - [
u64::from_le_bytes] - [
u64::from_ne_bytes] - [
u128::to_be_bytes] - [
u128::to_le_bytes] - [
u128::to_ne_bytes] - [
u128::from_be_bytes] - [
u128::from_le_bytes] - [
u128::from_ne_bytes] - [
usize::to_be_bytes] - [
usize::to_le_bytes] - [
usize::to_ne_bytes] - [
usize::from_be_bytes] - [
usize::from_le_bytes] - [
usize::from_ne_bytes]
Cargo
- [You can now run
cargo cas an alias forcargo check.][cargo/6218] - [Usernames are now allowed in alt registry URLs.][cargo/6242]
Misc
- [
libproc_macrohas been added to therust-srcdistribution.][55280]
Compatibility Notes
- The argument types for AVX's
_mm256_stream_si256,_mm256_stream_pd,_mm256_stream_pshave been changed from*constto*mutas the previous implementation was unsound.
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.33Released Feb 28, 2019.Read it next →Also worth your time
Did this answer your question?