- ~700 changes, numerous bugfixes
Highlights
- Stabilized APIs:
BinaryHeap::from
,BinaryHeap::into_sorted_vec
,BinaryHeap::into_vec
,Condvar::wait_timeout
,FileTypeExt::is_block_device
,FileTypeExt::is_char_device
,FileTypeExt::is_fifo
,FileTypeExt::is_socket
,FileTypeExt
,Formatter::alternate
,Formatter::fill
,Formatter::precision
,Formatter::sign_aware_zero_pad
,Formatter::sign_minus
,Formatter::sign_plus
,Formatter::width
,Iterator::cmp
,Iterator::eq
,Iterator::ge
,Iterator::gt
,Iterator::le
,Iterator::lt
,Iterator::ne
,Iterator::partial_cmp
,Path::canonicalize
,Path::exists
,Path::is_dir
,Path::is_file
,Path::metadata
,Path::read_dir
,Path::read_link
,Path::symlink_metadata
,Utf8Error::valid_up_to
,Vec::resize
,VecDeque::as_mut_slices
,VecDeque::as_slices
,VecDeque::insert
,VecDeque::shrink_to_fit
,VecDeque::swap_remove_back
,VecDeque::swap_remove_front
,slice::split_first_mut
,slice::split_first
,slice::split_last_mut
,slice::split_last
,char::from_u32_unchecked
,fs::canonicalize
,str::MatchIndices
,str::RMatchIndices
,str::match_indices
,str::rmatch_indices
,str::slice_mut_unchecked
,string::ParseError
. - Rust applications hosted on crates.io can be installed locally to
~/.cargo/bin
with thecargo install
command. Among other things this makes it easier to augment Cargo with new subcommands: when a binary named e.g.cargo-foo
is found in$PATH
it can be invoked ascargo foo
. - Crates with wildcard (
*
) dependencies will emit warnings when published. In 1.6 it will no longer be possible to publish crates with wildcard dependencies.
Breaking Changes
- The rules determining when a particular lifetime must outlive a particular value (known as 'dropck') have been modified to not rely on parametricity.
- Implementations of
AsRef
andAsMut
were added toBox
,Rc
, andArc
. Because these smart pointer types implementDeref
, this causes breakage in cases where the interior type contains methods of the same name. - Correct a bug in Rc/Arc that caused dropck to be unaware that they could drop their content. Soundness fix.
- All method invocations are properly checked for well-formedness. Soundness fix.
- Traits whose supertraits contain
Self
are not object safe. Soundness fix. - Target specifications support a
no_default_libraries
setting that controls whether-nodefaultlibs
is passed to the linker, and in turn theis_like_windows
setting no longer affects the-nodefaultlibs
flag. #[derive(Show)]
, long-deprecated, has been removed.- The
#[inline]
and#[repr]
attributes can only appear in valid locations. - Native libraries linked from the local crate are passed to the linker before native libraries from upstream crates.
- Two rarely-used attributes,
#[no_debug]
and#[omit_gdb_pretty_printer_section]
are feature gated. - Negation of unsigned integers, which has been a warning for several releases, is now behind a feature gate and will generate errors.
- The parser accidentally accepted visibility modifiers on enum variants, a bug which has been fixed.
- A bug was fixed that allowed
use
statements to import unstable features.
Language
- When evaluating expressions at compile-time that are not compile-time constants (const-evaluating expressions in non-const contexts), incorrect code such as overlong bitshifts and arithmetic overflow will generate a warning instead of an error, delaying the error until runtime. This will allow the const-evaluator to be expanded in the future backwards-compatibly.
- The
improper_ctypes
lint no longer warns about usingisize
andusize
in FFI.
Libraries
Arc<T>
andRc<T>
are covariant with respect toT
instead of invariant.Default
is implemented for mutable slices.FromStr
is implemented forSockAddrV4
andSockAddrV6
.- There are now
From
conversions between floating point types where the conversions are lossless. - There are now
From
conversions between integer types where the conversions are lossless. fs::Metadata
implementsClone
.- The
parse
method accepts a leading "+" when parsing integers. AsMut
is implemented forVec
.- The
clone_from
implementations forString
andBinaryHeap
have been optimized and no longer rely on the default impl. - The
extern "Rust"
,extern "C"
,unsafe extern "Rust"
andunsafe extern "C"
function types now implementClone
,PartialEq
,Eq
,PartialOrd
,Ord
,Hash
,fmt::Pointer
, andfmt::Debug
for up to 12 arguments. - Dropping
Vec
s is much faster in unoptimized builds when the element types don't implementDrop
. - A bug that caused in incorrect behavior when combining
VecDeque
with zero-sized types was resolved. PartialOrd
for slices is faster.
Miscellaneous
- Crate metadata size was reduced by 20%.
- Improvements to code generation reduced the size of libcore by 3.3 MB and rustc's memory usage by 18MB.
- Improvements to deref translation increased performance in unoptimized builds.
- Various errors in trait resolution are deduplicated to only be reported once.
- Rust has preliminary support for rumprun kernels.
- Rust has preliminary support for NetBSD on amd64.