Rust versions / 1.10
Rust release · Jul 7, 2016
Rust 1.10: what's new, what was stabilized
Short answerRust 1.10 was released on Jul 7, 2016: 70 newly stable APIs (os::windows::fs::OpenOptionsExt::access_mode, os::windows::fs::OpenOptionsExt::share_mode, os::windows::fs::OpenOptionsExt::custom_flags, os::windows::fs::OpenOptionsExt::attributes, ...); 8 compatibility notes that can affect existing code.
← Rust 1.9All versionsRust 1.11 →
70 APIs stabilized
os::windows::fs::OpenOptionsExt::access_mode, os::windows::fs::OpenOptionsExt::share_mode, os::windows::fs::OpenOptionsExt::custom_flags, os::windows::fs::OpenOptionsExt::attributes, os::windows::fs::OpenOptionsExt::security_qos_flags, os::unix::fs::OpenOptionsExt::custom_flags, sync::Weak::new, Default for sync::Weak, panic::set_hook, panic::take_hook, panic::PanicInfo, panic::PanicInfo::payload, panic::PanicInfo::location, panic::Location, panic::Location::file, panic::Location::line, ffi::CStr::from_bytes_with_nul, ffi::CStr::from_bytes_with_nul_unchecked, ffi::FromBytesWithNulError, fs::Metadata::modified, fs::Metadata::accessed, fs::Metadata::created, sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange, sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak, collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key, os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}, SocketAddr::is_unnamed, SocketAddr::as_pathname, UnixStream::connect, UnixStream::pair, UnixStream::try_clone, UnixStream::local_addr, UnixStream::peer_addr, UnixStream::set_read_timeout, UnixStream::set_write_timeout, UnixStream::read_timeout, UnixStream::write_timeout, UnixStream::set_nonblocking, UnixStream::take_error, UnixStream::shutdown, UnixStream, UnixListener::bind, UnixListener::accept, UnixListener::try_clone, UnixListener::local_addr, UnixListener::set_nonblocking, UnixListener::take_error, UnixListener::incoming, UnixListener, UnixDatagram::bind, UnixDatagram::unbound, UnixDatagram::pair, UnixDatagram::connect, UnixDatagram::try_clone, UnixDatagram::local_addr, UnixDatagram::peer_addr, UnixDatagram::recv_from, UnixDatagram::recv, UnixDatagram::send_to, UnixDatagram::send, UnixDatagram::set_read_timeout, UnixDatagram::set_write_timeout, UnixDatagram::read_timeout, UnixDatagram::write_timeout, UnixDatagram::set_nonblocking, UnixDatagram::take_error, UnixDatagram::shutdown, UnixDatagram, {BTree,Hash}Map::values_mut, <[_]>::binary_search_by_key
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:
AtomicBoolis now bool-sized, not word-sized.- [
target_envfor Linux ARM targets is justgnu, not - Consistently panic on overflow in
Duration::new. - Change
String::truncateto panic less. - Add
:blockto the follow set for:tyand:path. - Fix macro hygiene bug.
- [Feature-gated attributes on macro-generated macro invocations are
- Suppress fallback and ambiguity errors during type inference.
Use it
rustup update stable # get the newest release
rustup install 1.10 # or exactly this one
rustup override set 1.10 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.10" 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
Copytypes are required to have a trivial implementation ofClone. RFC 1521.- [Single-variant enums support the
#[repr(..)]attribute](https://github.com/rust-lang/rust/pull/33355). - [Fix
#[derive(RustcEncodable)]in the presence of otherencodemethods](https://github.com/rust-lang/rust/pull/32908). panic!can be converted to a runtime abort with the-C panic=abortflag. RFC 1513.- Add a new crate type, 'cdylib'. cdylibs are dynamic libraries suitable for loading by non-Rust hosts. RFC 1510. Note that Cargo does not yet directly support cdylibs.
Stabilized APIs
os::windows::fs::OpenOptionsExt::access_modeos::windows::fs::OpenOptionsExt::share_modeos::windows::fs::OpenOptionsExt::custom_flagsos::windows::fs::OpenOptionsExt::attributesos::windows::fs::OpenOptionsExt::security_qos_flagsos::unix::fs::OpenOptionsExt::custom_flagssync::Weak::newDefault for sync::Weakpanic::set_hookpanic::take_hookpanic::PanicInfopanic::PanicInfo::payloadpanic::PanicInfo::locationpanic::Locationpanic::Location::filepanic::Location::lineffi::CStr::from_bytes_with_nulffi::CStr::from_bytes_with_nul_uncheckedffi::FromBytesWithNulErrorfs::Metadata::modifiedfs::Metadata::accessedfs::Metadata::createdsync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchangesync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weakcollections::{btree,hash}_map::{Occupied,Vacant,}Entry::keyos::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}SocketAddr::is_unnamedSocketAddr::as_pathnameUnixStream::connectUnixStream::pairUnixStream::try_cloneUnixStream::local_addrUnixStream::peer_addrUnixStream::set_read_timeoutUnixStream::set_write_timeoutUnixStream::read_timeoutUnixStream::write_timeoutUnixStream::set_nonblockingUnixStream::take_errorUnixStream::shutdown- Read/Write/RawFd impls for
UnixStream UnixListener::bindUnixListener::acceptUnixListener::try_cloneUnixListener::local_addrUnixListener::set_nonblockingUnixListener::take_errorUnixListener::incoming- RawFd impls for
UnixListener UnixDatagram::bindUnixDatagram::unboundUnixDatagram::pairUnixDatagram::connectUnixDatagram::try_cloneUnixDatagram::local_addrUnixDatagram::peer_addrUnixDatagram::recv_fromUnixDatagram::recvUnixDatagram::send_toUnixDatagram::sendUnixDatagram::set_read_timeoutUnixDatagram::set_write_timeoutUnixDatagram::read_timeoutUnixDatagram::write_timeoutUnixDatagram::set_nonblockingUnixDatagram::take_errorUnixDatagram::shutdown- RawFd impls for
UnixDatagram {BTree,Hash}Map::values_mut- [
<[_]>::binary_search_by_key](http://doc.rust-lang.org/std/primitive.slice.html#method.binary_search_by_key)
Libraries
- The
abs_submethod of floats is deprecated. The semantics of this minor method are subtle and probably not what most people want. - Add implementation of Ord for Cell<T> and RefCell<T> where T: Ord.
- On Linux, if
HashMaps can't be initialized withgetrandomthey will fall back to/dev/urandomtemporarily to avoid blocking during early boot. - Implemented negation for wrapping numerals.
- Implement
Cloneforbinary_heap::IntoIter. - Implement
DisplayandHashforstd::num::Wrapping. - Add
Defaultimplementation for&CStr,CString. - Implement
From<Vec<T>>andInto<Vec<T>>forVecDeque<T>. - Implement
DefaultforUnsafeCell,fmt::Error,Condvar,Mutex,RwLock.
Cargo
- Cargo.toml supports the
profile.*.panicoption. This controls the runtime behavior of thepanic!macro and can be either "unwind" (the default), or "abort". RFC 1513. - Don't throw away errors with
-parguments. - Report status to stderr instead of stdout.
- Build scripts are passed a
CARGO_MANIFEST_LINKSenvironment variable that corresponds to thelinksfield of the manifest. - Ban keywords from crate names.
- Canonicalize
CARGO_HOMEon Windows. - Retry network requests. By default they are retried twice, which can be customized with the
net.retryvalue in.cargo/config. - Don't print extra error info for failing subcommands.
- Add
--forceflag tocargo install. - Don't use
flockon NFS mounts. - Prefer building
cargo installartifacts in temporary directories. Makes it possible to install multiple crates in parallel. - Add
cargo test --doc. - Add
cargo --explain. - Don't print warnings when
-qis passed. - Add
cargo doc --liband--bin. - Don't require build script output to be UTF-8.
- Correctly attempt multiple git usernames.
Performance
- rustc memory usage was reduced by refactoring the context used for type checking.
- Speed up creation of
HashMaps by caching the random keys used to initialize the hash state. - The
findimplementation forChainiterators is 2x faster. - Trait selection optimizations speed up type checking by 15%.
- Efficient trie lookup for boolean Unicode properties. 10x faster than the previous lookup tables.
- [Special case
#[derive(Copy, Clone)]to avoid bloat](https://github.com/rust-lang/rust/pull/31414).
Usability
- Many incremental improvements to documentation and rustdoc.
- rustdoc: List blanket trait impls.
- rustdoc: Clean up ABI rendering.
- Indexing with the wrong type produces a more informative error.
- Improve diagnostics for constants being used in irrefutable patterns.
- When many method candidates are in scope limit the suggestions to 10.
- Remove confusing suggestion when calling a
fntype. - Do not suggest changing
&mut selfto&mut mut self.
Misc
- Update i686-linux-android features to match Android ABI.
- Update aarch64-linux-android features to match Android ABI.
stdno longer prints backtraces on platforms where the running module must be loaded withenv::current_exe, which can't be relied on.- This release includes std binaries for the i586-unknown-linux-gnu, i686-unknown-linux-musl, and armv7-linux-androideabi targets. The i586 target is for old x86 hardware without SSE2, and the armv7 target is for Android running on modern ARM architectures.
- The
rust-gdbandrust-lldbscripts are distributed on all Unix platforms. - On Unix the runtime aborts by calling
libc::abortinstead of generating an illegal instruction. - Rust is now bootstrapped from the previous release of Rust, instead of a snapshot from an arbitrary commit.
Compatibility Notes
AtomicBoolis now bool-sized, not word-sized.target_envfor Linux ARM targets is justgnu, notgnueabihf,gnueabi, etc.- Consistently panic on overflow in
Duration::new. - Change
String::truncateto panic less. - Add
:blockto the follow set for:tyand:path. Affects how macros are parsed. - Fix macro hygiene bug.
- Feature-gated attributes on macro-generated macro invocations are now rejected.
- Suppress fallback and ambiguity errors during type inference. This caused some minor changes to type inference.
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.11Released Aug 18, 2016.Read it next →Also worth your time
Did this answer your question?