Version 1.18.0 (2017-06-08)
Language
- Stabilize pub(restricted)
pub
can now accept a module path to make the item visible to just that module tree. Also accepts the keywordcrate
to make something public to the whole crate but not users of the library. Example:pub(crate) mod utils;
. RFC 1422. - Stabilize
#![windows_subsystem]
attribute conservative exposure of the/SUBSYSTEM
linker flag on Windows platforms. RFC 1665. - Refactor of trait object type parsing Now
ty
in macros can accept types likeWrite + Send
, trailing+
are now supported in trait objects, and better error reporting for trait objects starting with?Sized
. - 0e+10 is now a valid floating point literal
- Now warns if you bind a lifetime parameter to 'static
- Tuples, Enum variant fields, and structs with no
repr
attribute or with#[repr(Rust)]
are reordered to minimize padding and produce a smaller representation in some cases.
Compiler
- rustc can now emit mir with
--emit mir
- Improved LLVM IR for trivial functions
- Added explanation for E0090(Wrong number of lifetimes are supplied)
- rustc compilation is now 15%-20% faster Thanks to optimisation opportunities found through profiling
- Improved backtrace formatting when panicking
Libraries
- Specialized
Vec::from_iter
being passedvec::IntoIter
if the iterator hasn't been advanced the originalVec
is reassembled with no actual iteration or reallocation. - Simplified HashMap Bucket interface provides performance improvements for iterating and cloning.
- Specialize Vec::from_elem to use calloc
- Fixed Race condition in fs::create_dir_all
- No longer caching stdio on Windows
- Optimized insertion sort in slice insertion sort in some cases 2.50%~ faster and in one case now 12.50% faster.
- Optimized
AtomicBool::fetch_nand
Stabilized APIs
Child::try_wait
HashMap::retain
HashSet::retain
PeekMut::pop
TcpStream::peek
UdpSocket::peek
UdpSocket::peek_from
Cargo
- Added partial Pijul support Pijul is a version control system in Rust.
You can now create new cargo projects with Pijul using
cargo new --vcs pijul
- Now always emits build script warnings for crates that fail to build
- Added Android build support
- Added
--bins
and--tests
flags now you can build all programs of a certain type, for examplecargo build --bins
will build all binaries. - Added support for haiku
Misc
- rustdoc can now use pulldown-cmark with the
--enable-commonmark
flag - Rust now uses the official cross compiler for NetBSD
- rustdoc now accepts
#
at the start of files - Fixed jemalloc support for musl
Compatibility Notes
-
Changes to how the
0
flag works in format! Padding zeroes are now always placed after the sign if it exists and before the digits. With the#
flag the zeroes are placed after the prefix and before the digits. -
Due to the struct field optimisation, using
transmute
on structs that have norepr
attribute or#[repr(Rust)]
will no longer work. This has always been undefined behavior, but is now more likely to break in practice. -
The refactor of trait object type parsing fixed a bug where
+
was receiving the wrong priority parsing things like&for<'a> Tr<'a> + Send
as&(for<'a> Tr<'a> + Send)
instead of(&for<'a> Tr<'a>) + Send
-
rustc main.rs -o out --emit=asm,llvm-ir
Now will outputout.asm
andout.ll
instead of only one of the filetypes. -
calling a function that returns
Self
will no longer work when the size ofSelf
cannot be statically determined. -
rustc now builds with a "pthreads" flavour of MinGW for Windows GNU this has caused a few regressions namely:
- Changed the link order of local static/dynamic libraries (respecting the order on given rather than having the compiler reorder).
- Changed how MinGW is linked, native code linked to dynamic libraries may require manually linking to the gcc support library (for the native code itself)