- ~850 changes, numerous bugfixes
Highlights
- The
std::fs
module has been expanded to expand the set of functionality exposed:DirEntry
now supports optimizations likefile_type
andmetadata
which don't incur a syscall on some platforms.- A
symlink_metadata
function has been added. - The
fs::Metadata
structure now lowers to its OS counterpart, providing access to all underlying information.
- The compiler now contains extended explanations of many errors. When an error with an explanation occurs the compiler suggests using the
--explain
flag to read the explanation. Error explanations are also available online. - Thanks to multiple improvements to type checking, as well as other work, the time to bootstrap the compiler decreased by 32%.
Libraries
- The
str::split_whitespace
method splits a string on unicode whitespace boundaries. - On both Windows and Unix, new extension traits provide conversion of I/O types to and from the underlying system handles. On Unix, these traits are
FromRawFd
andAsRawFd
, on WindowsFromRawHandle
andAsRawHandle
. These are implemented forFile
,TcpStream
,TcpListener
, andUpdSocket
. Further implementations forstd::process
will be stabilized later. - On Unix,
std::os::unix::symlink
creates symlinks. On Windows, symlinks can be created withstd::os::windows::symlink_dir
andstd::os::windows::symlink_file
. - The
mpsc::Receiver
type can now be converted into an iterator withinto_iter
on theIntoIterator
trait. Ipv4Addr
can be created fromu32
with theFrom<u32>
implementation of theFrom
trait.- The
Debug
implementation forRangeFull
creates output that is more consistent with other implementations. Debug
is implemented forFile
.- The
Default
implementation forArc
no longer requiresSync + Send
. - The
Iterator
methodscount
,nth
, andlast
have been overridden for slices to have O(1) performance instead of O(n). - Incorrect handling of paths on Windows has been improved in both the compiler and the standard library.
AtomicPtr
gained aDefault
implementation.- In accordance with Rust's policy on arithmetic overflow
abs
now panics on overflow when debug assertions are enabled. - The
Cloned
iterator, which was accidentally left unstable for 1.0 has been stabilized. - The
Incoming
iterator, which iterates over incoming TCP connections, and which was accidentally unnamable in 1.0, is now properly exported. BinaryHeap
no longer corrupts itself when functions called bysift_up
orsift_down
panic.- The
split_off
method ofLinkedList
no longer corrupts the list in certain scenarios.
Misc
- Type checking performance has improved notably with multiple improvements.
- The compiler suggests code changes for more errors.
- rustc and it's build system have experimental support for building toolchains against MUSL instead of glibc on Linux.
- The compiler defines the
target_env
cfg value, which is used for distinguishing toolchains that are otherwise for the same platform. Presently this is set tognu
for common GNU Linux targets and for MinGW targets, andmusl
for MUSL Linux targets. - The
cargo rustc
command invokes a build with custom flags to rustc. - Android executables are always position independent.
- The
drop_with_repr_extern
lint warns about mixingrepr(C)
withDrop
.