Rust

Rust: Spring Cleaning and Performance Tuning

March 11th brought a massive housekeeping day to the Rust compiler with 20 merged pull requests focused on code organization and performance improvements. Notable highlights include a major refactor moving the `Spanned` type to a more logical home, new coercion support for pinned references, and significant query system cleanups that remove deprecated APIs.

Duration: PT3M55S

https://podlog.io/listen/rust-ffe93d3a/episode/rust-spring-cleaning-and-performance-tuning-41ccc4e7

Transcript

Hey there, Rust developers! Welcome back to another episode of the Rust podcast. I'm your host, and wow, what a day March 11th was for the Rust compiler! We had twenty - count them, twenty - pull requests merged, and it feels like the entire Rust team decided to have a massive spring cleaning party.

Let me paint you a picture of what happened. Sometimes in software development, you have those days where you're adding shiny new features, and other days where you're doing the essential but less glamorous work of keeping your house in order. Today was definitely a house-keeping day, and honestly? Those are some of my favorite kinds of days because they set us up for so much future success.

The star of the show has to be Nicholas Nethercote's work on moving the `Spanned` type. Now, if you're not familiar with `Spanned`, it's one of those fundamental building blocks in the Rust compiler that gets used everywhere - and I mean everywhere. The problem was, it was living in a module called `source_map`, which makes about as much sense as storing your coffee mugs in the garage. Nicholas moved it to the crate root where it belongs, and this change touched 99 files! That's the kind of refactor that makes me both nervous and excited - nervous because of the scope, but excited because it's going to make the codebase so much more intuitive for future contributors.

Speaking of big changes, we got some really cool ergonomics improvements around pinned references. Frank King has been working on implementing coercions between pinned and regular references when the type implements `Unpin`. This is one of those changes that's going to make working with async code just a little bit smoother, and those little improvements really add up over time.

But here's what I love about today's activity - it's not just one person doing all the heavy lifting. We had David Twohy working on scalable vector type renames, making the SIMD code more consistent. Guillaume Gomez was cleaning up the lint system by removing deprecated APIs that have been hanging around too long. And zetanumbers tackled the gnarly `FromCycleError` trait, replacing it with something much cleaner.

The rollup PRs tell a great story too. Jonathan Brouwer coordinated not one, but two major rollups that bundled together dozens of smaller improvements. There's something really satisfying about seeing all these individual contributions come together like pieces of a puzzle.

I also want to shout out some of the testing improvements we saw today. We got regression tests for edge cases, better annotations in the binary operation tests, and even a new test for proc-macros with custom panic payloads. Testing isn't glamorous work, but it's the foundation that lets us move fast without breaking things.

Here's what I find fascinating about days like this - while we didn't ship any major user-facing features, we made the compiler faster, more maintainable, and more approachable for new contributors. That's the kind of investment that pays dividends for years to come.

So what's today's focus for you as a Rust developer? Take a page from the compiler team's playbook. Look at your own projects and ask yourself: what's been bothering you about your code organization? What types are living in the wrong modules? What deprecated APIs are you still using that you could clean up? Sometimes the best way to move forward is to first clean up where you are.

And if you're thinking about contributing to Rust itself, days like today show that not every contribution has to be a massive new language feature. Nicholas's `Spanned` move, Guillaume's lint cleanup, the Docker file fixes - these are all incredibly valuable contributions that make the entire ecosystem better.

That's a wrap for today's episode! Keep that code clean, keep those tests comprehensive, and I'll catch you next time for more Rust adventures. Until then, happy coding!