Rust 1.26 版本发布。Rust 是一门由 Mozilla 开发的专注于安全性,速度和并发性的系统编程语言。主要更新内容如下:
语言
现在 Closures 实现了 Copy and/or Clone
Inclusive range 语法,如
for x in 0..=10
现可用Stablise
'_
. The underscore lifetime can be used anywhere where a lifetime can be elided.impl Trait
is now stable allowing you to have abstract types in returns or in function parameters. e.g.fn foo() -> impl Iterator<Item=u8>
orfn open(path: impl AsRef<Path>)
.Pattern matching will now automatically apply dereferences.
128-bit integers in the form of
u128
andi128
are now stable.main
can now returnResult<(), E: Debug>
in addition to()
.A lot of operations are now available in a const context. E.g. You can now index into constant arrays, reference and dereference into constants, and use Tuple struct constructors.
下载地址: