Rust versions / 1.13
Rust release · Nov 10, 2016
Rust 1.13: what's new, what was stabilized
Short answerRust 1.13 was released on Nov 10, 2016: 3 language stabilizations ([Stabilize the ? operator][36995]. ? is a simple way to propagate); 5 newly stable APIs (checked_abs, wrapping_abs, overflowing_abs, RefCell::try_borrow, ...); 7 compatibility notes that can affect existing code.
← Rust 1.12All versionsRust 1.14 →
Language features stabilized
- [Stabilize the ? operator][36995]. ? is a simple way to propagate
- [Stabilize macros in type position][36014]. Described in [RFC 873].
- [Stabilize attributes on statements][36995]. Described in [RFC 0016].
5 APIs stabilized
checked_abs, wrapping_abs, overflowing_abs, RefCell::try_borrow, RefCell::try_borrow_mut
Can it break my build?
The release lists these compatibility notes. Most only affect rare code, but read them before you raise your toolchain in CI:
- [
SipHasher] is deprecated. Use [DefaultHasher]. - [Deny (by default) transmuting from fn item types to pointer-sized
- [Fix
#[derive]for empty tuple structs/variants][35728]. - [Issue deprecation warnings for safe accesses to extern statics][36173]
- [Fix lifetime rules for 'if' conditions][36029].
- [Inherit overflow checks for sum and product][36372].
- [Forbid user-defined macros named "macro_rules"][36730].
Use it
rustup update stable # get the newest release
rustup install 1.13 # or exactly this one
rustup override set 1.13 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.13" under [package] in Cargo.toml. Cargo then refuses to build it on older compilers with a clear message, and with resolver 3 (the default on the 2024 edition, Rust 1.85+) it also prefers dependency versions that support it.
Full release notes
Language
- [Stabilize the
?operator][36995].?is a simple way to propagate errors, like thetry!macro, described in [RFC 0243]. - [Stabilize macros in type position][36014]. Described in [RFC 873].
- [Stabilize attributes on statements][36995]. Described in [RFC 0016].
- [Fix
#[derive]for empty tuple structs/variants][35728] - [Fix lifetime rules for 'if' conditions][36029]
- [Avoid loading and parsing unconfigured non-inline modules][36482]
Compiler
- [Add the
-C link-argargument][36574] - [Remove the old AST-based backend from rustc_trans][35764]
- [Don't enable NEON by default on armv7 Linux][35814]
- [Fix debug line number info for macro expansions][35238]
- [Do not emit "class method" debuginfo for types that are not DICompositeType][36008]
- [Warn about multiple conflicting #[repr] hints][34623]
- [When sizing DST, don't double-count nested struct prefixes][36351]
- [Default RUST_MIN_STACK to 16MiB for now][36505]
- [Improve rlib metadata format][36551]. Reduces rlib size significantly.
- [Reject macros with empty repetitions to avoid infinite loop][36721]
- [Expand macros without recursing to avoid stack overflows][36214]
Diagnostics
- [Replace macro backtraces with labeled local uses][35702]
- [Improve error message for misplaced doc comments][33922]
- [Buffer unix and lock windows to prevent message interleaving][35975]
- [Update lifetime errors to specifically note temporaries][36171]
- [Special case a few colors for Windows][36178]
- [Suggest
use selfwhen such an import resolves][36289] - [Be more specific when type parameter shadows primitive type][36338]
- Many minor improvements
Compile-time Optimizations
- [Compute and cache HIR hashes at beginning][35854]
- [Don't hash types in loan paths][36004]
- [Cache projections in trans][35761]
- [Optimize the parser's last token handling][36527]
- [Only instantiate #[inline] functions in codegen units referencing them][36524]. This leads to big improvements in cases where crates export define many inline functions without using them directly.
- [Lazily allocate TypedArena's first chunk][36592]
- [Don't allocate during default HashSet creation][36734]
Stabilized APIs
- [
checked_abs] - [
wrapping_abs] - [
overflowing_abs] - [
RefCell::try_borrow] - [
RefCell::try_borrow_mut]
Libraries
- [Add
assert_ne!anddebug_assert_ne!][35074] - [Make
vec_deque::Drain,hash_map::Drain, andhash_set::Draincovariant][35354] - [Implement
AsRef<[T]>forstd::slice::Iter][35559] - [Implement
Debugforstd::vec::IntoIter][35707] - [
CString: avoid excessive growth just to 0-terminate][35871] - [Implement
CoerceUnsizedfor{Cell, RefCell, UnsafeCell}][35627] - [Use arc4rand on FreeBSD][35884]
- [memrchr: Correct aligned offset computation][35969]
- [Improve Demangling of Rust Symbols][36059]
- [Use monotonic time in condition variables][35048]
- [Implement
Debugforstd::path::{Components,Iter}][36101] - [Implement conversion traits for
char][35755] - [Fix illegal instruction caused by overflow in channel cloning][36104]
- [Zero first byte of CString on drop][36264]
- [Inherit overflow checks for sum and product][36372]
- [Add missing Eq implementations][36423]
- [Implement
DebugforDirEntry][36631] - [When
getaddrinforeturnsEAI_SYSTEMretrieve actual error fromerrno][36754] - [
SipHasher] is deprecated. Use [DefaultHasher]. - [Implement more traits for
std::io::ErrorKind][35911] - [Optimize BinaryHeap bounds checking][36072]
- [Work around pointer aliasing issue in
Vec::extend_from_slice,extend_with_element][36355] - [Fix overflow checking in unsigned pow()][34942]
Cargo
- This release includes security fixes to both curl and OpenSSL.
- [Fix transitive doctests when panic=abort][cargo/3021]
- [Add --all-features flag to cargo][cargo/3038]
- [Reject path-based dependencies in
cargo package][cargo/3060] - [Don't parse the home directory more than once][cargo/3078]
- [Don't try to generate Cargo.lock on empty workspaces][cargo/3092]
- [Update OpenSSL to 1.0.2j][cargo/3121]
- [Add license and license_file to cargo metadata output][cargo/3110]
- [Make crates-io registry URL optional in config; ignore all changes to source.crates-io][cargo/3089]
- [Don't download dependencies from other platforms][cargo/3123]
- [Build transitive dev-dependencies when needed][cargo/3125]
- [Add support for per-target rustflags in .cargo/config][cargo/3157]
- [Avoid updating registry when adding existing deps][cargo/3144]
- [Warn about path overrides that won't work][cargo/3136]
- [Use workspaces during
cargo install][cargo/3146] - [Leak mspdbsrv.exe processes on Windows][cargo/3162]
- [Add --message-format flag][cargo/3000]
- [Pass target environment for rustdoc][cargo/3205]
- [Use
CommandExt::execforcargo runon Unix][cargo/2818] - [Update curl and curl-sys][cargo/3241]
- [Call rustdoc test with the correct cfg flags of a package][cargo/3242]
Tooling
- [rustdoc: Add the
--sysrootargument][36586] - [rustdoc: Fix a couple of issues with the search results][35655]
- [rustdoc: remove the
!from macro URLs and titles][35234] - [gdb: Fix pretty-printing special-cased Rust types][35585]
- [rustdoc: Filter more incorrect methods inherited through Deref][36266]
Misc
- [Remove unmaintained style guide][35124]
- [Add s390x support][36369]
- [Initial work at Haiku OS support][36727]
- [Add mips-uclibc targets][35734]
- [Crate-ify compiler-rt into compiler-builtins][35021]
- [Add rustc version info (git hash + date) to dist tarball][36213]
- 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.
- [Fix
#[derive]for empty tuple structs/variants]35728. Part of RFC 1506. - Issue deprecation warnings for safe accesses to extern statics
- Fix lifetime rules for 'if' conditions.
- Inherit overflow checks for sum and product.
- Forbid user-defined macros named "macro_rules".
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.14Released Dec 22, 2016.Read it next →Also worth your time
Did this answer your question?