News for hackers. Stuff that matters.
Re:11 year old unsoundness bugs found in Rust borrow checker by devmor on Tuesday October 13, 2026 @09:11AM (#50071156)
> If a compiled safe Rust program has unsound behavior, the compiler needs to be fixed

Can you provide an example of such a program that can’t be fixed at the program level like a C++ example?

Re:11 year old unsoundness bugs found in Rust borrow checker by _flux on Tuesday October 13, 2026 @09:13AM (#50071190)
Sure, usually the program can be changed to avoid the issue, but the key here is that the Rust compiler is wrong and needs to be fixed. Once fixed, the actual program fix also falls in place, as it cannot be compiled anymore.
Re:11 year old unsoundness bugs found in Rust borrow checker by samus on Tuesday October 13, 2026 @11:44AM (#50073546)
That's the same kind of issue like a bug in a C++ compiler.
Re:11 year old unsoundness bugs found in Rust borrow checker by remexre on Tuesday October 13, 2026 @12:20PM (#50074201)
The average cause of unsoundness in a C++ program is not a C++ compiler bug
Re:11 year old unsoundness bugs found in Rust borrow checker by samus on Tuesday October 13, 2026 @03:23PM (#50077196)
This is about an issue in the type checker, which would lead to unsoundness also in a C++ program. And also in Rust most causes of runtime failures are actually things that happen in `unsafe` blocks.
Re:11 year old unsoundness bugs found in Rust borrow checker by carlmr on Friday October 16, 2026 @04:51AM (#50115862)
Yes, we're discussing though in safe (non-unsafe/normal) Rust here. There is no safe C++, everything in C++ is unsafe by default. Even more unsafe than Rust unsafe, because Rust unsafe still does a lot of the safety measures of normal Rust, but allows only a handful extra things and doesn't disable the borrow checker:

https://doc.rust-lang.org/book/ch20-01-unsafe-rust.html

But getting back to the point, the C++ compiler doesn't have a borrow checker, so it can't have a bug in it. So it's on you, as the developer, to take care of all unsoundness.

While in Rust an issue is now filed, and with the fix, every future Rust program gets the fix.

Re:11 year old unsoundness bugs found in Rust borrow checker by samus on Tuesday October 20, 2026 @04:14PM (#50172024)
[delayed]
Re:11 year old unsoundness bugs found in Rust borrow checker by devmor on Tuesday October 13, 2026 @11:17PM (#50081971)
That’s not an example, that is you restating your post.
Re:11 year old unsoundness bugs found in Rust borrow checker by _flux on Wednesday October 14, 2026 @03:18AM (#50083652)
I don't find that anyone made a claim that the program could not be fixed. Why are you suggesting to find a proof of this?

The point of course was not that what you can do, but what you should do. All cases of safe Rust compiler producing unsound code should be fixed, but the same argument is more difficult to make for C++.

Sometimes should might be different of what you must. For example, if your program exhibits unsound behavior in safe Rust (or C++) code, it's probably a lot more practical to just change the program so that it doesn't, instead of updating the compiler, unless you happen to be a Rust compiler developer. But, at the same time, you should file an issue about it.

You can of course find C++ compiler bugs as well, although I expect that to be quite rare nowadays. But the typical case is that if a C++ program exhibits unsound behavior, there is no reasonable compiler fix for it.

Then there's of course Fil-C! This improves the situation greatly by converting most interesting cases of unsound behavior into runtime errors. It seems not everyone is happy with the runtime costs of making this happen, though. And you must compile everything with Fil-C. It doesn't work with Windows or MacOS either.

Re:11 year old unsoundness bugs found in Rust borrow checker by devmor on Wednesday October 14, 2026 @07:36AM (#50086056)
Your shoulds and musts are nice and all but you said that in these situations, the rust compiler needs to be fixed when the C++ program can be adjusted.

I simply cannot imagine a situation where you can’t find an alternate solution to a problem with the compiler. Even if the compiler would optimize your intended solution away, you can write an asm! macro.

It sounds to me like you have simply decided that one language cannot do what the other can because you personally would not do it, which is very silly.

If this is not the case then I restate my request for an example, for the third time - an example would prove the point you are not making through explanation.

Re:11 year old unsoundness bugs found in Rust borrow checker by _flux on Wednesday October 14, 2026 @07:51AM (#50086213)
I suggest you point the exact statement where I claimed the corresponding safe Rust program is impossible to fix to avoid unsound behavior.

I hold the argument that if the Rust compiler produces unsound behavior for safe Rust, then the compiler needs to be fixed.

Re:11 year old unsoundness bugs found in Rust borrow checker by devmor on Wednesday October 14, 2026 @01:43PM (#50091756)
The original comment I replied to, in which you claimed that the difference between a safe Rust and C++ program with unsound behavior is that the C++ program needs to be fixed, but for the Rust program, the compiler needs to be fixed.

As I see it, in either case, the program can be fixed, or the compiler can be fixed. The only difference as I see it is that the C++ spec does not expect the compiler to be fixed.

Did I misunderstand your post?

Re:11 year old unsoundness bugs found in Rust borrow checker by _flux on Wednesday October 14, 2026 @03:45PM (#50093938)
I would say as stated there were two ways to read the claim:

- either that the claims are paired as you say (the second one implying that the program cannot be fixed),

- or that the claims are completely distinct, that simply state the desirable state of things.

Using the second interpretation, the corollaries would be:

- there is (typically) no reasonable fix for the C++ compiler that would address the UB. Therefore to fix the UB all C++ programs exhibiting the same need to be fixed, which is hard, as the compiler will keep accepting them.

- once the Rust compiler is fixed, then all safe Rust programs exploiting the bug must now be fixed, or the compiler will reject them.

What I would sign under would be the second interpretation, not the first one. But I intentionally also selected the particular ambiguous form due to the cutesy, albeit misleading, symmetry of the statements.

Re:11 year old unsoundness bugs found in Rust borrow checker by devmor on Wednesday October 14, 2026 @06:15PM (#50096203)
I understand and do agree with you following your intended interpretation. Thank you for the patience and explanation.