Rust 1.12.0
Released on September 29, 2016
What's Changed
macro_rules!invocations can be made withinmacro_rules!invocationsmacro_rules!meta-variables are hygienic- [
macro_rules!ttmatchers can be reparsed correctly, making them much more - [
macro_rules!stmtmatchers correctly consume the entire contents when - [Semicolons are properly required as statement delimiters inside
cfg_attrworks onpathattributes
rustctranslates code to LLVM IR via its own "middle" IR (MIR).- [Print the Rust target name, not the LLVM target name, with
- [The computation of
TypeIdis correct in some cases where it was previously - The
mips-unknown-linux-gnutarget uses hardware floating point by default - [The
rustcarguments,--print target-cpus,--print target-features, - [
rustcsupports three new MUSL targets on ARM:arm-unknown-linux-musleabi, - [
rustcpresents a new, more readable error format, along with - [In error descriptions, references are now described in plain English,
- [In error type descriptions, unknown numeric types are named
{integer}or rustcemits a clearer error when inner attributes follow a doc comment
Cell::as_ptrRefCell::as_ptrIpAddr::is_unspecifiedIpAddr::is_loopbackIpAddr::is_multicastIpv4Addr::is_unspecifiedIpv6Addr::octetsLinkedList::containsVecDeque::containsExitStatusExt::from_raw.Receiver::recv_timeoutRecvTimeoutErrorBinaryHeap::peek_mutPeekMutiter::Productiter::SumOccupiedEntry::remove_entryVacantEntry::into_key- [The
format!macro and friends now allow a single argument to be formatted - [The lifetime bounds on
[T]::binary_search_byand OptionimplementsFromfor its contained typeCell,RefCellandUnsafeCellimplementFromfor their contained typeRwLockpanics if the reader count overflowsvec_deque::Drain,hash_map::Drainandhash_set::Drainare covariantvec::Drainandbinary_heap::Drainare covariantCowimplementsFromIteratorforchar,&strandString- Sockets on Linux are correctly closed in subprocesses via
SOCK_CLOEXEC - [
hash_map::Entry,hash_map::VacantEntryandhash_map::OccupiedEntry - [
btree_map::Entry,btree_map::VacantEntryandbtree_map::OccupiedEntry StringimplementsAddAssign- [Variadic
extern fnpointers implement theClone,PartialEq,Eq, FileTypeimplementsDebug- References to
MutexandRwLockare unwind-safe - [
mpsc::sync_channelReceivers return any available message before - Unicode definitions have been updated to 9.0
enviterators implementDoubleEndedIterator
- Support local mirrors of registries
- Add support for command aliases
- Allow
opt-level="s"/opt-level="z"in profile overrides - Make
cargo doc --open --targetwork as expected - Speed up noop registry updates
- Update OpenSSL
- Fix
--panic=abortwith plugins - Always pass
-C metadatato the compiler - Fix depending on git repos with workspaces
- Add a
--libflag tocargo new - Add
http.cainfofor custom certs - Indicate the compilation profile after compiling
- Allow enabling features for dependencies with
--features - Add
--jobsflag tocargo package - Add
--dry-runtocargo publish - Add support for
RUSTDOCFLAGS - [Test binaries now support a
--test-threadsargument to specify the number - The test runner now emits a warning when tests run over 60 seconds
- rustdoc: Fix methods in search results
rust-lldbwarns about unsupported versions of LLDB- [Rust releases now come with source packages that can be installed by rustup
- [When printing Windows
OsStrs, unpaired surrogate codepoints are escaped - [When formatting strings, if "precision" is specified, the "fill",
- The
Debugimpl for strings no longer escapes all non-ASCII characters
rustctranslates code to LLVM IR via its own "middle" IR (MIR).- [
rustcpresents a new, more readable error format, along with - 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
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
---------------
Both on Unix and Windows.
* PeekMut
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
* Variadic extern fn pointers implement the Clone, PartialEq, Eq,
PartialOrd, Ord, Hash, fmt::Pointer, and fmt::Debug traits
* 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
* 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