1. XenForo 1.5.14 中文版——支持中文搜索!现已发布!查看详情
  2. Xenforo 爱好者讨论群:215909318 XenForo专区

新闻 Rust 1.8 发布,增加新特性 下载

本帖由 漂亮的石头2016-04-15 发布。版面名称:软件资讯

  1. 漂亮的石头

    漂亮的石头 版主 管理成员

    注册:
    2012-02-10
    帖子:
    487,584
    赞:
    47
    Rust 1.8 发布了。Rust 是 Mozilla 的一个新的编程语言,由web语言的领军人物Brendan Eich(js之父),Dave Herman以及Mozilla公司的Graydon Hoare 合力开发。

    和往常一样,你可以从我们的官方页面安装Rust 1.8 ,你也可以在Github上查看详细的更新说明

    Rust 1.8有两个新功能,并有针对Windows用户的好消息。

    第一个新特征是各式各样的“operator equals”运算符,如+ =和 - =,现在正通过各种性状重载。这一变化在RFC953,看起来就像这样:

    use std::eek:ps::AddAssign;

    #[derive(Debug)]
    struct Count {
    value: i32,
    }

    impl AddAssign for Count {
    fn add_assign(&mut self, other: Count) {
    self.value += other.value;
    }
    }

    fn main() {
    let mut c1 = Count { value: 1 };
    let c2 = Count { value: 5 };

    c1 += c2;

    println!("{:?}", c1);

    第二个特性是非常小的,RFC 218,在Rust1.8之前,没有字段的结构没有大括号:

    struct Foo; // works
    struct Bar { } // error

    在Windows方面,32位MSVC现在建立实施unwinding。这将移动i686-PC-Windows-MSVC到Tier 1的平台。

    最后,我们长期使用 make 构建 Rust,但是,我们已经有了建立Rust项目的一个奇妙的工具: Cargo。

    stabilizations 库

    Rust已稳定拥有约20个库函数和方法,有三大主要变化:UTF-16 related string methods,various APIs related to time,various traits needed for operator overloading mentioned in the language section。

    详情查看发行说明

    Cargo 特性


    • cargo init can be used to start a Cargo project in your current working directory, rather than making a new subdirectory like cargo new.


    • cargo metadata is another new subcommand for fetching metadata about a project.


    • .cargo/config now has keys for -v and --color


    • Cargo’s ability to have target-specific dependencies was enhanced.



    详情查看发行说明
    Rust 1.8 发布,增加新特性下载地址
     
正在加载...