3 ms·
Miri is an interpreter, and so it works dynamically. Think ubsan. > why can't we look at the AST and see that a and b alias? The exact aliasing rules for raw
by steveklabnik 8y ago
Miri is an interpreter, and so it works dynamically. Think ubsan.
> why can't we look at the AST and see that a and b alias?
The exact aliasing rules for raw pointers are under discussion at the moment. We may be able to look at the AST in this case, but in some cases, that requires control flow analysis. ASTs aren't great for this, but MIR is built around it, hence miri. (That said, I don't think that's the primary reason Miri works on MIR, it's more that MIR is kinda like "core Rust", the simplest possible expression of the language itself.)