Rust 1.100.0 稳定版发布:版本号首进三位数,never type 历经 10 年正式转正
Rust 团队于 11 月 12 日发布 Rust 1.100.0 稳定版,版本号首次进入三位数阶段。最受关注的变化是 never type(用 ! 表示的永不返回类型)正式稳定,该功能历经约 10 年时间和 5 次稳定化尝试,现在开发者可在任意位置显式使用 !,包括 Result<T, !> 等类型定义,同时 Infallible 被调整为 ! 的别名。需要注意的兼容性变化是:在 Rust 2015、2018 和 2021 版本中,永不返回类型的默认回退行为从 () 改为 !,少数代码可能受影响。 内存分配方面,Allocator API 的核心部分被稳定,开发者可通过 Allocator trait 定义自定义内存分配器并用于 Vec 和 Box,这是 Allocators 1.0 项目的重要进展。标准库新增 core::mem::DropGuard 用于变量离开作用域时执行闭包,简化资源清理和事务回滚,还新增 std::mem::conjure_zst 提供创建零大小类型的安全接口,减少对 transmute 的依赖。Cargo 方面,新版本默认提示未使用的依赖项,改进了构建缓存目录组织方式。 软件供应链安全方面,Cargo 的 min-publish-age 依赖版本冷却机制正式稳定,开发者可在 .cargo/config.toml 中设置依赖包最短发布时间间隔(如 global-min-publish-age = "3 days"),解析依赖时跳过发布不足 3 天的新版本,为恶意软件包的发现留出时间。已通过 rustup 安装旧版本的用户可执行 rustup update stable 升级。
Current read
Rust 版本号首次破百,等了 10 年的 never type 这次真稳定了,还有自定义分配器和依赖冷却期能挡恶意包。写 Rust 的朋友直接 rustup update stable 就能体验。
Evidence
2 sourcesConflict check
Dedup data only shows that these sources discuss the same event, not that they agree. There is no structured supporting or refuting evidence yet, so no conflict is inferred automatically.