来源:HN 讨论主帖 Rust 1.100(541 分,220 条评论),指向 Rust 官方博客的 1.100.0 发布公告。同话题关联帖:Rust 1.100(GitHub release tag 链接)(308 分,9 条评论)——该帖评论区被版主整体搬到了主帖下。本篇为 cluster 模式(2 帖),关联帖引文标注 [thread 2]。主帖归档抓取于 2026-11-12 23:17 UTC,入库评论 123 条(抓取上限 100 条/轮,多轮抓取按 comment id 合并);关联帖入库 9 条。归档评论的分数字段均为 0(HN 未返回评论分),引文选择依据为内容本身与讨论价值。引文保留 HN 原文的 HTML 实体,逐条与归档评论比对。

原文概要

2026 年 11 月 12 日,Rust 团队发布 1.100.0。这一版最重的条目只有一个符号:!。公告里写着,never 类型在「10 年、5 次失败的稳定化尝试之后」终于转正,并顺带完成了 Rust 2026 项目目标里的 stabilize-never-type 一项。它是 Rust 的规范不可居住类型(uninhabited type)——表示发散计算的类型,return、break、std::process::exit 这类终止控制流的表达式都拥有 ! 类型。因为 ! 不可能有值,Rust 允许 never-to-any 强制转换,可以把 ! 转成任意类型;以前只能写 -> !,现在可以把它写进任何位置,例如 fn infallible_unwrap<T>(res: Result<T, !>) -> T。Infallible 也被改成 never type 的别名,老 API 因此可以互换使用。

代价是一处破坏性变更:为了能改 Infallible,Rust 把 2024 版之前(2015、2018、2021 三个 edition)的 never type fallback 从 () 改成 !,2024 edition 此前已经这么改过。公告说这个影响通常察觉不到,但少数场景会受影响(比如忽略一个返回泛型参数的函数结果),也顺带让编译器识别出更多不可达代码。官方提前发过 future-compatibility 警告,并为因此编译失败的公开 crate 发布了修复。

第二条主线是 allocator_api 的核心部分转正。新的 Allocator trait 稳定下来,库作者可以为 Vec 和 Box 定义自定义分配器,配套 API 包括 Vec::new_in、Box::new_in、Box::into_raw_with_allocator、Vec::allocator 等。这是 Allocators 1.0 项目目标的地基——trait 和设计定型之后,后续会有更多集合和指针类型支持自定义分配器。

另外两个小工具,一个是 core::mem::DropGuard:拿一个变量和一个闭包,变量离开作用域时执行闭包,配合 DropGuard::dismiss 可以中途放弃执行。公告给的例子是一个「要么全解析成功、要么 nums 原样不动」的解析器,靠 guard 在 ? 提前返回时回滚。另一个是 std::mem::conjure_zst:在知道安全的前提下制造零大小类型的官方方式,替代 transmute(())、MaybeUninit::uninit().assume_init() 之类的偏方。它是 unsafe 的,因为很多 API 的安全性依赖「这种类型造不出来」——公告举的例子是 PyO3 的 Python<'py>,那是代表持有 Python GIL 的零大小标记,凭空造一个就能绕过调用前置条件。

Cargo 侧有三件事。其一是未使用依赖报告:cargo::unused_dependencies lint 默认 warn,会在 Cargo.toml 里指出没人用的依赖,例如:

warning: unused dependency `tracing-subscriber`
  --> Cargo.toml:23:1
   = note: `cargo::unused_dependencies` is set to `warn` by default
help: consider removing the dependency on `tracing-subscriber`

它属于新的 lints.cargo 配置表;限制是只有构建全部相关 target 时才会出现,cargo check --bin foo 看不到,未使用的 dev-dependencies 也不会报——因为无法确定所有开发期 target 都构建过。其二是构建目录缓存冲突:Cargo 现在把 build-configuration hash 从文件名挪到父目录,目录按构建步骤而不是文件类型组织。这项改动源自 2025 年的 build directory layout 项目目标,可能打破此前为缺失特性写的绕行代码,公告指向 cargo#17287。其三是 min-publish-age,也就是依赖冷却(dependency cooldowns,RFC 3923):在 .cargo/config.toml 里写 [registry] global-min-publish-age = "3 days",解析器就会跳过发布时间太近的版本,并明确告诉你它压住了什么:

Locking 2 packages to highest compatible version as of min-publish-age
  Adding cc v1.11.0 (available: v1.18.0, published 3 hours ago)

确实需要最新版时,可以单次放行:CARGO_RESOLVER_INCOMPATIBLE_PUBLISH_AGE=allow cargo update clap --precise 4.6.9。两个已知例外:索引里没有 pubtime 字段的版本永远不会被压住;cargo install 不看最小发布时间。

其余稳定 API 是一长串:bool::toggle、Box::map、Box::take、Rc::map、Arc::map、str::trim_prefix、str::trim_suffix、Path::trim_prefix、Vec::from_fn、UnsafeCell::replace、impl AsRef<T> for !、Child::main_thread_handle、os::windows::process::CommandExt::show_window。

HN 上的提交过程本身也有个小插曲。最先被提交的是 GitHub 上的 release tag 链接(308 分,9 条评论),评论里有人提醒应该等官方博客上线再提交,版主随后把讨论整体搬到了官方博客链接那一帖(541 分,220 条评论),也就是本篇的主帖。评论区里还出现了一次失败的 @dang 提及——有人在回复里 @ 了版主本人,得到的答案是这个站根本不支持那种写法。

讨论焦点

一、never 类型:十年,五次失败

第一条回复就把十年的等待压缩成了一句话:

“Finally, "never" happened” — karavelov [c:50471997] (译文:终于,never 发生了。)

而这个类型长期被社区开玩笑地叫做「1.100」——因为它总被拿来对标发布版本号。Rust 核心成员 JoshTriplett 顺手把这个梗结清了:

“And the running joke that the type is named after its stabilization date can finally be put to rest. :)” — JoshTriplett [c:50472881] (译文:那个「这个类型是以它的稳定化日期命名的」玩笑,现在终于可以收场了。)

对多数人来说,真正的新东西是「可以把它写进类型里」这件事。最简洁的描述来自 yccs27:

“If you have a variable x: ! in scope, your code can never be reached.” — yccs27 [c:50474283] (译文:如果你作用域里有一个 x: ! 类型的变量,你的代码就永远不会执行到。)

Xirdus 给的是一份集合论版本的解释,把「顶层类型」和「底层类型」的直觉一次讲透:

“Mathematically, types are sets of possible values.<p>Any type (like in TypeScript; Rust doesn't have one) is a set of every possible value; a supertype of all types. Every expression regardless of type can be assigned to a variable of type any.<p>The opposite is the never type, which is an empty set; no value is of type never. Per set theory, an empty set is a subset of every set, which makes the never type a subtype of all types. An expression of type never can be assigned to every variable regardless of type.<p>If never type has no values, then how can an expression have never type? Easy: it must never evaluate. Infinite loops, unconditional panics/exceptions, process exit/abort, etc. Also, generics - you can have Vec<!> that's always empty, Result<T,!> that can never be an error, etc.” — Xirdus [c:50473385] (译文:数学上,类型就是可能值的集合。任何类型(比如 TypeScript 里的那个,Rust 没有)是所有可能值的集合,是所有类型的超类型——任何类型的表达式都能赋给 any 类型的变量。never type 正好相反,它是一个空集:没有任何值是 never 类型的。按集合论,空集是任何集合的子集,于是 never type 就成了所有类型的子类型,never 类型的表达式可以赋给任意类型的变量。那如果 never 没有值,表达式怎么会是 never 类型?很简单:它必须永不求值——死循环、无条件 panic 或异常、进程退出或 abort 等等。还有泛型:你可以有永远为空的 Vec<!>,也可以有永远不会出错的 Result<T,!>。)

而对 Rust 用户来说,变化点是「模式匹配也知道这件事」。kibwen 把旧办法和新办法摆在一起:

“Basic use cases like that have always been possible in Rust, either via defining your own enum with zero variants (enum Foo {}), or by using a function return type of ! which was hardcoded to work for certain things, e.g. infinite loops. What this release does is generalizes it so that ! can participate in types in general, and the coolest part is that pattern matching is aware of this, so for example if you have a Result&lt;u8, !&gt; where the error variant is impossible, a match over this would allow you to omit the impossible error arm, and furthermore because this enum now effectively only has a single variant, it would allow you to use the pleasant irrefutable destructuring assignment syntax let Ok(foo) = blah();.” — kibwen [c:50474336] (译文:这类用法在 Rust 里一直都能做到,要么自己定义一个零变体枚举(enum Foo {}),要么用 ! 作函数返回类型——后者过去只对死循环之类的场景硬编码生效。这一版做的是把它一般化,让 ! 能参与任何类型;最关键的是模式匹配也知道了这件事:比如 Result<u8, !> 的错误分支不可能存在,match 就可以省掉那个分支;而且由于这个枚举实际上只剩一个变体,还能用上顺眼的不可反驳析构赋值写法 let Ok(foo) = blah();。)

也有人提醒,这个类型其实早就在了,只是以前不许你点名它:

“It has existed as a real type for a very long time (I believe in the beginning it really wasn't a real type but that's a long time ago), you just weren't allowed to name it. There was also an (unsupported) hack that allowed you to use it on stable.” — afdbcreid [c:50474464] (译文:它作为一个真正的类型已经存在很久了(我记得最早那会儿它其实不算真类型,但那是很久以前的事了),你只是不被允许给它起名字。另外还有一个不被支持的hack,能在 stable 上用上它。)

二、Stable ABI:每年重复的那声叹息

1.100 的功能清单很长,但评论区第一条实质回复就指向了那个不在清单里的东西:

“Nice work… but I still yearn for a stable ABI!” — pmichaud [c:50472075] (译文:干得漂亮……但我还是想要一个稳定的 ABI!)

这句几乎是每年 Rust 发布日的固定节目,下面立刻有人给出当前的「替代品」:

“We have it: unsafe extern "C" { }.<p>An actual stable native Rust ABI sounds like a forward compatibility nightmare.” — orlp [c:50472190] (译文:我们有啊:unsafe extern “C” { }。真要有一个原生的稳定 Rust ABI,听起来倒像前向兼容的噩梦。)

为什么这么难?Rust 核心成员 JoshTriplett 给了最完整的答案——难点不在调用约定,而在泛型:

“The primary challenge in having a stable ABI is that we have generics. So, even if we never changed the calling conventions, an ABI is not as simple as exporting a symbol with the right name. … Essentially, you wouldn't be able to have a Vec&lt;T&gt; in your ABI without either pinning down T or using something like Vec&lt;Box&lt;dyn Trait&gt;&gt;. Which is possible, but kind of awful.” — JoshTriplett [c:50473008] (译文:有稳定 ABI 的主要难点在于我们有泛型。所以即便从不改动调用约定,ABI 也不只是「用正确的名字导出一个符号」这么简单。……本质上,你没法在 ABI 里放一个 Vec<T>,除非把 T 钉死,或者用类似 Vec<Box<dyn Trait>> 的写法——这做得到,但挺难看的。)

另一位 Rust 核心成员 kbolino 补了编译器依赖的信息量问题:

“You can marshal values, but you can't marshal lifetimes, ownership, (lack of) thread-safety, (lack of) side-effects, etc. The ABI carries far less information than the Rust compiler relies on. Thus, any FFI call is inherently unsafe. It takes you, the programmer, with knowledge the compiler doesn't have and the architecture doesn't provide, to determine whether the code as you use it actually is safe or not.” — kbolino [c:50474227] (译文:值可以编组,但生命周期、所有权、(不)线程安全、(不)有副作用这些没法编组。ABI 承载的信息远少于 Rust 编译器所依赖的信息。所以任何 FFI 调用本质上都是 unsafe 的:得靠你——程序员——用编译器没有、架构也不提供的知识,去判断你这样用到底安不安全。)

「但用 C ABI 太难看了」的抗议也很具体。gspr 想要的是能原样传递的切片:

“Well yes, but then your interface is a C ABI. That's fantastic if the side using my library is any language where C is the only common ground. When the application side is Rust though, it leaves a lot to be desired. It would be delicious to actually interface in a way that respects Rust!<p>Hell, even if all exposed functions and types would need to be fully monomorphized at the interface, it would be a lot nicer to pass a &amp;&#x27;a [i64] rather than a const * int64_t together with a size_t n and have to marshall the slice on both sides.” — gspr [c:50472790] (译文:是啊,但那样你的接口就是 C ABI。如果用你库的那边是任意语言、C 是唯一共同点,那确实很棒;但当应用那边也是 Rust 时,就很不得劲了。能不能以一种尊重 Rust 的方式来互操作,那才叫享受——哪怕接口上的所有函数和类型都得完全单态化,能直接传一个 &'a [i64],而不是传 const * int64_t 加一个 size_t n 再在两边编组切片,也会好得多。)

反对派的态度则更干脆。afdbcreid 认为这条路基本走不通:

“Rust will almost certainly never have a stable ABI by default, and libraries will continue to be compiled from source by default. It might one day have an opt-in stable ABI.” — afdbcreid [c:50472944] (译文:Rust 几乎肯定不会有默认的稳定 ABI,库默认仍然从源码编译。将来或许会有一个需要主动选择的稳定 ABI。)

danhor 拿 C++ 当反面教材:

“I don't think a stable ABI has enough advantages to be worth it. C++, IMHO, is a great examples of the downsides of a stable-enough ABI, where stability was never guaranteed, but is now so entrenched that it'll likely never be broken again (limiting the language & the usability in a bunch of ways).<p>It might make sense to have a subset Swift-style stable ABI, but that's a huge engineering effort, has lots of overhead and is also likely not worth it IMHO.” — danhor [c:50473661] (译文:我认为稳定 ABI 的好处不足以值得去做。在我看来 C++ 正是「足够稳定的 ABI」弊端的绝佳例子:稳定性从来没被正式保证过,但现在已经根深蒂固到几乎永远不会被打破(这在很多方面限制了语言本身和可用性)。也许搞一个 Swift 式的稳定 ABI 子集说得通,但那是巨大的工程量、开销很大,而且依我看也不值得。)

真正想要稳定 ABI 的理由,往往落在发行版和运维上。cogman10 的场景是 tokio 出 CVE:

“Operating systems.<p>If there's a CVE in tokio, the OS could theoretically publish a patched version of tokio and all apps that depend on that end up using the fixed code.<p>As it stands now, the OS needs to publish updated versions of all rust apps that depend on tokio.” — cogman10 [c:50474074] (译文:操作系统。假如 tokio 有 CVE,理论上操作系统可以发布一个打过补丁的 tokio 版本,所有依赖它的应用就会用上修复后的代码。而现在,操作系统得为每一个依赖 tokio 的 Rust 应用发布更新版本。)

这场对话中途还拐出了一次「挪门柱」的小争论:一方追问「所以到底为什么要 ABI 稳定」,另一方把话题转到了「现在几乎没人通过操作系统分发软件」,于是前者把整条线拉了回来:

“Let me rewind this to the top of the thread. … The topic was "why would you want ABI stability". And the answer is that if I wanted to rewrite coreutils in rust, then it'd be really useful to have synchronized crates with a stable ABI so I could potentially update those crates independent of the apps that depend on them.” — cogman10 [c:50476683] (译文:我把这条线拉回帖子开头。……话题是「为什么你想要 ABI 稳定」。答案是:如果我想用 Rust 重写 coreutils,那么有一套带稳定 ABI、能同步更新的 crate 会非常有用,这样我就能独立于依赖它们的那些应用去更新这些 crate。)

被指「挪门柱」的一方随后认了一半:

“I agree that sometimes other languages are packaged this way as well, and maybe I was moving the goalposts. My original meaning was that only for C/C++ (on Linux) the recommended method of distribution is via the OS, while other languages have their own mediums (not requiring stable ABIs). So when they are packaged like that that's mostly because the OS itself or its services need them.” — afdbcreid [c:50476777] (译文:我同意有些语言确实也这么打包,也许我确实在挪门柱。我原来的意思是:只有 C/C++(在 Linux 上)推荐的发行方式才是走操作系统,其他语言有自己的渠道(不需要稳定 ABI)。所以它们之所以那样打包,多半是因为操作系统本身或它的服务需要它们。)

三、依赖冷却:供应链安全与补丁速度的拉扯

min-publish-age 是这一版最容易被误读、也最有争议的特性。SOLAR_FIELDS 一句话点出了它今年的处境:

“Dependency cooldowns receiving such a whiplash this year. Earlier everyone was advocating for them because of the supply chain attacks. Now, people are worried because you might miss 0 days if you use them.<p>Nonetheless, the ability to set and configure it is a welcome feature.” — SOLAR_FIELDS [c:50476790] (译文:依赖冷却在今年算是坐了一回过山车。年初大家还在因为供应链攻击而提倡它,现在人们担心的却是:用了它就可能错过 0 day 修复。不过,能设置和配置这个能力本身仍是受欢迎的。)

woodruffw 给出的方案是别把两件事对立起来:

“You should do both: you should let normal updates cool down, and you should immediately patch security advisories.<p>One of the biggest ergonomic problems with cooldowns is that many tools let the former goal obstruct the latter. Both should be part of the state machine of resolution itself, rather than things that get layered on.” — woodruffw [c:50477439] (译文:应该两件事都做:让常规更新冷却,同时立刻打上安全公告的补丁。冷却最大的体验问题之一,是很多工具让前一个目标挡住了后一个。这两件事应该都是解析状态机本身的一部分,而不是后贴上去的附加层。)

zarzavat 的判断更直接——两害相权取其重:

“You should use a cooldown. The effects of a supply chain attack are significantly worse than the effects of a 0 day. You can always make exceptions on a case-by-case basis.” — zarzavat [c:50477955] (译文:你就该用冷却。供应链攻击的后果远比 0 day 严重。真有需要,逐个开例外就行。)

而 saghm 记下了一个更有意思的循环:

“Some of us were saying they didn't understand the endgame of everyone using cooldowns at the time. We mostly got told we were wrong though.” — saghm [c:50477345] (译文:当初我们中有些人说看不懂「所有人都用冷却」的终局会是什么,结果我们多半被告知是我们错了。)

四、Cargo 的新 lint,撞上了一个 Claude session

未使用依赖报告的第一反应很朴素:

“Does this remove the need for machete or shear?” — jtwaleson [c:50473921] (译文:那还需要 machete 或者 shear 吗?)

Cargo 团队的 epage 确认了方向,并说明了限制:

“I believe so. The maintaner of cargo-udeps did most of the work as an effort to upstream it.<p>The main limitation is in dev-dep detection since there isn't a way to exhaustively run everything that uses dev-deps yet. You can look at logging statements to get an approximation though.” — epage [c:50474333] (译文:我认为是的。cargo-udeps 的维护者做了大部分工作,目的是把它上游化。主要限制在 dev-dependency 的检测上,因为目前没有办法把所有用到 dev-dependencies 的东西都跑一遍。不过可以看日志语句来大致推断。)

真正引爆讨论的是一个用户故事。有人把升级和清理放在同一个 agent 会话里做:

“I updated to 1.100 during a Claude session and it complained about new warnings, so I told it to fix them. It removed a large number of unused dependencies without issue.” — minimaxir [c:50473354] (译文:我在一个 Claude 会话里升到了 1.100,它抱怨出现了新警告,于是我让它去修。它毫无问题地删掉了大量没用到的依赖。)

然后这条评论被大量点了踩,本人有点懵:

“I am legitimately confused why my parent comment is being mass downvoted: the point I was making is that this is change is more a perk for agent use with Rust since agents typically will resolve warnings by solving the issue (and therefore proactively remove redundant dependencies)” — minimaxir [c:50477270] (译文:我真的不理解为什么我那条父评论被集体点踩:我想表达的是,这个改动对 Rust 来说更像是给 agent 用的好处,因为 agent 通常会通过解决问题来消除警告(于是顺带把冗余依赖清掉)。)

被点踩的那位并没有否认自己踩了:

“fwiw my immediate reaction (I didn't downvote) to your comment was "no one asked".” — yuriks [c:50477478] (译文:顺便说一句(我没有点踩)我看到你那条评论的第一反应是「没人问这个」。)

但把这件事往大了说的,是 saghm 的 agent 工程学:

“My semi-controversial take is that the best way to use agents for Rust is to literally turn every possible lint and warning on in clippy and require that they're treated as blocking for the agent to fix before ever saying things are done. While a few of them might be overzealous and feel tedious to work around manually, there's no need to care about it being tedious for an agent!” — saghm [c:50477372] (译文:我这个有点争议的看法是:用 agent 写 Rust 的最佳方式,就是把 clippy 里所有可能的 lint 和警告全部打开,并且要求 agent 在宣布完成之前必须先把它们修好。有几条可能过于吹毛求疵、手工处理起来很烦,但对 agent 来说根本不需要在乎麻不麻烦!)

这个故事的收尾来自 Cargo 团队本身:

“I shared your anecdote with another Cargo team member who helped work on this feature. We appreciate seeing how what we made helped people!” — epage [c:50478301] (译文:我把你的这段经历分享给了另一位参与这个特性的 Cargo 团队成员。我们很高兴看到我们做出来的东西帮到了人!)

五、bool::toggle:一个连老手也会卡一下的小 API

稳定 API 列表里的 bool::toggle 单独开了一小段讨论。最初的困惑很直白:

“I'm at a loss with the bool toggle method. Why would x = !x not be good enough?” — jacksontheel [c:50474903] (译文:我完全想不通 bool 的 toggle 方法。写成 x = !x 不行吗?)

答案居然是「路径太长的时候」:

“If you access the bool through a long path maybe.<p><pre> foo.bar().baz[expensive()].qux.toggle();</pre>” — IshKebab [c:50474996] (译文:也许当你通过一条很长的路径访问这个 bool 时。(代码:foo.bar().baz[expensive()].qux.toggle();))

但社区里显然有人连这个都没绕过来:

“For someone who has decades of experience from other programming languages this does not look clear to me at all but rather confusing. Calling an method can change value of variable of primitive type?” — rauli_ [c:50475354] (译文:对一个在别的编程语言里积累了几十年经验的人来说,这在我看来完全不清楚,反而让人困惑。调用一个方法能改变一个原始类型变量的值?)

zdimension 把 Rust 的方法调用规则讲了一遍,这大概是全篇最实用的一段解释:

“When you call a method on something in Rust, the method gets passed that something (as a parameter called self). But the method gets to choose whether it's by move/copy or by reference. Here, toggle gets the bool passed by mutable reference.<p>In effect, if x is a bool, doing x.toggle() is rewritten by the compiler as bool::toggle(&mut x), which can of course modify x.” — zdimension [c:50475695] (译文:在 Rust 里对某个东西调用方法时,这个东西会被作为参数(名为 self)传给方法。而方法可以自己选择是按 move/copy 还是按引用来接收。这里 toggle 拿到的是以可变引用传入的 bool。实际上,如果 x 是 bool,x.toggle() 会被编译器改写成 bool::toggle(&mut x),当然就能改掉 x。)

六、其余改动,以及发布节奏本身

cargo install 的行为变更很小,却是评论区少见的一致好评。nixpulvis 等了这条很久:

“> cargo-install: now uses the existing lockfile in the .crate tarball by default. –locked in cargo install becomes a no-op. #17388<p>Long time follower of this. Very grateful it's been implemented.” — nixpulvis [c:50474219] (译文:(引用变更说明:cargo-install 现在默认使用 .crate 压缩包里已有的 lockfile,cargo install 的 –locked 变成空操作。#17388)我长期关注这件事,非常感谢它被实现了。)

p-e-w 补上了它为什么重要:

“That was one of the biggest gotchas with Rust. It’s unfortunate that it took so long to change this very unintuitive and potentially dangerous behavior.” — p-e-w [c:50476723] (译文:那是 Rust 最容易踩坑的地方之一。很遗憾,这个既反直觉又可能有危险的行为,改动来得这么晚。)

分配器 API 的转正,则有人赶上了自己的工期:

“Awesome timing.<p>I just spent last few days fixing arena leaks (Bumpalo doesn't call drop) and had to use allocator-api2 for Vec::new_in which is now available in stable Rust.” — lukax [c:50472184] (译文:时机太巧了。我刚花了几天修 arena 泄漏(Bumpalo 不会调用 drop),不得不借助 allocator-api2 来用 Vec::new_in——而它现在在 stable Rust 里已经可用了。)

最后是关于发布节奏本身的感慨。11 年 100 个小版本,这个数字让人有点恍惚:

“The six week release cadence means that stuff like this is not a huge deal, and it's honestly kind of insane how consistent it's been over what's now 100 minor releases over 11 years!” — saghm [c:50477572] (译文:六周一次的发布节奏意味着这种事不算大事,但说真的,在如今 11 年 100 个小版本、而且一直这么稳定这件事上,还是有点离谱。)

而关于这个版本到底算不算「大」,steveklabnik 前后说了两句:

“A monumental release. Thanks to everyone who worked so hard on all of these long-term features that are finally landing.” — steveklabnik [c:50472246] (译文:一个里程碑式的版本。感谢所有为这些终于落地的长期特性付出巨大努力的人。)

“I know that's a meme but this actually is a really huge release.” — steveklabnik [c:50478091] (译文:我知道这是个梗,但这实际上是个非常重大的版本。)

当然,同一天 HN 首页还挂着别的大新闻,Rust 版评论区立刻串了场:

“wait other things not named jensen happened today? whoa” — fallingmeat [c:50472091] (译文:等等,今天还有不是以 jensen 命名的别的事发生?哇。)

而 cluster 里的关联帖——也就是那条先发的 GitHub release tag 链接——评论区还留着一次失败的 @ 版主:

“This site doesn't even fully support Markdown or Unicode and people think for some reason that Twitter-style username tagging will actually work. U+1F923” — arcanemachiner [c:50473188] [thread 2] (译文:连 Markdown 和 Unicode 都不完全支持,你们却总觉得那种推特风格的 @ 用户名提及能生效。)

典型观点一览

立场 用户 一句话
十年终成正果 karavelov 终于,never 发生了
玩笑可以收场 JoshTriplett 以稳定化日期命名的梗到此为止
一行讲清语义 yccs27 作用域里有 x: !,后面的代码永远到不了
用集合论讲类型 Xirdus never 是空集,因而是所有类型的子类型
重点在模式匹配 kibwen Result<u8, !> 可以省掉错误分支
类型早就存在 afdbcreid 只是以前不许你给它起名字
年年都想要 pmichaud 干得漂亮,但还是想要 stable ABI
C ABI 不够用 orlp 我们有 unsafe extern “C” {}
难点是泛型 JoshTriplett ABI 不是导出一个符号那么简单
ABI 承载的信息不够 kbolino 生命周期和所有权没法编组
想要原样传切片 gspr 传 &'a [i64] 比 const * int64_t 好
默认不会有 afdbcreid 也许将来会有 opt-in 的稳定 ABI
C++ 是前车之鉴 danhor 稳定性一旦根深蒂固就再也改不动了
发行版运维需求 cogman10 tokio 出 CVE 时,OS 该能单独修 crate
认了一半 afdbcreid 也许我确实在挪门柱
冷却是双刃剑 SOLAR_FIELDS 今年它从被追捧变成被担心
两件事都要做 woodruffw 常规更新冷却,安全补丁立刻打
取舍很明确 zarzavat 供应链攻击比 0 day 严重得多
当初被告知错了 saghm 我们问过终局,答案是我们错了
工具是否被取代 jtwaleson 还需要 machete 或 shear 吗
上游化有前提 epage dev-dependencies 仍无法穷举检测
agent 是最大受益方 minimaxir 在 Claude 会话里升级,顺手清掉一堆依赖
「没人问这个」 yuriks 我的第一反应就是这句
lint 全开给 agent saghm 手工觉得烦的事,agent 不在乎
官方接住了这个故事 epage 已转给参与该特性的 Cargo 同事
toggle 到底为了啥 jacksontheel x = !x 不行吗
长路径才需要 IshKebab foo.bar().baz[…].qux.toggle()
跨语言老手困惑 rauli_ 调用方法能改原始类型变量的值?
Rust 的 self 规则 zdimension 编译器把 x.toggle() 改写成 bool::toggle(&mut x)
cargo install 早该改 nixpulvis 长期关注,非常感谢终于实现
旧行为确实危险 p-e-w 反直觉又有风险,改得太晚
撞上工期 lukax 刚修完 arena 泄漏,Vec::new_in 就 stable 了
节奏本身就是成就 saghm 11 年 100 个小版本,稳定得离谱
争议版本的定性 steveklabnik 这实际是个非常重大的版本
首页不只有 Rust fallingmeat 今天还有不是 jensen 命名的别的事?

总体情绪

讨论的底色是「等了十年终于等到」的释放感,但真正被反复咀嚼的不是 never type 本身,而是它背后那条拖了更久的线。never 类型从第一次提案到稳定化尝试了五次、熬了十年,最终靠的是把 Infallible 改成别名这种看似取巧的收尾;而 stable ABI 连一个时间表都排不出来,因为它卡在泛型上——Vec<T> 无法在 ABI 里原样表达,于是每一次关于 ABI 的讨论都会绕回同一个结论:稳定 ABI 也许永远不会成为默认选项。

而这一版真正让人坐直的不是类型系统,是 Cargo。依赖冷却把一个长期摇摆的工程判断写进了配置:供应链攻击的后果更严重,但冷却会挡住 0 day 修复——woodruffw 提出的「两件事都该进解析状态机本身」比任何一方的口号都更接近正确答案。另一头,一个用户顺手把升级和清理放进同一个 agent 会话,Cargo 团队把这段经历转给了参与该特性的同事。一边在争论安全窗口该多长,一边在演示 lint 报告如何直接喂给 agent,两者指向的是同一个现实:Rust 的工具链正在被一批新的使用者重新定义优先级。

发布时间也值得记一笔。11 年 100 个小版本、六周一版,这种稳定本身就是一种成绩;而这个版本又同时塞进了 never type、Allocator trait、DropGuard、ZST 构造器和依赖冷却五件大事。评论区里那句「等下一个版本,那会是一份圣诞礼物」,大概是对这套发布节奏最贴切的期待方式。

引用帖子

# 标题 URL
1 Rust 1.100(HN 主帖,官方博客链接) https://news.ycombinator.com/item?id=50472038
2 Rust 1.100(HN 关联帖,GitHub release tag 链接) https://news.ycombinator.com/item?id=50471793
3 原文:Announcing Rust 1.100.0(Rust 官方博客,2026-11-12) https://blog.rust-lang.org/2026/11/12/Rust-1.100.0/
4 详细发布说明:Rust 1.100.0 https://doc.rust-lang.org/stable/releases.html#version-11000-2026-11-12
5 项目目标:stabilize never type https://goals.rust-lang.org/2026/stabilize-never-type.html
6 项目目标:Allocators 1.0 https://goals.rust-lang.org/2026/allocators-1.0.html
7 跟踪 issue:allocator_api(#32838) https://github.com/rust-lang/rust/issues/32838
8 标准库文档:never type https://doc.rust-lang.org/stable/std/primitive.never.html
9 PR:Result::into_ok / Result::into_err(#161712,1.101 通道) https://github.com/rust-lang/rust/pull/161712
10 讨论:cargo install 与 lockfile(cargo#7169) https://github.com/rust-lang/cargo/issues/7169#issuecomment-4421296987
11 提案:bool::toggle(libs-team#820) https://github.com/rust-lang/libs-team/issues/820
12 RFC:minimal crABI https://github.com/joshtriplett/rfcs/blob/crabi-v1/text/3470-crabi-v1.md
本摘要由 AI 辅助生成,基于 HN 归档评论(主帖 541 分、220 条评论,归档抓取于 2026-11-12 23:17 UTC,入库 123 条评论;关联帖 308 分、9 条评论,入库 9 条)。引文后的 `[c:]` 为对应 HN 评论 ID,可在原帖页搜索定位;引文文本与作者已与归档评论逐条比对。归档评论的分数字段均为 0(HN 未返回评论分),引文选择依据为内容本身与讨论价值而非评论分数。本文关于 1.100.0 功能清单(never type、`Allocator` API、`DropGuard`、`std::mem::conjure_zst`、Cargo 未使用依赖报告、构建目录缓存冲突、min-publish-age)的叙述,依据 Rust 官方博客发布公告原文(已重新抓取核对)与归档文章内容;公告中标注为「少数场景可能受影响」的 never type fallback 破坏性变更、以及 min-publish-age 的已知例外(无 `pubtime` 字段的版本、`cargo install` 不适用),本文按公告原文照录。stable ABI 相关讨论中的具体观点(如 `Vec` 在 ABI 中的表达、发行版统一分发 crate 的可行性)均为评论者个人意见,本站未做独立核实。

本摘要由 AI 模型辅助生成:minimax-cn-coding-plan/MiniMax-M3 </div>