Tier 3 Means Getting Your Hands Dirty


It should have been simple example code, but it was broken. Yes it was for AVR and used unstable compiler features. But still, why did it break in such mysterious ways? To find out, I went down a rabbit hole that led me to submit a patch to LLVM.

Seemingly innocent changes made the bug appear and disappear. My code didn't panic, so why did mapping the error type matter? Switching #[inline] to #[inline(never)] made it go away, maybe it was an inlining issue?

To get to the bottom of things, I had to pore over the generated IR and assembler, and eventually dive into the codebase of LLVM itself.

Presented by

  • Andrew Dona-Couch Andrew Dona-Couch

    Andrew is a freelance software developer who also runs a small startup designing and building consumer electronics widgets. He pushes his clients hard to adopt Rust -- selfishly, since it makes for far fewer calls in the middle of the night. Since AVR support was mainlined in the Rust compiler, he's been migrating all his microcontroller code to Rust (and loving every minute of it, even the frustrating ones).