External Publication
Visit Post

Include racy reads in Rust memory model with `MaybeInvalid<T>`

Rust Internals [Unofficial] May 13, 2026
Source

josh:

Is this the kind of "can't" where it actually works just fine in practice but compilers don't guarantee it despite that?

In C, func(i++, i++) may work in practice with gcc, but switching to clang gives another result. Hopefully, it is not the case for SeqLock implementations but, like my short snippet, most of them still rely on undefined behavior at language level. And relying on UB, while sometimes working in practice, is not something we want to keep in the Rust/C++/C ecosystem, especially regarding well-known and used primitives like SeqLock.

Discussion in the ATmosphere

Loading comments...