Rust 1.10.0
Language
Copytypes are required to have a trivial implementation ofClone. RFC 1521.- Single-variant enums support the
#[repr(..)]attribute. - Fix
#[derive(RustcEncodable)]in the presence of otherencodemethods. 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
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 and RefCell 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.
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.