Email me

Rust versions / 1.7

Rust release · Mar 3, 2016

Rust 1.7: what's new, what was stabilized

Short answerRust 1.7 was released on Mar 3, 2016: 5 compatibility notes that can affect existing code.

Mar 3, 2016release date
0language stabilizations
0APIs stabilized
-new edition

← Rust 1.6All versionsRust 1.8 →

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:

  • Soundness fixes to the interactions between associated types and
  • [Several bugs in the compiler's visibility calculations were
  • Defaulted type parameters were accidentally accepted in positions
  • [Parsing "." as a float results in an error instead of 0][1.7p].
  • [Borrows of closure parameters may not outlive the closure][1.7bc].

Use it

rustup update stable        # get the newest release
rustup install 1.7          # or exactly this one
rustup override set 1.7     # pin a project to it

To require at least this version from users of your crate, set rust-version = "1.7" 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

Libraries

  • Stabilized APIs
  • Path
  • [Path::strip_prefix] (renamed from relative_from)
  • [path::StripPrefixError] (new error type returned from strip_prefix)
  • Ipv4Addr
  • [Ipv4Addr::is_loopback]
  • [Ipv4Addr::is_private]
  • [Ipv4Addr::is_link_local]
  • [Ipv4Addr::is_multicast]
  • [Ipv4Addr::is_broadcast]
  • [Ipv4Addr::is_documentation]
  • Ipv6Addr
  • [Ipv6Addr::is_unspecified]
  • [Ipv6Addr::is_loopback]
  • [Ipv6Addr::is_multicast]
  • Vec
  • [Vec::as_slice]
  • [Vec::as_mut_slice]
  • String
  • [String::as_str]
  • [String::as_mut_str]
  • Slices
  • <[T]>::[clone_from_slice], which now requires the two slices to be the same length
  • <[T]>::[sort_by_key]
  • checked, saturated, and overflowing operations
  • [i32::checked_rem], [i32::checked_neg], [i32::checked_shl], [i32::checked_shr]
  • [i32::saturating_mul]
  • [i32::overflowing_add], [i32::overflowing_sub], [i32::overflowing_mul], [i32::overflowing_div]
  • [i32::overflowing_rem], [i32::overflowing_neg], [i32::overflowing_shl], [i32::overflowing_shr]
  • [u32::checked_rem], [u32::checked_neg], [u32::checked_shl], [u32::checked_shl]
  • [u32::saturating_mul]
  • [u32::overflowing_add], [u32::overflowing_sub], [u32::overflowing_mul], [u32::overflowing_div]
  • [u32::overflowing_rem], [u32::overflowing_neg], [u32::overflowing_shl], [u32::overflowing_shr]
  • and checked, saturated, and overflowing operations for other primitive types
  • FFI
  • [ffi::IntoStringError]
  • [CString::into_string]
  • [CString::into_bytes]
  • [CString::into_bytes_with_nul]
  • From<CString> for Vec<u8>
  • IntoStringError
  • [IntoStringError::into_cstring]
  • [IntoStringError::utf8_error]
  • Error for IntoStringError
  • Hashing
  • [std::hash::BuildHasher]
  • [BuildHasher::Hasher]
  • [BuildHasher::build_hasher]
  • [std::hash::BuildHasherDefault]
  • [HashMap::with_hasher]
  • [HashMap::with_capacity_and_hasher]
  • [HashSet::with_hasher]
  • [HashSet::with_capacity_and_hasher]
  • [std::collections::hash_map::RandomState]
  • [RandomState::new]
  • [Validating UTF-8 is faster by a factor of between 7 and 14x for ASCII input][1.7utf8]. This means that creating Strings and strs from bytes is faster.
  • [The performance of LineWriter (and thus io::stdout) was improved by using memchr to search for newlines][1.7m].
  • [f32::to_degrees and f32::to_radians are stable][1.7f]. The f64 variants were stabilized previously.
  • [BTreeMap was rewritten to use less memory and improve the performance of insertion and iteration, the latter by as much as 5x][1.7bm].
  • [BTreeSet and its iterators, Iter, IntoIter, and Range are covariant over their contained type][1.7bt].
  • [LinkedList and its iterators, Iter and IntoIter are covariant over their contained type][1.7ll].
  • [str::replace now accepts a Pattern][1.7rp], like other string searching methods.
  • [Any is implemented for unsized types][1.7a].
  • [Hash is implemented for Duration][1.7h].

Misc

  • [When running tests with --test, rustdoc will pass --cfg arguments to the compiler][1.7dt].
  • [The compiler is built with RPATH information by default][1.7rpa]. This means that it will be possible to run rustc when installed in unusual configurations without configuring the dynamic linker search path explicitly.
  • [rustc passes --enable-new-dtags to GNU ld][1.7dta]. This makes any RPATH entries (emitted with -C rpath) *not* take precedence over LD_LIBRARY_PATH.

Cargo

  • [cargo rustc accepts a --profile flag that runs rustc under any of the compilation profiles, 'dev', 'bench', or 'test'][1.7cp].
  • [The rerun-if-changed build script directive no longer causes the build script to incorrectly run twice in certain scenarios][1.7rr].

Compatibility Notes

Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.

← Rust 1.6All versionsRust 1.8 →

Up next

Next releaseRust 1.8Released Apr 14, 2016.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ