External Publication
Visit Post

Reducing Raw Pointer Footguns: Preventing Reference Aliasing Violations at Compile Time

Rust Internals [Unofficial] May 17, 2026
Source

fuji-184:

Maybe the safest usage of it is the Clippy check command to only give messages not edit

Oh, yeah, absolutely. I use neither cargo clippy --fix (I think that's the command?) nor even cargo fmt (I may agree with the linter, but I disagree with the formatter).

Plus, the immediate /direct problem found by clippy may be a symptom of the actual problem. Applying patchwork fixes to the direct problems won't actually fix the code in those cases, no matter how correct those patchwork fixes may or may not be.

fuji-184:

Anyway, do you have any technical feedback? For example, what kinds of code would not work with this guard?

I think there's large enough escape hatches that anything could work with the guard, but maybe not well. Either way... I probably know the aliasing rules well enough that I'm not the target audience to begin with.

Discussion in the ATmosphere

Loading comments...