Rust versions / 1.4
Rust release · Oct 29, 2015
Rust 1.4: what's new, what was stabilized
Short answerRust 1.4 was released on Oct 29, 2015.
← Rust 1.3All versionsRust 1.5 →
Can it break my build?
No compatibility notes were listed for this release.
Use it
rustup update stable # get the newest release
rustup install 1.4 # or exactly this one
rustup override set 1.4 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.4" 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
Highlights
- Windows builds targeting the 64-bit MSVC ABI and linker (instead of GNU) are now supported and recommended for use.
Breaking Changes
- [Several changes have been made to fix type soundness and improve the behavior of associated types][sound]. See [RFC 1214]. Although we have mostly introduced these changes as warnings this release, to become errors next release, there are still some scenarios that will see immediate breakage.
- [The
str::linesandBufRead::linesiterators treat\r\nas line breaks in addition to\n][crlf]. - [Loans of
'staticlifetime extend to the end of a function][stat]. - [
str::parseno longer introduces avoidable rounding error when parsing floating point numbers. Together with earlier changes to float formatting/output, "round trips" like f.to_string().parse() now preserve the value of f exactly. Additionally, leading plus signs are now accepted][fp3].
Language
usestatements that import multiple items [can now rename them][i], as inuse foo::{bar as kitten, baz as puppy}.- [Binops work correctly on fat pointers][binfat].
pub extern crate, which does not behave as expected, [issues a warning][pec] until a better solution is found.
Libraries
- [Many APIs were stabilized][stab]:
<Box<str>>::into_string, [Arc::downgrade], [Arc::get_mut], [Arc::make_mut], [Arc::try_unwrap], [Box::from_raw], [Box::into_raw], [CStr::to_str], [CStr::to_string_lossy], [CString::from_raw], [CString::into_raw], [IntoRawFd::into_raw_fd], [IntoRawFd],IntoRawHandle::into_raw_handle,IntoRawHandle,IntoRawSocket::into_raw_socket,IntoRawSocket, [Rc::downgrade], [Rc::get_mut], [Rc::make_mut], [Rc::try_unwrap], [Result::expect], [String::into_boxed_str], [TcpStream::read_timeout], [TcpStream::set_read_timeout], [TcpStream::set_write_timeout], [TcpStream::write_timeout], [UdpSocket::read_timeout], [UdpSocket::set_read_timeout], [UdpSocket::set_write_timeout], [UdpSocket::write_timeout],Vec::append,Vec::split_off, [VecDeque::append], [VecDeque::retain], [VecDeque::split_off], [rc::Weak::upgrade], [rc::Weak], [slice::Iter::as_slice], [slice::IterMut::into_slice], [str::CharIndices::as_str], [str::Chars::as_str], [str::split_at_mut], [str::split_at], [sync::Weak::upgrade], [sync::Weak], [thread::park_timeout], [thread::sleep]. - [Some APIs were deprecated][dep]:
BTreeMap::with_b,BTreeSet::with_b,Option::as_mut_slice,Option::as_slice,Result::as_mut_slice,Result::as_slice,f32::from_str_radix,f64::from_str_radix. - [Reverse-searching strings is faster with the 'two-way' algorithm][s].
- [
std::io::copyallows?Sizedarguments][cc]. - The
Windows,Chunks, andChunksMutiterators over slices all [overridecount,nthandlastwith an *O*(1) implementation][it]. - [
Defaultis implemented for arrays up to[T; 32]][d]. - [
IntoRawFdhas been added to the Unix-specific prelude,IntoRawSocketandIntoRawHandleto the Windows-specific prelude][pr]. - [
Extend<String>andFromIterator<Stringare both implemented forString][es]. - [
IntoIteratoris implemented for references toOptionandResult][into2]. - [
HashMapandHashSetimplementExtend<&T>whereT: Copy][ext] as part of [RFC 839]. This will cause type inference breakage in rare situations. - [
BinaryHeapimplementsDebug][bh2]. - [
BorrowandBorrowMutare implemented for fixed-size arrays][bm]. - [
extern fns with the "Rust" and "C" ABIs implement common traits includingEq,Ord,Debug,Hash][fp]. - [String comparison is faster][faststr].
&mut TwhereT: std::fmt::Write[also implementsstd::fmt::Write][mutw].- [A stable regression in
VecDeque::push_backand other capacity-altering methods that caused panics for zero-sized types was fixed][vd]. - [Function pointers implement traits for up to 12 parameters][fp2].
Miscellaneous
- The compiler no longer uses the 'morestack' feature to prevent stack overflow. Instead it uses guard pages and stack probes (though stack probes are not yet implemented on any platform but Windows).
- The compiler matches traits faster when projections are involved.
- The 'improper_ctypes' lint no longer warns about use of
isizeandusize. - Cargo now displays useful information about what its doing during
cargo update.
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.5Released Dec 10, 2015.Read it next →Also worth your time
Did this answer your question?