Rust 1.26 版本发布,系统编程语言

  

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> or fn open(path: impl AsRef<Path>).

  • Pattern matching will now automatically apply dereferences.

  • 128-bit integers in the form of u128 and i128 are now stable.

  • main can now return Result<(), 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.

更多内容

下载地址:

猜你喜欢

转载自www.oschina.net/news/96019/rust-1-26-released