Email me

Rust versions / 1.9

Rust release · May 26, 2016

Rust 1.9: what's new, what was stabilized

Short answerRust 1.9 was released on May 26, 2016: 86 newly stable APIs (std::panic, std::panic::catch_unwind, std::panic::resume_unwind, std::panic::AssertUnwindSafe, ...); 4 compatibility notes that can affect existing code.

May 26, 2016release date
0language stabilizations
86APIs stabilized
-new edition

← Rust 1.8All versionsRust 1.10 →

86 APIs stabilized

std::panic, std::panic::catch_unwind, std::panic::resume_unwind, std::panic::AssertUnwindSafe, std::panic::UnwindSafe, str::is_char_boundary, <*const T>::as_ref, <*mut T>::as_ref, <*mut T>::as_mut, AsciiExt::make_ascii_uppercase, AsciiExt::make_ascii_lowercase, char::decode_utf16, char::DecodeUtf16, char::DecodeUtf16Error, char::DecodeUtf16Error::unpaired_surrogate, BTreeSet::take, BTreeSet::replace, BTreeSet::get, HashSet::take, HashSet::replace, HashSet::get, OsString::with_capacity, OsString::clear, OsString::capacity, OsString::reserve, OsString::reserve_exact, OsStr::is_empty, OsStr::len, std::os::unix::thread, RawPthread, JoinHandleExt, JoinHandleExt::as_pthread_t, JoinHandleExt::into_pthread_t, HashSet::hasher, HashMap::hasher, CommandExt::exec, File::try_clone, SocketAddr::set_ip, SocketAddr::set_port, SocketAddrV4::set_ip, SocketAddrV4::set_port, SocketAddrV6::set_ip, SocketAddrV6::set_port, SocketAddrV6::set_flowinfo, SocketAddrV6::set_scope_id, slice::copy_from_slice, ptr::read_volatile, ptr::write_volatile, OpenOptions::create_new, TcpStream::set_nodelay, TcpStream::nodelay, TcpStream::set_ttl, TcpStream::ttl, TcpStream::set_only_v6, TcpStream::only_v6, TcpStream::take_error, TcpStream::set_nonblocking, TcpListener::set_ttl, TcpListener::ttl, TcpListener::set_only_v6, TcpListener::only_v6, TcpListener::take_error, TcpListener::set_nonblocking, UdpSocket::set_broadcast, UdpSocket::broadcast, UdpSocket::set_multicast_loop_v4, UdpSocket::multicast_loop_v4, UdpSocket::set_multicast_ttl_v4, UdpSocket::multicast_ttl_v4, UdpSocket::set_multicast_loop_v6, UdpSocket::multicast_loop_v6, UdpSocket::set_multicast_ttl_v6, UdpSocket::multicast_ttl_v6, UdpSocket::set_ttl, UdpSocket::ttl, UdpSocket::set_only_v6, UdpSocket::only_v6, UdpSocket::join_multicast_v4, UdpSocket::join_multicast_v6, UdpSocket::leave_multicast_v4, UdpSocket::leave_multicast_v6, UdpSocket::take_error, UdpSocket::connect, UdpSocket::send, UdpSocket::recv, UdpSocket::set_nonblocking

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:

  • [std::sync::Once is poisoned if its initialization function
  • [It is illegal to define methods with the same name in overlapping
  • [fn item types are zero sized, and each fn names a unique
  • [Improvements to const evaluation may trigger new errors when integer

Use it

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

To require at least this version from users of your crate, set rust-version = "1.9" 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 #[deprecated] attribute when applied to an API will generate warnings when used. The warnings may be suppressed with #[allow(deprecated)]. [RFC 1270].
  • [fn item types are zero sized, and each fn names a unique type][1.9fn]. This will break code that transmutes fns, so calling transmute on a fn type will generate a warning for a few cycles, then will be converted to an error.
  • [Field and method resolution understand visibility, so private fields and methods cannot prevent the proper use of public fields and methods][1.9fv].
  • [The parser considers unicode codepoints in the PATTERN_WHITE_SPACE category to be whitespace][1.9ws].

Stabilized APIs

  • [std::panic]
  • [std::panic::catch_unwind] (renamed from recover)
  • [std::panic::resume_unwind] (renamed from propagate)
  • [std::panic::AssertUnwindSafe] (renamed from AssertRecoverSafe)
  • [std::panic::UnwindSafe] (renamed from RecoverSafe)
  • [str::is_char_boundary]
  • [<*const T>::as_ref]
  • [<*mut T>::as_ref]
  • [<*mut T>::as_mut]
  • [AsciiExt::make_ascii_uppercase]
  • [AsciiExt::make_ascii_lowercase]
  • [char::decode_utf16]
  • [char::DecodeUtf16]
  • [char::DecodeUtf16Error]
  • [char::DecodeUtf16Error::unpaired_surrogate]
  • [BTreeSet::take]
  • [BTreeSet::replace]
  • [BTreeSet::get]
  • [HashSet::take]
  • [HashSet::replace]
  • [HashSet::get]
  • [OsString::with_capacity]
  • [OsString::clear]
  • [OsString::capacity]
  • [OsString::reserve]
  • [OsString::reserve_exact]
  • [OsStr::is_empty]
  • [OsStr::len]
  • [std::os::unix::thread]
  • [RawPthread]
  • [JoinHandleExt]
  • [JoinHandleExt::as_pthread_t]
  • [JoinHandleExt::into_pthread_t]
  • [HashSet::hasher]
  • [HashMap::hasher]
  • [CommandExt::exec]
  • [File::try_clone]
  • [SocketAddr::set_ip]
  • [SocketAddr::set_port]
  • [SocketAddrV4::set_ip]
  • [SocketAddrV4::set_port]
  • [SocketAddrV6::set_ip]
  • [SocketAddrV6::set_port]
  • [SocketAddrV6::set_flowinfo]
  • [SocketAddrV6::set_scope_id]
  • [slice::copy_from_slice]
  • [ptr::read_volatile]
  • [ptr::write_volatile]
  • [OpenOptions::create_new]
  • [TcpStream::set_nodelay]
  • [TcpStream::nodelay]
  • [TcpStream::set_ttl]
  • [TcpStream::ttl]
  • [TcpStream::set_only_v6]
  • [TcpStream::only_v6]
  • [TcpStream::take_error]
  • [TcpStream::set_nonblocking]
  • [TcpListener::set_ttl]
  • [TcpListener::ttl]
  • [TcpListener::set_only_v6]
  • [TcpListener::only_v6]
  • [TcpListener::take_error]
  • [TcpListener::set_nonblocking]
  • [UdpSocket::set_broadcast]
  • [UdpSocket::broadcast]
  • [UdpSocket::set_multicast_loop_v4]
  • [UdpSocket::multicast_loop_v4]
  • [UdpSocket::set_multicast_ttl_v4]
  • [UdpSocket::multicast_ttl_v4]
  • [UdpSocket::set_multicast_loop_v6]
  • [UdpSocket::multicast_loop_v6]
  • [UdpSocket::set_multicast_ttl_v6]
  • [UdpSocket::multicast_ttl_v6]
  • [UdpSocket::set_ttl]
  • [UdpSocket::ttl]
  • [UdpSocket::set_only_v6]
  • [UdpSocket::only_v6]
  • [UdpSocket::join_multicast_v4]
  • [UdpSocket::join_multicast_v6]
  • [UdpSocket::leave_multicast_v4]
  • [UdpSocket::leave_multicast_v6]
  • [UdpSocket::take_error]
  • [UdpSocket::connect]
  • [UdpSocket::send]
  • [UdpSocket::recv]
  • [UdpSocket::set_nonblocking]

Libraries

  • [std::sync::Once is poisoned if its initialization function fails][1.9o].
  • [cell::Ref and cell::RefMut can contain unsized types][1.9cu].
  • [Most types implement fmt::Debug][1.9db].
  • [The default buffer size used by BufReader and BufWriter was reduced to 8K, from 64K][1.9bf]. This is in line with the buffer size used by other languages.
  • [Instant, SystemTime and Duration implement += and -=. Duration additionally implements *= and /=][1.9ta].
  • [Skip is a DoubleEndedIterator][1.9sk].
  • [From<[u8; 4]> is implemented for Ipv4Addr][1.9fi].
  • [Chain implements BufRead][1.9ch].
  • [HashMap, HashSet and iterators are covariant][1.9hc].

Cargo

  • [Cargo can now run concurrently][1.9cc].
  • [Top-level overrides allow specific revisions of crates to be overridden through the entire crate graph][1.9ct]. This is intended to make upgrades easier for large projects, by allowing crates to be forked temporarily until they've been upgraded and republished.
  • [Cargo exports a CARGO_PKG_AUTHORS environment variable][1.9cp].
  • [Cargo will pass the contents of the RUSTFLAGS variable to rustc on the commandline][1.9cf]. rustc arguments can also be specified in the build.rustflags configuration key.

Performance

  • [The time complexity of comparing variables for equivalence during type unification is reduced from _O_(_n_!) to _O_(_n_)][1.9tu]. This leads to major compilation time improvement in some scenarios.
  • [ToString is specialized for str, giving it the same performance as to_owned][1.9ts].
  • [Spawning processes with Command::output no longer creates extra threads][1.9sp].
  • [#[derive(PartialEq)] and #[derive(PartialOrd)] emit less code for C-like enums][1.9cl].

Misc

  • [Passing the --quiet flag to a test runner will produce much-abbreviated output][1.9q].
  • The Rust Project now publishes std binaries for the mips-unknown-linux-musl, mipsel-unknown-linux-musl, and i586-pc-windows-msvc targets.

Compatibility Notes

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

← Rust 1.8All versionsRust 1.10 →

Up next

Next releaseRust 1.10Released Jul 7, 2016.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