The Rust Borrow Checker—A Deep Dive

The Rust compiler's borrow checker is critical for ensuring safe Rust code. Even more critical, however, is how the borrow checker provides useful, automated guidance on how to write safe code when the check fails. Early in your Rust journey it may feel like you are fighting the borrow checker. Come to this talk to learn how you can transition from fighting the borrow checker to using its guidance to write safer and more powerful code at any experience level. Walk away not only understanding the what and the how of the borrow checker—but why it works the way it does—and why it is so critical to both the technical functionality and philosophy of Rust.

What is the work that you are doing today?

I am a principal engineer at Microsoft, my two main focuses are, one, on a project called Clearly Defined, which tracks open source licenses across the open source ecosystem of ecosystems. The second is I am focused on the Rust programming language. I previously, before Microsoft, was at Mozilla, where I worked on the Rust language full time, and I am Microsoft's representative to the Rust Foundation board. So, I am focused on open source licensing and the Rust programming language.

What are your goals for the talk? What do you want people to live with after your talk? 

My talk is focused on the borrow checker feature of Rust, and there's two main things I hope people walk away with. One is a better understanding of how it works. I've heard from a lot of people that when they first get started with Rust, they feel like they're fighting the borrow checker.It seems much less like fighting it once you understand a little bit more about how it works and why it does the things that it does. So that's what this talk will take you through. And the second part is the Rust compiler is open for contributions. I found it very intimidating when I first started contributing to the compiler. But it's not as intimidating as it seems. I'm hoping people will have a better understanding of where to find information about contributing to the compiler and how to get started on compiler hacking themselves.

When you say contributing to the compiler, at what level of it are you talking about, new features or fixes, optimizations, what's a good place to start?

The first place I would start is very small features or very small optimizations. The great thing about the Rust compiler is when you do something the compiler doesn't like, it gives you an error message which tells you not just what the error is and where it is in your code, but also how to fix it. A lot of those messages can be improved upon. They're good now, but they can be improved upon even more. So improving those error messages I think would be a big help, improving the conditions where those errors are generated. Those are good places to start. There's a lot of mentorship available and in those specific areas. I would start there and then move into adding new features to the compiler.


Nell Shamrell-Harrington

Principal Software Engineer @Microsoft
Nell Shamrell-Harrington is a Principal Software Engineer at Microsoft in the Open Source Programs Office. She is also a member of several Rust language teams and working groups, as well as the lead editor of This Week in Rust. Previously, she worked at Mozilla and Chef Software. In her spare... Read more Find Nell Shamrell-Harrington at:

Tuesday May 25 / 09:10AM EDT (40 minutes)

TRACK System Level Programming Languages TOPICS RustProgramming ADD TO CALENDAR Calendar IconAdd to calendar