分类分类
更新时间:2026-02-18 19:49:03作者:qazwsxzxc
Rust 1.65.0 稳定版已发布。此版本包含多项重要的语法变更,以及编辑器和标准库方面的改动。值得关注的是,Rust 1.65 现在还启用了 MIR 内联来优化编译,为 crate 提供了 3-10% 的编译时间改进。
语言特性
为枚举类型使用#[non_exhaustive]变体进行 as转换添加错误处理
let else正式稳定
let PATTERN: TYPE = EXPRESSION else {
DIVERGING_CODE;
};
泛型关联类型 (Generic Associated Types, GATs) 正式稳定
Lifetime、type 和 const 泛型现在可以在关联类型上进行定义,如下所示:
trait Foo {
type Bar<'x>;
}
下面是一些使用示例:
/// An `Iterator`-like trait that can borrow from `Self`
trait LendingIterator {
type Item<'a> where Self: 'a;
fn next<'a>(&'a mut self) -> Option<Self::Item<'a>>;
}
/// Can be implemented over smart pointers, like `Rc` or `Arc`,
/// in order to allow being generic over the pointer type
trait PointerFamily {
type Pointer<T>: Deref<Target = T>;
fn new<T>(value: T) -> Self::Pointer<T>;
}
/// Allows borrowing an array of items. Useful for
/// `NdArray`-like types that don't necessarily store
/// data contiguously.
trait BorrowArray<T> {
type Array<'x, const N: usize> where Self: 'x;
fn borrow_array<'a, const N: usize>(&'a self) -> Self::Array<'a, N>;
}
从 Clippy 添加 lintslet_underscore_drop,let_underscore_lock 和 let_underscore_must_use
未初始化的整数、浮点数和原始指针现在会被视作未定义行为 (immediate UB)
适用于 Windows x86_64, aarch64 和 thumbv7a 架构的 raw-dylib 正式稳定
不允许在外部 ADTs 中 Dropimpl
相关
归墟战纪策略游戏262.92 MBv3.95802026-02-14
下载爆裂老奶策略游戏209.43 MBv1.0.112026-02-14
下载超能下蛋鸭策略游戏395.4 MBv1.2.82026-02-14
下载你好盒子实用工具12.1 MBv2.2.852026-02-14
下载我在峡谷当牛马休闲益智87.95 MBv0.7.12026-02-14
下载抽卡监狱2策略游戏190.75 MBv1.4.92026-02-14
下载Campus社交通讯94.36 MBv1.19.02026-02-14
下载冒险传奇角色扮演141.73 Mv9991.12026-02-14
下载心动次元app社交通讯43.96 Mv1.0.1.32026-02-14
下载致亲爱的我角色扮演1.63Gv1.02026-02-14
下载狼伴侣游戏手机版冒险游戏155.6 Mv1.02026-02-14
下载Loclike社交通讯169.08 Mv2.2.112026-02-14
下载










