- Published on
Investigation · Part 2 of 10 · Types under the hood
Does a Type Exist at Runtime? Following One Value From Source to Register
I followed one u8 through the four stages of the Rust compiler: HIR, MIR, LLVM IR, and assembly. The type is a word, then a field, then a width, then nothing. The u8 and u32 versions of the same function compile to the same two instructions, and the one check a type does produce is the debug overflow guard.