Announcing Rust 1.31 and Rust 2018
#rust
https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html
cargo newするとCargo.tomlにedition = "2018"が含まれるようになる。
2015と2018のcrateは共存可能。
2015からの以降は、基本的にはcargo fixで可能。
Non-lexical lifetimes
NNLが使えるようになった。
Module system changes
主要な変更点:
extern crate is no longer needed in almost all circumstances.
You can import macros with use, rather than a #[macro_use] attribute.
Absolute paths begin with a crate name, where the keyword crate refers to the current crate.
A foo.rs and foo/ subdirectory may coexist; mod.rs is no longer needed when placing submodules in a subdirectory.
詳細は https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html を参照。
More lifetime elision rules
impl <'a>の'aや<'a, T:'a>のT:'a部分が省略可能になる(推論できる場合は)。
const fn
constの値として利用可能な関数が定義可能になる(ただしいろいろと制約はある)。
詳細は https://doc.rust-lang.org/reference/items/functions.html#const-functions を参照。
New tools
CI用にcargo fmt --checkというオプションも追加。
rustfmtとclippyがrustup component add rustfmtとrustup component add clippyでインストール可能。
バージョンも安定版となった(rustfmtのみ?)。
RLSも何か良くなったらしい?(使っていないので詳細は不明)
Tool lints
属性にツール毎の名前空間のようなものが付与されるようになった。
例えば#[rustfmt::skip]や#[allow(clippy::bool_comparison)]。
Documentation
省略
Domain working groups
省略
New Website
省略
Library stabilizations
省略
Crago features
省略