1.30.0 #
- Released on: 25 October, 2018
- Branched from master on: 7 September, 2018
Language #
- Procedural macros are now available. These kinds of macros allow for more powerful code generation. There is a new chapter available in the Rust Programming Language book that goes further in depth.
- You can now use keywords as identifiers using the raw identifiers
syntax (
r#), 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.
- You can now use
cratein paths. 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
::. 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, e.g.#[used] static FOO: u32 = 1; - You can now import and reexport macros from other crates with the
usesyntax. 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. - Non-macro attributes now allow all forms of literals, not just
strings. 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.
Compiler #
- Added the
riscv32imc-unknown-none-elftarget. - Added the
aarch64-unknown-netbsdtarget - Upgraded to LLVM 8.
Libraries #
Stabilized APIs #
The following methods are replacement methods for
trim_left,trim_right,trim_left_matches, andtrim_right_matches, which will be deprecated in 1.33.0:
Cargo #
cargo rundoesn’t require specifying a package in workspaces.cargo docnow supports--message-format=json. This is equivalent to callingrustdoc --error-format=json.- Cargo will now provide a progress bar for builds.
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.