Rust and UB
Rust and UB
Posted Aug 14, 2024 18:22 UTC (Wed) by josh (subscriber, #17465)Parent article: Standards for use of unsafe Rust in the kernel
In general, in Rust, we're trying very hard to *not* make things UB when they actually have well-defined behavior. When we *do* have to define something as UB, it's often *actually a hazard* rather than being something generally reasonable to ignore.
(There *are* exceptions to this, notably cases where LLVM has forced our hand by making it impossible for us to guarantee behavior we might otherwise wish we could guarantee.)
+1 for Benno Lossin's comments that if there's something the kernel needs we should figure out how to provide that. The Rust compiler doesn't want to be an adversary.
