1.12.0 #
- Released on: 29 September, 2016
- Branched from master on: 12 August, 2016
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
, andarmv7-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 withinmacro_rules!
invocationsmacro_rules!
meta-variables are hygienicmacro_rules!
tt
matchers can be reparsed correctly, making them much more usefulmacro_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 onpath
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
implementsFrom
for its contained typeCell
,RefCell
andUnsafeCell
implementFrom
for their contained typeRwLock
panics if the reader count overflowsvec_deque::Drain
,hash_map::Drain
andhash_set::Drain
are covariantvec::Drain
andbinary_heap::Drain
are covariantCow<str>
implementsFromIterator
forchar
,&str
andString
- Sockets on Linux are correctly closed in subprocesses via
SOCK_CLOEXEC
hash_map::Entry
,hash_map::VacantEntry
andhash_map::OccupiedEntry
implementDebug
btree_map::Entry
,btree_map::VacantEntry
andbtree_map::OccupiedEntry
implementDebug
String
implementsAddAssign
- Variadic
extern fn
pointers implement theClone
,PartialEq
,Eq
,PartialOrd
,Ord
,Hash
,fmt::Pointer
, andfmt::Debug
traits FileType
implementsDebug
- References to
Mutex
andRwLock
are unwind-safe mpsc::sync_channel
Receiver
s return any available message before reporting a disconnect- Unicode definitions have been updated to 9.0
env
iterators implementDoubleEndedIterator
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 tocargo new
- Add
http.cainfo
for custom certs - Indicate the compilation profile after compiling
- Allow enabling features for dependencies with
--features
- Add
--jobs
flag tocargo package
- Add
--dry-run
tocargo publish
- Add support for
RUSTDOCFLAGS
Performance #
panic::catch_unwind
is more optimizedpanic::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 theRUST_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 underlib/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
OsStr
s, 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