Version 1.16.0 (2017-03-16)
Language
- The compiler's
dead_codelint now accounts for type aliases. - Uninhabitable enums (those without any variants) no longer permit wildcard match patterns
- Clean up semantics of
selfin an import list Selfmay appear inimplheadersSelfmay appear in struct expressions
Compiler
rustcnow supports--emit=metadata, which causes rustc to emit a.rmetafile containing only crate metadata. This can be used by tools like the Rust Language Service to perform metadata-only builds.- Levenshtein based typo suggestions now work in most places, while previously they worked only for fields and sometimes for local variables. Together with the overhaul of "no resolution"/"unexpected resolution" errors (#38154) they result in large and systematic improvement in resolution diagnostics.
- Fix
transmute::<T, U>whereTrequires a bigger alignment thanU - rustc: use -Xlinker when specifying an rpath with ',' in it
rustcno longer attempts to provide "consider using an explicit lifetime" suggestions. They were inaccurate.
Stabilized APIs
VecDeque::truncateVecDeque::resizeString::insert_strDuration::checked_addDuration::checked_subDuration::checked_divDuration::checked_mulstr::replacenstr::repeatSocketAddr::is_ipv4SocketAddr::is_ipv6IpAddr::is_ipv4IpAddr::is_ipv6Vec::dedup_byVec::dedup_by_keyResult::unwrap_or_default<*const T>::wrapping_offset<*mut T>::wrapping_offsetCommandExt::creation_flagsFile::set_permissionsString::split_off
Libraries
[T]::binary_searchand[T]::binary_search_by_keynow take their argument byBorrowparameter- All public types in std implement
Debug IpAddrimplementsFrom<Ipv4Addr>andFrom<Ipv6Addr>Ipv6AddrimplementsFrom<[u16; 8]>- Ctrl-Z returns from
Stdin.read()when reading from the console on Windows - std: Fix partial writes in
LineWriter - std: Clamp max read/write sizes on Unix
- Use more specific panic message for
&strslicing errors TcpListener::set_only_v6is deprecated. This functionality cannot be achieved in std currently.writeln!, likeprintln!, now accepts a form with no string or formatting arguments, to just print a newline- Implement
iter::Sumanditer::ProductforResult - Reduce the size of static data in
std_unicode::tables char::EscapeDebug,EscapeDefault,EscapeUnicode,CaseMappingIter,ToLowercase,ToUppercase, implementDisplayDurationimplementsSumStringimplementsToSocketAddrs
Cargo
- The
cargo checkcommand does a type check of a project without building it - crates.io will display CI badges from Travis and AppVeyor, if specified in Cargo.toml
- crates.io will display categories listed in Cargo.toml
- Compilation profiles accept integer values for
debug, in addition totrueandfalse. These are passed torustcas the value to-C debuginfo - Implement
cargo --version --verbose - All builds now output 'dep-info' build dependencies compatible with make and ninja
- Build all workspace members with
build --all - Document all workspace members with
doc --all - Path deps outside workspace are not members
Misc
rustdochas a--sysrootargument that, likerustc, specifies the path to the Rust implementation- The
armv7-linux-androideabitarget no longer enables NEON extensions, per Google's ABI guide - The stock standard library can be compiled for Redox OS
- Rust has initial SPARC support. Tier 3. No builds available.
- Rust has experimental support for Nvidia PTX. Tier 3. No builds available.
- Fix backtraces on i686-pc-windows-gnu by disabling FPO
Compatibility Notes
- Uninhabitable enums (those without any variants) no longer permit wildcard match patterns
- In this release, references to uninhabited types can not be pattern-matched. This was accidentally allowed in 1.15.
- The compiler's
dead_codelint now accounts for type aliases. - Ctrl-Z returns from
Stdin.read()when reading from the console on Windows - Clean up semantics of
selfin an import list - Reimplemented lifetime elision. This change was almost entirely compatible with existing code, but it did close a number of small bugs and loopholes, as well as being more accepting in some other cases.