分类分类
更新时间:2026-11-26 15:43:15作者: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
相关
喵喵王国角色扮演1.15Gv00.40.012026-11-26
下载pokecatch游戏休闲益智410Kv1.02026-11-26
下载摇曳露营拼图露营休闲益智82.14 Mv1.7.52026-11-26
下载暗金秘录角色扮演316.84 Mv0.365.02026-11-26
下载AI剪辑图像拍照196.82 MBv21.52026-11-25
下载精灵联萌0.05折版策略游戏13.63 Mv1.0.02026-11-25
下载MilkSU内核管理器实用工具14.29 Mv0.2.62026-11-25
下载百炼仙途角色扮演528.9 Mv10002026-11-25
下载蛊界永生角色扮演407.01 Mv0.4.162026-11-25
下载幻梦无年动作射击276.68 Mv1.1.02026-11-25
下载假人慢打漂泊带土动作射击856.96 Mv0.9.02026-11-25
下载懒人英语学习办公169.94 MBv4.9.62026-11-24
下载










