← Back to all releases

Rust 1.10.0

Released on July 7, 2016

What's Changed

Full Changelog

Language

--------

* Copy types are required to have a trivial implementation of Clone.

RFC 1521.

* Single-variant enums support the #[repr(..)] attribute.

* Fix #[derive(RustcEncodable)] in the presence of other encode methods.

* panic! can be converted to a runtime abort with the

-C panic=abort flag. 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_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

* Read/Write/RawFd impls for UnixStream

* UnixListener::bind

* UnixListener::accept

* UnixListener::try_clone

* UnixListener::local_addr

* UnixListener::set_nonblocking

* UnixListener::take_error

* UnixListener::incoming

* RawFd impls for 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

* RawFd impls for UnixDatagram

* {BTree,Hash}Map::values_mut

* <[_]>::binary_search_by_key

Libraries

---------

* The abs_sub method 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 with getrandom they

will fall back to /dev/urandom temporarily to avoid blocking

during early boot.

* Implemented negation for wrapping numerals.

* Implement Clone for binary_heap::IntoIter.

* Implement Display and Hash for std::num::Wrapping.

* Add Default implementation for &CStr, CString.

* Implement From> and Into> for VecDeque.

* Implement Default for UnsafeCell, fmt::Error, Condvar,

Mutex, RwLock.

Cargo

-----

Cargo.toml supports the profile..panic option.

This controls the runtime behavior of the panic! macro

and can be either "unwind" (the default), or "abort".

RFC 1513.

* Don't throw away errors with -p arguments.

* Report status to stderr instead of stdout.

* Build scripts are passed a CARGO_MANIFEST_LINKS environment

variable that corresponds to the links field of the manifest.

* Ban keywords from crate names.

* Canonicalize CARGO_HOME on Windows.

* Retry network requests.

By default they are retried twice, which can be customized with the

net.retry value in .cargo/config.

* Don't print extra error info for failing subcommands.

* Add --force flag to cargo install.

* Don't use flock on NFS mounts.

* Prefer building cargo install artifacts in temporary directories.

Makes it possible to install multiple crates in parallel.

* Add cargo test --doc.

* Add cargo --explain.

* Don't print warnings when -q is passed.

* Add cargo doc --lib and --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 find implementation for Chain iterators 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 fn type.

* Do not suggest changing &mut self to &mut mut self.

Misc

----

* Update i686-linux-android features to match Android ABI.

* Update aarch64-linux-android features to match Android ABI.

* std no longer prints backtraces on platforms where the running

module must be loaded with env::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-gdb and rust-lldb scripts are distributed on all

Unix platforms.

* On Unix the runtime aborts by calling libc::abort instead 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

-------------------

* AtomicBool is now bool-sized, not word-sized.

* target_env for Linux ARM targets is just gnu, not

gnueabihf, gnueabi, etc.

* Consistently panic on overflow in Duration::new.

* Change String::truncate to panic less.

* Add :block to the follow set for :ty and :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.