Email me

Rust versions / 1.16

Rust release · Mar 16, 2017

Rust 1.16: what's new, what was stabilized

Short answerRust 1.16 was released on Mar 16, 2017: 21 newly stable APIs (VecDeque::truncate, VecDeque::resize, String::insert_str, Duration::checked_add, ...); 6 compatibility notes that can affect existing code.

Mar 16, 2017release date
0language stabilizations
21APIs stabilized
-new edition

← Rust 1.15All versionsRust 1.17 →

21 APIs stabilized

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, <*const T>::wrapping_offset, <*mut T>::wrapping_offset, CommandExt::creation_flags, File::set_permissions, String::split_off

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:

  • [Uninhabitable enums (those without any variants) no longer permit wildcard
  • In this release, references to uninhabited types can not be
  • [The compiler's dead_code lint now accounts for type aliases][38051].
  • [Ctrl-Z returns from Stdin.read() when reading from the console on
  • [Clean up semantics of self in an import list][38313]
  • Reimplemented lifetime elision. This change was almost entirely compatible

Use it

rustup update stable        # get the newest release
rustup install 1.16          # or exactly this one
rustup override set 1.16     # pin a project to it

To require at least this version from users of your crate, set rust-version = "1.16" 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 compiler's dead_code lint now accounts for type aliases][38051].
  • [Uninhabitable enums (those without any variants) no longer permit wildcard match patterns][38069]
  • [Clean up semantics of self in an import list][38313]
  • [Self may appear in impl headers][38920]
  • [Self may appear in struct expressions][39282]

Compiler

  • [rustc now supports --emit=metadata, which causes rustc to emit a .rmeta file containing only crate metadata][38571]. 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][38927]. Together with the overhaul of "no resolution"/"unexpected resolution" errors (#[38154]) they result in large and systematic improvement in resolution diagnostics.
  • [Fix transmute::<T, U> where T requires a bigger alignment than U][38670]
  • [rustc: use -Xlinker when specifying an rpath with ',' in it][38798]
  • [rustc no longer attempts to provide "consider using an explicit lifetime" suggestions][37057]. 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]
  • [<*const T>::wrapping_offset]
  • [<*mut T>::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][37761]
  • [All public types in std implement Debug][38006]
  • [IpAddr implements From<Ipv4Addr> and From<Ipv6Addr>][38327]
  • [Ipv6Addr implements From<[u16; 8]>][38131]
  • [Ctrl-Z returns from Stdin.read() when reading from the console on Windows][38274]
  • [std: Fix partial writes in LineWriter][38062]
  • [std: Clamp max read/write sizes on Unix][38622]
  • [Use more specific panic message for &str slicing errors][38066]
  • [TcpListener::set_only_v6 is deprecated][38304]. 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][38469]
  • [Implement iter::Sum and iter::Product for Result][38580]
  • [Reduce the size of static data in std_unicode::tables][38781]
  • [char::EscapeDebug, EscapeDefault, EscapeUnicode, CaseMappingIter, ToLowercase, ToUppercase, implement Display][38909]
  • [Duration implements Sum][38712]
  • [String implements ToSocketAddrs][39048]

Cargo

  • [The cargo check command does a type check of a project without building it][cargo/3296]
  • [crates.io will display CI badges from Travis and AppVeyor, if specified in Cargo.toml][cargo/3546]
  • [crates.io will display categories listed in Cargo.toml][cargo/3301]
  • [Compilation profiles accept integer values for debug, in addition to true and false. These are passed to rustc as the value to -C debuginfo][cargo/3534]
  • [Implement cargo --version --verbose][cargo/3604]
  • [All builds now output 'dep-info' build dependencies compatible with make and ninja][cargo/3557]
  • [Build all workspace members with build --all][cargo/3511]
  • [Document all workspace members with doc --all][cargo/3515]
  • [Path deps outside workspace are not members][cargo/3443]

Misc

  • [rustdoc has a --sysroot argument that, like rustc, specifies the path to the Rust implementation][38589]
  • [The armv7-linux-androideabi target no longer enables NEON extensions, per Google's ABI guide][38413]
  • [The stock standard library can be compiled for Redox OS][38401]
  • [Rust has initial SPARC support][38726]. Tier 3. No builds available.
  • [Rust has experimental support for Nvidia PTX][38559]. Tier 3. No builds available.
  • [Fix backtraces on i686-pc-windows-gnu by disabling FPO][39379]

Compatibility Notes

Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.

← Rust 1.15All versionsRust 1.17 →

Up next

Next releaseRust 1.17Released Apr 27, 2017.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ