External Publication
Visit Post

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

Rust Internals [Unofficial] May 17, 2026
Source

I now get that you're trying to make a tool for reducing the likelihood of (accidentally) intermixing references and raw pointers. I do think it's worth noting that, AFAICT, the warning "don't mix accesses between references and raw pointers" is very common. It doesn't seem anywhere near to being the most complicated part of the aliasing rules, so I'm not sure that this tool has a good target audience.

People who haven't even heard this warning should probably learn much more about the aliasing rules before writing unsafe pointer manipulation; meanwhile, for people who do already know the warning, I'm not sure that pulling in a dependency for this is worth it.

Instead...... how hard would it be to make a clippy lint for intermixed pointer and reference accesses? Is this something which we can programmatically look for in a sufficient variety of simple cases? (Or is Miri considered good enough for any case that matters?)

Discussion in the ATmosphere

Loading comments...