Rust versions / 1.30
Rust release · Oct 25, 2018
Rust 1.30: what's new, what was stabilized
Short answerRust 1.30 was released on Oct 25, 2018: 10 newly stable APIs (Ipv4Addr::BROADCAST, Ipv4Addr::LOCALHOST, Ipv4Addr::UNSPECIFIED, Ipv6Addr::LOCALHOST, ...). Point release: 1.30.1 (Nov 8, 2018).
← Rust 1.29All versionsRust 1.31 →
10 APIs stabilized
Ipv4Addr::BROADCAST, Ipv4Addr::LOCALHOST, Ipv4Addr::UNSPECIFIED, Ipv6Addr::LOCALHOST, Ipv6Addr::UNSPECIFIED, Iterator::find_map, str::trim_end_matches, str::trim_end, str::trim_start_matches, str::trim_start
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.30 # or exactly this one
rustup override set 1.30 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.30" 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
- [Procedural macros are now available.][52081] These kinds of macros allow for more powerful code generation. There is a [new chapter available][proc-macros] in the Rust Programming Language book that goes further in depth.
- [You can now use keywords as identifiers using the raw identifiers syntax (
r#),][53236] e.g.let r#for = true; - [Using anonymous parameters in traits is now deprecated with a warning and will be a hard error in the 2018 edition.][53272]
- [You can now use
cratein paths.][54404] This allows you to refer to the crate root in the path, e.g.use crate::foo;refers tofooinsrc/lib.rs. - [Using a external crate no longer requires being prefixed with
::.][54404] Previously, using a external crate in a module without a use statement requiredlet json = ::serde_json::from_str(foo);but can now be written aslet json = serde_json::from_str(foo);. - [You can now apply the
#[used]attribute to static items to prevent the compiler from optimising them away, even if they appear to be unused,][51363] e.g.#[used] static FOO: u32 = 1; - [You can now import and reexport macros from other crates with the
usesyntax.][50911] Macros exported with#[macro_export]are now placed into the root module of the crate. If your macro relies on calling other local macros, it is recommended to export with the#[macro_export(local_inner_macros)]attribute so users won't have to import those macros. - [You can now catch visibility keywords (e.g.
pub,pub(crate)) in macros using thevisspecifier.][53370] - [Non-macro attributes now allow all forms of literals, not just strings.][53044] Previously, you would write
#[attr("true")], and you can now write#[attr(true)]. - [You can now specify a function to handle a panic in the Rust runtime with the
#[panic_handler]attribute.][51366]
Compiler
- [Added the
riscv32imc-unknown-none-elftarget.][53822] - [Added the
aarch64-unknown-netbsdtarget][53165] - [Upgraded to LLVM 8.][53611]
Libraries
- [
ManuallyDropnow allows the inner type to be unsized.][53033]
Stabilized APIs
- [
Ipv4Addr::BROADCAST] - [
Ipv4Addr::LOCALHOST] - [
Ipv4Addr::UNSPECIFIED] - [
Ipv6Addr::LOCALHOST] - [
Ipv6Addr::UNSPECIFIED] - [
Iterator::find_map]
The following methods are replacement methods for trim_left, trim_right, trim_left_matches, and trim_right_matches, which will be deprecated in 1.33.0:
- [
str::trim_end_matches] - [
str::trim_end] - [
str::trim_start_matches] - [
str::trim_start]
Cargo
- [
cargo rundoesn't require specifying a package in workspaces.][cargo/5877] - [
cargo docnow supports--message-format=json.][cargo/5878] This is equivalent to callingrustdoc --error-format=json. - [Cargo will now provide a progress bar for builds.][cargo/5995]
Misc
rustdocallows you to specify what edition to treat your code as with the--editionoption.rustdocnow has the--color(specify whether to output color) and--error-format(specify error format, e.g.json) options.- We now distribute a
rust-gdbguiscript that invokesgdbguiwith Rust debug symbols. - Attributes from Rust tools such as
rustfmtorclippyare now available, e.g.#[rustfmt::skip]will skip formatting the next item.
1.30.1 (Nov 8, 2018)
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.31Released Dec 6, 2018.Read it next →Also worth your time
Did this answer your question?