Releases: rust-lang/rust
Releases · rust-lang/rust
Rust 1.16.0
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.
Rust 1.15.1
Rust 1.15.0
Language
- Basic procedural macros allowing custom
#[derive], aka "macros 1.1", are stable. This allows popular code-generating crates like Serde and Diesel to work ergonomically. RFC 1681. - Tuple structs may be empty. Unary and empty tuple structs may be instantiated with curly braces. Part of RFC 1506.
- A number of minor changes to name resolution have been activated. They add up to more consistent semantics, allowing for future evolution of Rust macros. Specified in RFC 1560, see its section on "changes" for details of what is different. The breaking changes here have been transitioned through the
legacy_importslint since 1.14, with no known regressions. - In
macro_rules,pathfragments can now be parsed as type parameter bounds ?Sizedcan be used inwhereclauses- There is now a limit on the size of monomorphized types and it can be modified with the
#![type_size_limit]crate attribute, similarly to the#![recursion_limit]attribute
Compiler
- On Windows, the compiler will apply dllimport attributes when linking to extern functions. Additional attributes and flags can control which library kind is linked and its name. RFC 1717.
- Rust-ABI symbols are no longer exported from cdylibs
- The
--testflag works with procedural macro crates - Fix
extern "aapcs" fnABI - The
-C no-stack-checkflag is deprecated. It does nothing. - The
format!expander recognizes incorrectprintfand shell-style formatting directives and suggests the correct format. - Only report one error for all unused imports in an import list
Compiler Performance
- Avoid unnecessary
mk_tycalls inTy::super_fold_with - Avoid more unnecessary
mk_tycalls inTy::super_fold_with - Don't clone in
UnificationTable::probe - Remove
scope_auxiliaryto cut RSS by 10% - Use small vectors in type walker
- Macro expansion performance was improved
- Change
HirVec<P<T>>toHirVec<T>inhir::Expr - Replace FNV with a faster hash function
Stabilized APIs
std::iter::Iterator::min_bystd::iter::Iterator::max_bystd::os::*::fs::FileExtstd::sync::atomic::Atomic*::get_mutstd::sync::atomic::Atomic*::into_innerstd::vec::IntoIter::as_slicestd::vec::IntoIter::as_mut_slicestd::sync::mpsc::Receiver::try_iterstd::os::unix::process::CommandExt::before_execstd::rc::Rc::strong_countstd::rc::Rc::weak_countstd::sync::Arc::strong_countstd::sync::Arc::weak_countstd::char::encode_utf8std::char::encode_utf16std::cell::Ref::clonestd::io::Take::into_inner
Libraries
- The standard sorting algorithm has been rewritten for dramatic performance improvements. It is a hybrid merge sort, drawing influences from Timsort. Previously it was a naive merge sort.
Iterator::nthno longer has aSizedboundExtend<&T>is specialized forVecwhereT: Copyto improve performance.chars().count()is much faster and so arechars().last()andchar_indices().last()- Fix ARM Objective-C ABI in
std::env::args - Chinese characters display correctly in
fmt::Debug - Derive
DefaultforDuration - Support creation of anonymous pipes on WinXP/2k
mpsc::RecvTimeoutErrorimplementsError- Don't pass overlapped handles to processes
Cargo
- In this release, Cargo build scripts no longer have access to the
OUT_DIRenvironment variable at build time viaenv!("OUT_DIR"). They should instead check the variable at runtime withstd::env. That the value was set at build time was a bug, and incorrect when cross-compiling. This change is known to cause breakage. - Add
--allflag tocargo test - Compile statically against the MSVC CRT
- Mix feature flags into fingerprint/metadata shorthash
- Link OpenSSL statically on OSX
- Apply new fingerprinting to build dir outputs
- Test for bad path overrides with summaries
- Require
cargo install --versto take a semver version - Fix retrying crate downloads for network errors
- Implement string lookup for
build.rustflagsconfig key - Emit more info on --message-format=json
- Assume
build.rsin the same directory asCargo.tomlis a build script - Don't ignore errors in workspace manifest
- Fix
--message-format JSONwhen rustc emits non-JSON warnings
Tooling
- Test runners (binaries built with
--test) now support a--listargument that lists the tests it contains - Test runners now support a
--exactargument that makes the test filter match exactly, instead of matching only a substring of the test name - rustdoc supports a
--playground-urlflag - rustdoc provides more details about
#[should_panic]errors
Misc
- The Rust build system is now written in Rust. The Makefiles may continue to be used in this release by passing
--disable-rustbuildto the configure script, but they will be deleted soon. Note that the new build system uses a different on-disk layout that will likely affect any scripts building Rust. - Rust supports i686-unknown-openbsd. Tier 3 support. No testing or releases.
- Rust supports the MSP430. Tier 3 support. No testing or releases.
- Rust supports the ARMv5TE architecture. Tier 3 support. No testing or releases.
Compatibility Notes
- A number of minor changes to name resolution have been activated. They add up to more consistent semantics, allowing for future evolution of Rust macros. Specified in RFC 1560, see its section on "changes" for details of what is different. The breaking changes here have been transitioned through the [`lega...
Rust 1.14.0
Language
..matches multiple tuple fields in enum variants, structs and tuples. RFC 1492.- Safe
fnitems can be coerced tounsafe fnpointers use *anduse ::*both glob-import from the crate root- It's now possible to call a
Vec<Box<Fn()>>without explicit dereferencing
Compiler
- Mark enums with non-zero discriminant as non-zero
- Lower-case
static mutnames are linted like other statics and consts - Fix ICE on some macros in const integer positions (e.g.
[u8; m!()]) - Improve error message and snippet for "did you mean
x" - Add a panic-strategy field to the target specification
- Include LLVM version in
--version --verbose
Compile-time Optimizations
- Improve macro expansion performance
- Shrink
Expr_::ExprInlineAsm - Replace all uses of SHA-256 with BLAKE2b
- Reduce the number of bytes hashed by
IchHasher - Avoid more allocations when compiling html5ever
- Use
SmallVectorinCombineFields::instantiate - Avoid some allocations in the macro parser
- Use a faster deflate setting
- Add
ArrayVecandAccumulateVecto reduce heap allocations during interning of slices - Optimize
write_metadata - Don't process obligation forest cycles when stalled
- Avoid many
CrateConfigclones - Optimize
Substs::super_fold_with - Optimize
ObligationForest'sNodeStatehandling - Speed up
plug_leaks
Libraries
println!(), with no arguments, prints newline. Previously, an empty string was required to achieve the same.Wrappingimpls standard binary and unary operators, as well as theSumandProductiterators- Implement
From<Cow<str>> for StringandFrom<Cow<[T]>> for Vec<T> - Improve
foldperformance forchain,cloned,map, andVecDequeiterators - Improve
SipHasherperformance on small values - Add Iterator trait TrustedLen to enable better FromIterator / Extend
- Expand
.zip()specialization to.map()and.cloned() ReadDirimplementsDebug- Implement
RefUnwindSafefor atomic types - Specialize
Vec::extendtoVec::extend_from_slice - Avoid allocations in
Decoder::read_str io::ErrorimplementsFrom<io::ErrorKind>- Impl
Debugfor raw pointers to unsized data - Don't reuse
HashMaprandom seeds - The internal memory layout of
HashMapis more cache-friendly, for significant improvements in some operations HashMapuses less memory on 32-bit architectures- Impl
Add<{str, Cow<str>}>forCow<str>
Cargo
- Expose rustc cfg values to build scripts
- Allow cargo to work with read-only
CARGO_HOME - Fix passing --features when testing multiple packages
- Use a single profile set per workspace
- Load
replacesections from lock files - Ignore
panicconfiguration for test/bench profiles
Tooling
- rustup is the recommended Rust installation method
- This release includes host (rustc) builds for Linux on MIPS, PowerPC, and S390x. These are tier 2 platforms and may have major defects. Follow the instructions on the website to install, or add the targets to an existing installation with
rustup target add. The new target triples are:mips-unknown-linux-gnumipsel-unknown-linux-gnumips64-unknown-linux-gnuabi64mips64el-unknown-linux-gnuabi64powerpc-unknown-linux-gnupowerpc64-unknown-linux-gnupowerpc64le-unknown-linux-gnus390x-unknown-linux-gnu
- This release includes target (std) builds for ARM Linux running MUSL libc. These are tier 2 platforms and may have major defects. Add the following triples to an existing rustup installation with
rustup target add:arm-unknown-linux-musleabiarm-unknown-linux-musleabihfarmv7-unknown-linux-musleabihf
- This release includes experimental support for WebAssembly, via the
wasm32-unknown-emscriptentarget. This target is known to have major defects. Please test, report, and fix. - rustup no longer installs documentation by default. Run
rustup component add rust-docsto install. - Fix line stepping in debugger
- Enable line number debuginfo in releases
Misc
- Disable jemalloc on aarch64/powerpc/mips
- Add support for Fuchsia OS
- Detect local-rebuild by only MAJOR.MINOR version
Compatibility Notes
- A number of forward-compatibility lints used by the compiler to gradually introduce language changes have been converted to deny by default:
- "use of inaccessible extern crate erroneously allowed"
- "type parameter default erroneously allowed in invalid location"
- "detects super or self keywords at the beginning of global path"
- "two overlapping inherent impls define an item with the same name were erroneously allowed"
- "floating-point constants cannot be used in patterns"
- "constants of struct or enum type can only be used in a pattern if the struct or enum has
#[derive(PartialEq, Eq)]" - "lifetimes or labels named
'_were erroneously allowed"
- Prohibit patterns in trait methods without bodies
- The atomic
Orderingenum may not be matched exhaustively - Future-proofing
#[no_link]breaks some obscure cases - The
$cratemacro variable is accepted in fewer locations - Impls specifying extra region requirements beyond the trait they implement are rejected
- Enums may not be unsized. Unsized enums are intended to work but never have. For now they are forbidden.
- Enforce the shadowing restrictions from RFC 1560 for today's macros
Rust 1.13.0
Language
- Stabilize the
?operator.?is a simple way to propagate errors, like thetry!macro, described in RFC 0243. - Stabilize macros in type position. Described in RFC 873.
- Stabilize attributes on statements. Described in RFC 0016.
- Fix
#[derive]for empty tuple structs/variants - Fix lifetime rules for 'if' conditions
- Avoid loading and parsing unconfigured non-inline modules
Compiler
- Add the
-C link-argargument - Remove the old AST-based backend from rustc_trans
- Don't enable NEON by default on armv7 Linux
- Fix debug line number info for macro expansions
- Do not emit "class method" debuginfo for types that are not DICompositeType
- Warn about multiple conflicting #[repr] hints
- When sizing DST, don't double-count nested struct prefixes
- Default RUST_MIN_STACK to 16MiB for now
- Improve rlib metadata format. Reduces rlib size significantly.
- Reject macros with empty repetitions to avoid infinite loop
- Expand macros without recursing to avoid stack overflows
Diagnostics
- Replace macro backtraces with labeled local uses
- Improve error message for misplaced doc comments
- Buffer unix and lock windows to prevent message interleaving
- Update lifetime errors to specifically note temporaries
- Special case a few colors for Windows
- Suggest
use selfwhen such an import resolves - Be more specific when type parameter shadows primitive type
- Many minor improvements
Compile-time Optimizations
- Compute and cache HIR hashes at beginning
- Don't hash types in loan paths
- Cache projections in trans
- Optimize the parser's last token handling
- Only instantiate #[inline] functions in codegen units referencing them. This leads to big improvements in cases where crates export define many inline functions without using them directly.
- Lazily allocate TypedArena's first chunk
- Don't allocate during default HashSet creation
Stabilized APIs
Libraries
- Add
assert_ne!anddebug_assert_ne! - Make
vec_deque::Drain,hash_map::Drain, andhash_set::Draincovariant - Implement
AsRef<[T]>forstd::slice::Iter - Implement
Debugforstd::vec::IntoIter CString: avoid excessive growth just to 0-terminate- Implement
CoerceUnsizedfor{Cell, RefCell, UnsafeCell} - Use arc4rand on FreeBSD
- memrchr: Correct aligned offset computation
- Improve Demangling of Rust Symbols
- Use monotonic time in condition variables
- Implement
Debugforstd::path::{Components,Iter} - Implement conversion traits for
char - Fix illegal instruction caused by overflow in channel cloning
- Zero first byte of CString on drop
- Inherit overflow checks for sum and product
- Add missing Eq implementations
- Implement
DebugforDirEntry - When
getaddrinforeturnsEAI_SYSTEMretrieve actual error fromerrno SipHasheris deprecated. UseDefaultHasher.- Implement more traits for
std::io::ErrorKind - Optimize BinaryHeap bounds checking
- Work around pointer aliasing issue in
Vec::extend_from_slice,extend_with_element - Fix overflow checking in unsigned pow()
Cargo
- This release includes security fixes to both curl and OpenSSL.
- Fix transitive doctests when panic=abort
- Add --all-features flag to cargo
- Reject path-based dependencies in
cargo package - Don't parse the home directory more than once
- Don't try to generate Cargo.lock on empty workspaces
- Update OpenSSL to 1.0.2j
- Add license and license_file to cargo metadata output
- Make crates-io registry URL optional in config; ignore all changes to source.crates-io
- Don't download dependencies from other platforms
- Build transitive dev-dependencies when needed
- Add support for per-target rustflags in .cargo/config
- Avoid updating registry when adding existing deps
- Warn about path overrides that won't work
- Use workspaces during
cargo install - Leak mspdbsrv.exe processes on Windows
- Add --message-format flag
- Pass target environment for rustdoc
- Use
CommandExt::execforcargo runon Unix - Update curl and curl-sys
- Call rustdoc test with the correct cfg flags of a package
Tooling
- rustdoc: Add the
--sysrootargument - rustdoc: Fix a couple of issues with the search results
- rustdoc: remove the
!from macro URLs and titles - gdb: Fix pretty-printing special-cased Rust types
- rustdoc: Filter more incorrect methods inherited through Deref
Misc
- Remove unmaintained style guide
- Add s390x support
- Initial work at Haiku OS support
- Add mips-uclibc targets
- Crate-ify compiler-rt into compiler-builtins
- Add rustc version info (git hash + date) to dist tarball
- Many documentation improvements
Compatibility Notes
SipHasheris deprecated. UseDefaultHasher.- Deny (by default) transmuting from fn item types to pointer-sized types. Continuing the long transition to zero-sized fn items, per [RFC 401](https://github.com/rust-lang/rfcs/blob/master/text/0...
Rust 1.12.1
Regression Fixes
- ICE: 'rustc' panicked at 'assertion failed: concrete_substs.is_normalized_for_trans()' #36381
- Confusion with double negation and booleans
- rustc 1.12.0 fails with SIGSEGV in release mode (syn crate 0.8.0)
- Rustc 1.12.0 Windows build of
ethcorecrate fails with LLVM error - 1.12.0: High memory usage when linking in release mode with debug info
- Corrupted memory after updated to 1.12
- "Let NullaryConstructor = something;" causes internal compiler error: "tried to overwrite interned AdtDef"
- Fix ICE: inject bitcast if types mismatch for invokes/calls/stores
- debuginfo: Handle spread_arg case in MIR-trans in a more stable way.
Rust 1.12.0
Highlights
rustctranslates 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.rustcpresents 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
rustctranslates 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
TypeIdis correct in some cases where it was previously producing inconsistent results - The
mips-unknown-linux-gnutarget uses hardware floating point by default - The
rustcarguments,--print target-cpus,--print target-features,--print relocation-models, and--print code-modelsprint the available options to the-C target-cpu,-C target-feature,-C relocation-modeland-C code-modelcode generation arguments rustcsupports 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
rustcpresents 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_ rustcemits 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!ttmatchers can be reparsed correctly, making them much more usefulmacro_rules!stmtmatchers correctly consume the entire contents when inside non-braces invocations- Semicolons are properly required as statement delimiters inside
macro_rules!invocations cfg_attrworks onpathattributes
Stabilized APIs
Cell::as_ptrRefCell::as_ptrIpAddr::is_unspecifiedIpAddr::is_loopbackIpAddr::is_multicastIpv4Addr::is_unspecifiedIpv6Addr::octetsLinkedList::containsVecDeque::containsExitStatusExt::from_raw. Both on Unix and Windows.Receiver::recv_timeoutRecvTimeoutErrorBinaryHeap::peek_mutPeekMutiter::Productiter::SumOccupiedEntry::remove_entryVacantEntry::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_byand[T]::binary_search_by_keyhave been adjusted to be more flexible OptionimplementsFromfor its contained typeCell,RefCellandUnsafeCellimplementFromfor their contained typeRwLockpanics if the reader count overflowsvec_deque::Drain,hash_map::Drainandhash_set::Drainare covariantvec::Drainandbinary_heap::Drainare covariantCow<str>implementsFromIteratorforchar,&strandString- Sockets on Linux are correctly closed in subprocesses via
SOCK_CLOEXEC hash_map::Entry,hash_map::VacantEntryandhash_map::OccupiedEntryimplementDebugbtree_map::Entry,btree_map::VacantEntryandbtree_map::OccupiedEntryimplementDebugStringimplementsAddAssign- Variadic
extern fnpointers implement theClone,PartialEq,Eq,PartialOrd,Ord,Hash,fmt::Pointer, andfmt::Debugtraits FileTypeimplementsDebug- References to
MutexandRwLockare unwind-safe mpsc::sync_channelReceivers return any available message before reporting a disconnect- Unicode definitions have been updated to 9.0
enviterators 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 --targetwork as expected - Speed up noop registry updates
- Update OpenSSL
- Fix
--panic=abortwith plugins - Always pass
-C metadatato the compiler - Fix depending on git repos with workspaces
- Add a
--libflag tocargo new - Add
http.cainfofor custom certs - Indicate the compilation profile after compiling
- Allow enabling features for dependencies with
--features - Add
--jobsflag tocargo package - Add
--dry-runtocargo publish - Add support for
RUSTDOCFLAGS
Performance
panic::catch_unwindis more optimizedpanic::catch_unwindno longer accesses thread-local storage on entry
Tooling
- Test binaries now support a
--test-threadsargument to specify the number of threads used to run tests, and which acts the same as theRUST_TEST_THREADSenvironment variable - The test runner now emits a warning when tests run over 60 seconds
- rustdoc: Fix methods in search results
rust-lldbwarns about unsupported versions of LLDB- [Rust releases now come with source p...
Rust 1.11.0
Language
- Support nested
cfg_attrattributes - Allow statement-generating braced macro invocations at the end of blocks
- Macros can be expanded inside of trait definitions
#[macro_use]works properly when it is itself expanded from a macro
Stabilized APIs
BinaryHeap::appendBTreeMap::appendBTreeMap::split_offBTreeSet::appendBTreeSet::split_offf32::to_degrees(in libcore - previously stabilized in libstd)f32::to_radians(in libcore - previously stabilized in libstd)f64::to_degrees(in libcore - previously stabilized in libstd)f64::to_radians(in libcore - previously stabilized in libstd)Iterator::sumIterator::productCell::get_mutRefCell::get_mut
Libraries
- The
thread_local!macro supports multiple definitions in a single invocation, and can apply attributes CowimplementsDefaultWrappingimplements binary, octal, lower-hex and upper-hexDisplayformatting- The range types implement
Hash lookup_hostignores unknown address typesassert_eq!accepts a custom error message, likeassert!does- The main thread is now called "main" instead of "<main>"
Cargo
- Disallow specifying features of transitive deps
- Add color support for Windows consoles
- Fix
harness = falseon[lib]sections - Don't panic when
linkscontains a '.' - Build scripts can emit warnings, and
-vvprints warnings for all crates. - Ignore file locks on OS X NFS mounts
- Don't warn about
package.metadatakeys. This provides room for expansion by arbitrary tools. - Add support for cdylib crate types
- Prevent publishing crates when files are dirty
- Don't fetch all crates on clean
- Propagate --color option to rustc
- Fix
cargo doc --openon Windows - Improve autocompletion
- Configure colors of stderr as well as stdout
Performance
- Caching projections speeds up type check dramatically for some workloads
- The default
HashMaphasher is SipHash 1-3 instead of SipHash 2-4 This hasher is faster, but is believed to provide sufficient protection from collision attacks. - Comparison of
Ipv4Addris 10x faster
Rustdoc
- Fix empty implementation section on some module pages
- Fix inlined renamed re-exports in import lists
- Fix search result layout for enum variants and struct fields
- Fix issues with source links to external crates
- Fix redirect pages for renamed re-exports
Tooling
- rustc is better at finding the MSVC toolchain
- When emitting debug info, rustc emits frame pointers for closures, shims and glue, as it does for all other functions
- rust-lldb warns about unsupported versions of LLDB
- Many more errors have been given error codes and extended explanations
- API documentation continues to be improved, with many new examples
Misc
- rustc no longer hangs when dependencies recursively re-export submodules
- rustc requires LLVM 3.7+
- The 'How Safe and Unsafe Interact' chapter of The Rustonomicon was rewritten
- rustc support 16-bit pointer sizes. No targets use this yet, but it works toward AVR support.
Compatibility Notes
consts andstatics may not have unsized types- The new follow-set rules that place restrictions on
macro_rules!in order to ensure syntax forward-compatibility have been enabled This was an amendment to RFC 550, and has been a warning since 1.10. cfgattribute process has been refactored to fix various bugs. This causes breakage in some corner cases.
Rust 1.10.0
Language
Copytypes are required to have a trivial implementation ofClone. RFC 1521.- Single-variant enums support the
#[repr(..)]attribute. - Fix
#[derive(RustcEncodable)]in the presence of otherencodemethods. panic!can be converted to a runtime abort with the-C panic=abortflag. RFC 1513.- Add a new crate type, 'cdylib'. cdylibs are dynamic libraries suitable for loading by non-Rust hosts. RFC 1510. Note that Cargo does not yet directly support cdylibs.
Stabilized APIs
os::windows::fs::OpenOptionsExt::access_modeos::windows::fs::OpenOptionsExt::share_modeos::windows::fs::OpenOptionsExt::custom_flagsos::windows::fs::OpenOptionsExt::attributesos::windows::fs::OpenOptionsExt::security_qos_flagsos::unix::fs::OpenOptionsExt::custom_flagssync::Weak::newDefault for sync::Weakpanic::set_hookpanic::take_hookpanic::PanicInfopanic::PanicInfo::payloadpanic::PanicInfo::locationpanic::Locationpanic::Location::filepanic::Location::lineffi::CStr::from_bytes_with_nulffi::CStr::from_bytes_with_nul_uncheckedffi::FromBytesWithNulErrorfs::Metadata::modifiedfs::Metadata::accessedfs::Metadata::createdsync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchangesync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weakcollections::{btree,hash}_map::{Occupied,Vacant,}Entry::keyos::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}SocketAddr::is_unnamedSocketAddr::as_pathnameUnixStream::connectUnixStream::pairUnixStream::try_cloneUnixStream::local_addrUnixStream::peer_addrUnixStream::set_read_timeoutUnixStream::set_write_timeoutUnixStream::read_timeoutUnixStream::write_timeoutUnixStream::set_nonblockingUnixStream::take_errorUnixStream::shutdown- Read/Write/RawFd impls for
UnixStream UnixListener::bindUnixListener::acceptUnixListener::try_cloneUnixListener::local_addrUnixListener::set_nonblockingUnixListener::take_errorUnixListener::incoming- RawFd impls for
UnixListener UnixDatagram::bindUnixDatagram::unboundUnixDatagram::pairUnixDatagram::connectUnixDatagram::try_cloneUnixDatagram::local_addrUnixDatagram::peer_addrUnixDatagram::recv_fromUnixDatagram::recvUnixDatagram::send_toUnixDatagram::sendUnixDatagram::set_read_timeoutUnixDatagram::set_write_timeoutUnixDatagram::read_timeoutUnixDatagram::write_timeoutUnixDatagram::set_nonblockingUnixDatagram::take_errorUnixDatagram::shutdown- RawFd impls for
UnixDatagram {BTree,Hash}Map::values_mut<[_]>::binary_search_by_key
Libraries
- The
abs_submethod of floats is deprecated. The semantics of this minor method are subtle and probably not what most people want. - Add implementation of Ord for Cell and RefCell where T: Ord.
- On Linux, if
HashMaps can't be initialized withgetrandomthey will fall back to/dev/urandomtemporarily to avoid blocking during early boot. - Implemented negation for wrapping numerals.
- Implement
Cloneforbinary_heap::IntoIter. - Implement
DisplayandHashforstd::num::Wrapping. - Add
Defaultimplementation for&CStr,CString. - Implement
From<Vec<T>>andInto<Vec<T>>forVecDeque<T>. - Implement
DefaultforUnsafeCell,fmt::Error,Condvar,Mutex,RwLock.
Cargo
- Cargo.toml supports the
profile.*.panicoption. This controls the runtime behavior of thepanic!macro and can be either "unwind" (the default), or "abort". RFC 1513. - Don't throw away errors with
-parguments. - Report status to stderr instead of stdout.
- Build scripts are passed a
CARGO_MANIFEST_LINKSenvironment variable that corresponds to thelinksfield of the manifest. - Ban keywords from crate names.
- Canonicalize
CARGO_HOMEon Windows. - Retry network requests. By default they are retried twice, which can be customized with the
net.retryvalue in.cargo/config. - [Don't print extra error info for failing subcommands](rust-lang/cargo#267...
Rust 1.9.0
Language
- The
#[deprecated]attribute when applied to an API will generate warnings when used. The warnings may be suppressed with#[allow(deprecated)]. RFC 1270. fnitem types are zero sized, and eachfnnames a unique type. This will break code that transmutesfns, so callingtransmuteon afntype will generate a warning for a few cycles, then will be converted to an error.- Field and method resolution understand visibility, so private fields and methods cannot prevent the proper use of public fields and methods.
- The parser considers unicode codepoints in the
PATTERN_WHITE_SPACEcategory to be whitespace.
Stabilized APIs
std::panicstd::panic::catch_unwind(renamed fromrecover)std::panic::resume_unwind(renamed frompropagate)std::panic::AssertUnwindSafe(renamed fromAssertRecoverSafe)std::panic::UnwindSafe(renamed fromRecoverSafe)str::is_char_boundary<*const T>::as_ref<*mut T>::as_ref<*mut T>::as_mutAsciiExt::make_ascii_uppercaseAsciiExt::make_ascii_lowercasechar::decode_utf16char::DecodeUtf16char::DecodeUtf16Errorchar::DecodeUtf16Error::unpaired_surrogateBTreeSet::takeBTreeSet::replaceBTreeSet::getHashSet::takeHashSet::replaceHashSet::getOsString::with_capacityOsString::clearOsString::capacityOsString::reserveOsString::reserve_exactOsStr::is_emptyOsStr::lenstd::os::unix::threadRawPthreadJoinHandleExtJoinHandleExt::as_pthread_tJoinHandleExt::into_pthread_tHashSet::hasherHashMap::hasherCommandExt::execFile::try_cloneSocketAddr::set_ipSocketAddr::set_portSocketAddrV4::set_ipSocketAddrV4::set_portSocketAddrV6::set_ipSocketAddrV6::set_portSocketAddrV6::set_flowinfoSocketAddrV6::set_scope_idslice::copy_from_sliceptr::read_volatileptr::write_volatileOpenOptions::create_newTcpStream::set_nodelayTcpStream::nodelayTcpStream::set_ttlTcpStream::ttlTcpStream::set_only_v6TcpStream::only_v6TcpStream::take_errorTcpStream::set_nonblockingTcpListener::set_ttlTcpListener::ttlTcpListener::set_only_v6TcpListener::only_v6TcpListener::take_errorTcpListener::set_nonblockingUdpSocket::set_broadcastUdpSocket::broadcastUdpSocket::set_multicast_loop_v4UdpSocket::multicast_loop_v4UdpSocket::set_multicast_ttl_v4UdpSocket::multicast_ttl_v4UdpSocket::set_multicast_loop_v6UdpSocket::multicast_loop_v6UdpSocket::set_multicast_ttl_v6UdpSocket::multicast_ttl_v6UdpSocket::set_ttlUdpSocket::ttlUdpSocket::set_only_v6UdpSocket::only_v6UdpSocket::join_multicast_v4UdpSocket::join_multicast_v6UdpSocket::leave_multicast_v4UdpSocket::leave_multicast_v6UdpSocket::take_error- [`UdpSocket:...