Rust versions / 1.17
Rust release · Apr 27, 2017
Rust 1.17: what's new, what was stabilized
Short answerRust 1.17 was released on Apr 27, 2017: 19 newly stable APIs (Arc::into_raw, Arc::from_raw, Arc::ptr_eq, Rc::into_raw, ...); 12 compatibility notes that can affect existing code.
← Rust 1.16All versionsRust 1.18 →
19 APIs stabilized
Arc::into_raw, Arc::from_raw, Arc::ptr_eq, Rc::into_raw, Rc::from_raw, Rc::ptr_eq, Ordering::then, Ordering::then_with, BTreeMap::range, BTreeMap::range_mut, collections::Bound, process::abort, ptr::read_unaligned, ptr::write_unaligned, Result::expect_err, Cell::swap, Cell::replace, Cell::into_inner, Cell::take
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:
- [Rust 1.17 does not correctly detect the MSVC 2017 linker][38584]. As a
- [When coercing to an unsized type lifetimes must be equal][40319]. That is,
- [
format!andDisplay::to_stringpanic if an underlying formatting - [In-tree crates are verified to be unstable][39851]. Previously, some minor
- [Rust git source no longer includes vendored crates][39728]. Those that need
- [Fix inert attributes from
proc_macro_derives][39572] - [During crate resolution, rustc prefers a crate in the sysroot if two crates
- [Fixed bugs around how type inference interacts with dead-code][39485]. The
- [Tuple-struct constructors with private fields are no longer visible][38932]
- [Lifetime parameters that do not appear in the arguments are now considered
- [rustdoc: fix doctests with non-feature crate attributes][38161]
- [Make transmuting from fn item types to pointer-sized types a hard
Use it
rustup update stable # get the newest release
rustup install 1.17 # or exactly this one
rustup override set 1.17 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.17" 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
- [The lifetime of statics and consts defaults to
'static][39265]. [RFC 1623] - [Fields of structs may be initialized without duplicating the field/variable names][39761]. [RFC 1682]
- [
Selfmay be included in thewhereclause ofimpls][38864]. [RFC 1647] - [When coercing to an unsized type lifetimes must be equal][40319]. That is, there is no subtyping between
TandUwhenT: Unsize<U>. For example, coercing&mut [&'a X; N]to&mut [&'b X]requires'abe equal to'b. Soundness fix. - [Values passed to the indexing operator,
[], automatically coerce][40166] - [Static variables may contain references to other statics][40027]
Compiler
- [Exit quickly on only
--emit dep-info][40336] - [Make
-C relocation-modelmore correctly determine whether the linker creates a position-independent executable][40245] - [Add
-C overflow-checksto directly control whether integer overflow panics][40037] - [The rustc type checker now checks items on demand instead of in a single in-order pass][40008]. This is mostly an internal refactoring in support of future work, including incremental type checking, but also resolves [RFC 1647], allowing
Selfto appear inimplwhereclauses. - [Optimize vtable loads][39995]
- [Turn off vectorization for Emscripten targets][39990]
- [Provide suggestions for unknown macros imported with
use][39953] - [Fix ICEs in path resolution][39939]
- [Strip exception handling code on Emscripten when
panic=abort][39193] - [Add clearer error message using
&str + &str][39116]
Stabilized APIs
- [
Arc::into_raw] - [
Arc::from_raw] - [
Arc::ptr_eq] - [
Rc::into_raw] - [
Rc::from_raw] - [
Rc::ptr_eq] - [
Ordering::then] - [
Ordering::then_with] - [
BTreeMap::range] - [
BTreeMap::range_mut] - [
collections::Bound] - [
process::abort] - [
ptr::read_unaligned] - [
ptr::write_unaligned] - [
Result::expect_err] - [
Cell::swap] - [
Cell::replace] - [
Cell::into_inner] - [
Cell::take]
Libraries
- [
BTreeMapandBTreeSetcan iterate over ranges][27787] - [
Cellcan store non-Copytypes][39793]. [RFC 1651] - [
StringimplementsFromIterator<&char>][40028] Box[implements][40009] a number of new conversions:From<Box<str>> for String,From<Box<[T]>> for Vec<T>,From<Box<CStr>> for CString,From<Box<OsStr>> for OsString,From<Box<Path>> for PathBuf,Into<Box<str>> for String,Into<Box<[T]>> for Vec<T>,Into<Box<CStr>> for CString,Into<Box<OsStr>> for OsString,Into<Box<Path>> for PathBuf,Default for Box<str>,Default for Box<CStr>,Default for Box<OsStr>,From<&CStr> for Box<CStr>,From<&OsStr> for Box<OsStr>,From<&Path> for Box<Path>- [
ffi::FromBytesWithNulErrorimplementsErrorandDisplay][39960] - [Specialize
PartialOrd<A> for [A] where A: Ord][39642] - [Slightly optimize
slice::sort][39538] - [Add
ToStringtrait specialization forCow<'a, str>andString][39440] - [
Box<[T]>implementsFrom<&[T]> where T: Copy,Box<str>implementsFrom<&str>][39438] - [
IpAddrimplementsFromfor various arrays.SocketAddrimplementsFrom<(I, u16)> where I: Into<IpAddr>][39372] - [
format!estimates the needed capacity before writing a string][39356] - [Support unprivileged symlink creation in Windows][38921]
- [
PathBufimplementsDefault][38764] - [Implement
PartialEq<[A]>forVecDeque<A>][38661] - [
HashMapresizes adaptively][38368] to guard against DOS attacks and poor hash functions.
Cargo
- [Add
cargo check --all][cargo/3731] - [Add an option to ignore SSL revocation checking][cargo/3699]
- [Add
cargo run --package][cargo/3691] - [Add
required_features][cargo/3667] - [Assume
build.rsis a build script][cargo/3664] - [Find workspace via
workspace_rootlink in containing member][cargo/3562]
Misc
- [Documentation is rendered with mdbook instead of the obsolete, in-tree
rustbook][39633] - [The "Unstable Book" documents nightly-only features][ubook]
- [Improve the style of the sidebar in rustdoc output][40265]
- [Configure build correctly on 64-bit CPU's with the armhf ABI][40261]
- [Fix MSP430 breakage due to
i128][40257] - [Preliminary Solaris/SPARCv9 support][39903]
- [
rustcis linked statically on Windows MSVC targets][39837], allowing it to run without installing the MSVC runtime. - [
rustdoc --testincludes file names in test names][39788] - This release includes builds of
stdforsparc64-unknown-linux-gnu,aarch64-unknown-linux-fuchsia, andx86_64-unknown-linux-fuchsia. - [Initial support for
aarch64-unknown-freebsd][39491] - [Initial support for
i686-unknown-netbsd][39426] - [This release no longer includes the old makefile build system][39431]. Rust is built with a custom build system, written in Rust, and with Cargo.
- [Add Debug implementations for libcollection structs][39002]
- [
TypeIdimplementsPartialOrdandOrd][38981] - [
--test-threads=0produces an error][38945] - [
rustupinstalls documentation by default][40526] - [The Rust source includes NatVis visualizations][39843]. These can be used by WinDbg and Visual Studio to improve the debugging experience.
Compatibility Notes
- Rust 1.17 does not correctly detect the MSVC 2017 linker. As a workaround, either use MSVC 2015 or run vcvars.bat.
- When coercing to an unsized type lifetimes must be equal. That is, disallow subtyping between
TandUwhenT: Unsize<U>, e.g. coercing&mut [&'a X; N]to&mut [&'b X]requires'abe equal to'b. Soundness fix. format!andDisplay::to_stringpanic if an underlying formatting implementation returns an error. Previously the error was silently ignored. It is incorrect forwrite_fmtto return an error when writing to a string.- In-tree crates are verified to be unstable. Previously, some minor crates were marked stable and could be accessed from the stable toolchain.
- Rust git source no longer includes vendored crates. Those that need to build with vendored crates should build from release tarballs.
- Fix inert attributes from
proc_macro_derives - During crate resolution, rustc prefers a crate in the sysroot if two crates are otherwise identical. Unlikely to be encountered outside the Rust build system.
- Fixed bugs around how type inference interacts with dead-code. The existing code generally ignores the type of dead-code unless a type-hint is provided; this can cause surprising inference interactions particularly around defaulting. The new code uniformly ignores the result type of dead-code.
- Tuple-struct constructors with private fields are no longer visible
- Lifetime parameters that do not appear in the arguments are now considered early-bound, resolving a soundness bug (#32330). The
hr_lifetime_in_assoc_typefuture-compatibility lint has been in effect since April of 2016. - rustdoc: fix doctests with non-feature crate attributes
- Make transmuting from fn item types to pointer-sized types a hard error
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.18Released Jun 8, 2017.Read it next →Also worth your time
Did this answer your question?