Releases: rust-lang/rust
Releases · rust-lang/rust
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:...
Rust 1.8.0
Language
- Rust supports overloading of compound assignment statements like
+=by implementing theAddAssign,SubAssign,MulAssign,DivAssign,RemAssign,BitAndAssign,BitOrAssign,BitXorAssign,ShlAssign, orShrAssigntraits. RFC 953. - Empty structs can be defined with braces, as in
struct Foo { }, in addition to the non-braced form,struct Foo;. RFC 218.
Libraries
- Stabilized APIs:
str::encode_utf16(renamed fromutf16_units)str::EncodeUtf16(renamed fromUtf16Units)Ref::mapRefMut::mapptr::drop_in_placetime::Instanttime::SystemTimeInstant::nowInstant::duration_since(renamed fromduration_from_earlier)Instant::elapsedSystemTime::nowSystemTime::duration_since(renamed fromduration_from_earlier)SystemTime::elapsed- Various
Add/Subimpls forTimeandSystemTime SystemTimeErrorSystemTimeError::duration- Various impls for
SystemTimeError UNIX_EPOCHAddAssign,SubAssign,MulAssign,DivAssign,RemAssign,BitAndAssign,BitOrAssign,BitXorAssign,ShlAssign,ShrAssign.
- The
write!andwriteln!macros correctly emit errors if any of their arguments can't be formatted. - Various I/O functions support large files on 32-bit Linux.
- The Unix-specific
rawmodules, which contain a number of redefined C types are deprecated, includingos::raw::unix,os::raw::macos, andos::raw::linux. These modules defined types such asino_tanddev_t. The inconsistency of these definitions across platforms was making it difficult to implementstdcorrectly. Those that need these definitions should use thelibccrate. RFC 1415. - The Unix-specific
MetadataExttraits, includingos::unix::fs::MetadataExt, which expose values such as inode numbers no longer return platform-specific types, but instead return widened integers. RFC 1415. btree_set::{IntoIter, Iter, Range}are covariant.- Atomic loads and stores are not volatile.
- All types in
sync::mpscimplementfmt::Debug.
Performance
- Inlining hash functions lead to a 3% compile-time improvement in some workloads.
- When using jemalloc, its symbols are unprefixed so that it overrides the libc malloc implementation. This means that for rustc, LLVM is now using jemalloc, which results in a 6% compile-time improvement on a specific workload.
- Avoid quadratic growth in function size due to cleanups.
Misc
- 32-bit MSVC builds finally implement unwinding. i686-pc-windows-msvc is now considered a tier-1 platform.
- The
--print targetsflag prints a list of supported targets. - The
--print cfgflag prints thecfgs defined for the current target. rustccan be built with an new Cargo-based build system, written in Rust. It will eventually replace Rust's Makefile-based build system. To enable it configure withconfigure --rustbuild.- Errors for non-exhaustive
matchpatterns now list up to 3 missing variants while also indicating the total number of missing variants if more than 3. - Executable stacks are disabled on Linux and BSD.
- The Rust Project now publishes binary releases of the standard library for a number of tier-2 targets:
armv7-unknown-linux-gnueabihf,powerpc-unknown-linux-gnu,powerpc64-unknown-linux-gnu,powerpc64le-unknown-linux-gnux86_64-rumprun-netbsd. These can be installed with tools such as multirust.
Cargo
cargo initcreates a new Cargo project in the current directory. It is otherwise likecargo new.- Cargo has configuration keys for
-vand--color.verboseandcolor, respectively, go in the[term]section of.cargo/config. - Configuration keys that evaluate to strings or integers can be set via environment variables. For example the
build.jobskey can be set viaCARGO_BUILD_JOBS. Environment variables take precedence over config files. - Target-specific dependencies support Rust
cfgsyntax for describing targets so that dependencies for multiple targets can be specified together. RFC 1361. - The environment variables
CARGO_TARGET_ROOT,RUSTC, andRUSTDOCtake precedence over thebuild.target-dir,build.rustc, andbuild.rustdocconfiguration values. - The child process tree is killed on Windows when Cargo is killed.
- The
build.targetconfiguration value sets the target platform, like--target.
Compatibility Notes
- Unstable compiler flags have been further restricted. Since 1.0
-Zflags have been considered unstable, and other flags that were considered unstable additionally required passing-Z unstable-optionsto access. Unlike unstable language and library features though, these options have been accessible on the stable release channel. Going forward, new unstable flags will not be available on the stable release channel, and old unstable flags will warn about their usage. In the future, all unstable flags will be unavailable on the stable release channel. - It is no longer possible to
matchon empty enum variants using theVariant(..)syntax. This has been a warning since 1.6. - The Unix-specific
MetadataExttraits, includingos::unix::fs::MetadataExt, which expose values such as inode numbers no longer return platform-specific types, but instead return widened integers. RFC 1415. - Modules sourced from the filesystem cannot appear within arbitrary blocks, but only within other modules.
--cfgcompiler flags are parsed strictly as identifiers.- On Unix, [stack overflow triggers a runtime abort instead...