|
|
Log in / Subscribe / Register

Rust and UB

Rust and UB

Posted Aug 14, 2024 22:41 UTC (Wed) by khim (subscriber, #9252)
In reply to: Rust and UB by deltragon
Parent article: Standards for use of unsafe Rust in the kernel

That's why I said that that's oversimplification, not a mistake.

> I understood this as "the Rust compiler developers and language designers, as a group, don't want to be adversaries".

That's correct interpretation, but it's important to remember that there is an adversary and said adversary is precisely the Rust compiler.

It's just the nature of the beast, we don't know how to build an optimizing compiler that wouldn't try to destroy programs with UB.

The only way to tame it is to never let it find an UB to exploit in your program. And the simplest way to achieve that is to ensure that your program doesn't include any UBs in the first place.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds