News for hackers. Stuff that matters.
Re:11 year old unsoundness bugs found in Rust borrow checker by afdbcreid on Tuesday October 13, 2026 @09:29AM (#50071426)
I can't tell if you are sarcastic, but in case you are not:

By Rice's theorem you cannot be sound and complete, i.e. accept all valid programs and reject all invalid ones. Most languages choose to be sound but not complete, i.e. reject all invalid programs but also some valid ones (C and C++ are the notable exception, although most languages have escape hatches). GP was saying that the fix might reject valid programs that compile today. This is true for some existing soundness bugs, but not necessarily for this one specifically.

Re:11 year old unsoundness bugs found in Rust borrow checker by bluGill on Tuesday October 13, 2026 @11:26AM (#50073233)
Rice's theorem does not apply. This is not about what the compiler does, it is your program. If your program is not sound then it is invalid Rust even if the compiler accepts it and it seems to do the right thing.

That said, I was sarcastic.

Re:11 year old unsoundness bugs found in Rust borrow checker by afdbcreid on Tuesday October 13, 2026 @11:50AM (#50073651)
It does apply, of course (even if not to this case specifically). The implemented Rust semantics are not sound, as evidenced by this issue. We need to find (or adjust) sound semantics. Which, mathematically, is equivalent to designing Rust from scratch (ignoring things like RustBelt because they did not formalize the entire system). Due to Rice's theorem we know we need to give up some sound programs. Can we give up exactly the programs we already gave up for the previous Rust? Maybe, maybe not.
Re:11 year old unsoundness bugs found in Rust borrow checker by Someone on Tuesday October 13, 2026 @12:54PM (#50074834)
> The implemented Rust semantics are not sound, as evidenced by this issue. We need to find (or adjust) sound semantics.

You’re ignoring the possibility that Rust semantics are sound, and the implementation doesn’t fully implement them. In that case, we do not have to find sound semantics.

That, I think, by far is the most likely option.

Reason: I’ve not seen a single comment claiming the example should compile, and zillions (implicitly) acknowledging this is not what Rust should do.

Re:11 year old unsoundness bugs found in Rust borrow checker by afdbcreid on Tuesday October 13, 2026 @01:10PM (#50075141)
I explicitly did not ignore the option that there are possible sound semantics:

> but not necessarily for this one specifically

> Maybe, maybe not.

But "the Rust semantics" are not defined, formally. The closest we have is what Rust implements currently, and that was shown here to not be sound. Other than that, we maybe have vague ideas in the brains of some T-types members, which are not detailed enough to determine soundness (source: those type system people want to formalize the semantics so they will be).

And for the record, we know of other soundness issues where the likely resolution path will involve rejecting valid programs we accept now, and the only question is how many.

Re:11 year old unsoundness bugs found in Rust borrow checker by bluGill on Thursday October 15, 2026 @11:06AM (#50104786)
"the Rust semantics" are defined informally as sound. Anything that the implementation accepts that is unsound is a bug. We might never be able to prove the rust implementation, and may forever find loop holes, but informally it is sound and that is the intent.
Re:11 year old unsoundness bugs found in Rust borrow checker by afdbcreid on Sunday October 18, 2026 @01:34PM (#50143299)
There is no such thing as "informally sound". Soundness is a mathematical property and needs to be proven mathematically. For that, you first need a mathematical definition.
Re:11 year old unsoundness bugs found in Rust borrow checker by i2talics on Tuesday October 13, 2026 @12:55PM (#50074858)
The tricky thing about formalization is that you usually have to reimplement the type checker into a proof assistant in order to do formal soundness proofs. It's not necessarily clear that this reimplementation is identical to the actual Rust compiler (in fact, you often have to massively simplify the type system to make the proofs tractable), so bugs in implementation can cause unsoundness without being related to fundamental flaws in the soundness of the type system.
Re:11 year old unsoundness bugs found in Rust borrow checker by afdbcreid on Tuesday October 13, 2026 @01:12PM (#50075187)
Indeed. Proving the implementation will likely never be done, it's just way too hard. But proving Rust abstract semantics are sound will by itself be a major leap forward (RustBelt did that for a subset of Rust).
Re:11 year old unsoundness bugs found in Rust borrow checker by Permik on Tuesday October 13, 2026 @12:55PM (#50074860)
It could be that I'm totally yapping bullshit, but the "designing from scratch" can vary depending which field of maths you're talking about. For instance, if we model the semantics as a series of composable functions, then you only have to scratch only the specific dependency tree of the functions. Basically everything can be reused with no wasted work, and the output space gets culled.
Re:11 year old unsoundness bugs found in Rust borrow checker by afdbcreid on Tuesday October 13, 2026 @01:11PM (#50075167)
Which is why I said to ignore RustBelt. Because we don't have formal semantics today, we only have the actual implementation which is not composable.
Re:11 year old unsoundness bugs found in Rust borrow checker by i2talics on Tuesday October 13, 2026 @12:52PM (#50074810)
Terminological nitpick, but soundness is a property of an entire type system not of an individual program. A type system is sound if it only accepts valid programs. A program is valid if it never exhibits undefined behavior.

Rice's theorem implies that it's impossible to precisely distinguish valid and invalid programs just by looking at their source code. Thus Rust rejects some valid programs in order to be sound (e.g. "if false { None.unwrap_unchecked() }").

In the case of the bug report in OP, I don't think that there are many valid programs in practice that exploit this soundness issue, so fixing it just means rejecting more invalid programs.

Re:11 year old unsoundness bugs found in Rust borrow checker by charcircuit on Tuesday October 13, 2026 @11:33AM (#50073347)
Rust does not target Turing machines so Rice's theorem does not apply.