← Back to all releases

Rust 1.12.0

Released on September 29, 2016

What's Changed

Full Changelog

Highlights

----------

* rustc translates code to LLVM IR via its own "middle" IR (MIR).

This translation pass is far simpler than the previous AST->LLVM pass, and

creates opportunities to perform new optimizations directly on the MIR. It

was previously described on the Rust blog.

* rustc presents a new, more readable error format, along with

machine-readable JSON error output for use by IDEs.

Most common editors supporting Rust have been updated to work with it. It was

previously described on the Rust blog.

Compiler

--------

* rustc translates code to LLVM IR via its own "middle" IR (MIR).

This translation pass is far simpler than the previous AST->LLVM pass, and

creates opportunities to perform new optimizations directly on the MIR. It

was previously described on the Rust blog.

* Print the Rust target name, not the LLVM target name, with

--print target-list

* The computation of TypeId is correct in some cases where it was previously

producing inconsistent results

* The mips-unknown-linux-gnu target uses hardware floating point by default

* The rustc arguments, --print target-cpus, --print target-features,

--print relocation-models, and --print code-models print the available

options to the -C target-cpu, -C target-feature, -C relocation-model and

-C code-model code generation arguments

* rustc supports three new MUSL targets on ARM: arm-unknown-linux-musleabi,

arm-unknown-linux-musleabihf, and armv7-unknown-linux-musleabihf.

These targets produce statically-linked binaries. There are no binary release

builds yet though.

Diagnostics

-----------

* rustc presents a new, more readable error format, along with

machine-readable JSON error output for use by IDEs.

Most common editors supporting Rust have been updated to work with it. It was

previously described on the Rust blog.

* In error descriptions, references are now described in plain English,

instead of as "&-ptr"

* In error type descriptions, unknown numeric types are named {integer} or

{float} instead of _

* rustc emits a clearer error when inner attributes follow a doc comment

Language

--------

* macro_rules! invocations can be made within macro_rules! invocations

* macro_rules! meta-variables are hygienic

* macro_rules! tt matchers can be reparsed correctly, making them much more

useful

* macro_rules! stmt matchers correctly consume the entire contents when

inside non-braces invocations

* Semicolons are properly required as statement delimiters inside

macro_rules! invocations

* cfg_attr works on path attributes

Stabilized APIs

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

* Cell::as_ptr

* RefCell::as_ptr

* IpAddr::is_unspecified

* IpAddr::is_loopback

* IpAddr::is_multicast

* Ipv4Addr::is_unspecified

* Ipv6Addr::octets

* LinkedList::contains

* VecDeque::contains

* ExitStatusExt::from_raw.

Both on Unix and Windows.

* Receiver::recv_timeout

* RecvTimeoutError

* BinaryHeap::peek_mut

* PeekMut

* iter::Product

* iter::Sum

* OccupiedEntry::remove_entry

* VacantEntry::into_key

Libraries

---------

* The format! macro and friends now allow a single argument to be formatted

in multiple styles

* The lifetime bounds on [T]::binary_search_by and

[T]::binary_search_by_key have been adjusted to be more flexible

* Option implements From for its contained type

* Cell, RefCell and UnsafeCell implement From for their contained type

* RwLock panics if the reader count overflows

* vec_deque::Drain, hash_map::Drain and hash_set::Drain are covariant

* vec::Drain and binary_heap::Drain are covariant

* Cow implements FromIterator for char, &str and String

* Sockets on Linux are correctly closed in subprocesses via SOCK_CLOEXEC

* hash_map::Entry, hash_map::VacantEntry and hash_map::OccupiedEntry

implement Debug

* btree_map::Entry, btree_map::VacantEntry and btree_map::OccupiedEntry

implement Debug

* String implements AddAssign

* Variadic extern fn pointers implement the Clone, PartialEq, Eq,

PartialOrd, Ord, Hash, fmt::Pointer, and fmt::Debug traits

* FileType implements Debug

* References to Mutex and RwLock are unwind-safe

* mpsc::sync_channel Receivers return any available message before

reporting a disconnect

* Unicode definitions have been updated to 9.0

* env iterators implement DoubleEndedIterator

Cargo

-----

* Support local mirrors of registries

* Add support for command aliases

* Allow opt-level="s" / opt-level="z" in profile overrides

* Make cargo doc --open --target work as expected

* Speed up noop registry updates

* Update OpenSSL

* Fix --panic=abort with plugins

* Always pass -C metadata to the compiler

* Fix depending on git repos with workspaces

* Add a --lib flag to cargo new

* Add http.cainfo for custom certs

* Indicate the compilation profile after compiling

* Allow enabling features for dependencies with --features

* Add --jobs flag to cargo package

* Add --dry-run to cargo publish

* Add support for RUSTDOCFLAGS

Performance

-----------

* panic::catch_unwind is more optimized

* panic::catch_unwind no longer accesses thread-local storage on entry

Tooling

-------

* Test binaries now support a --test-threads argument to specify the number

of threads used to run tests, and which acts the same as the

RUST_TEST_THREADS environment variable

* The test runner now emits a warning when tests run over 60 seconds

* rustdoc: Fix methods in search results

* rust-lldb warns about unsupported versions of LLDB

* Rust releases now come with source packages that can be installed by rustup

via rustup component add rust-src.

The resulting source code can be used by tools and IDES, located in the

sysroot under lib/rustlib/src.

Misc

----

* The compiler can now be built against LLVM 3.9

* Many minor improvements to the documentation.

* The Rust exception handling "personality" routine is now written in Rust

Compatibility Notes

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

* When printing Windows OsStrs, unpaired surrogate codepoints are escaped

with the lowercase format instead of the uppercase

* When formatting strings, if "precision" is specified, the "fill",

"align" and "width" specifiers are no longer ignored

* The Debug impl for strings no longer escapes all non-ASCII characters