Rust Systems & Tokio (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
What is Miri and how do you test for Undefined Behavior in Rust?
senior LevelrustAdvanced Internals
In Simple Words: Miri is an interpreter for Rust's intermediate representation (MIR):
- Runs test suites (
cargo miri test) and detects:- Out-of-bounds memory accesses and buffer overflows.
- Use-after-free and dangling pointers in
unsafecode. - Data races across concurrent threads.
- Violations of the Aliasing model (Stacked Borrows).