Tree Borrows Just Landed 🦀
Today’s Issue: Publish All Your Crates Everywhere All at Once, Placing Functions, and a Rust Shaped Hole
Hello, Rustaceans
Hope you had an awesome and productive week last week. Let’s roll!
In this issue, we’ll discuss the recently published Tree Borrows paper, present you a Rust quiz, spotlight an amazing Rust project, and share ten (10) incredible links of the week.
Here’s issue 76 for you!
THE MAIN NEWS
Tree Borrows Just Landed 🦀
While we were still enjoying the shiny new features that released on crates.io, the quartet of Neven Villani, Johannes Hostert, Derek Dreyer, and Ralf Jung collaborated on a paper to bring Tree Borrows: a new Rust aliasing model to life. This new model, recently celebrated at PLDI’25, is shaking up how Rust handles pointer shenanigans. Below is a short intro on what problems the paper is trying to solve.
“Rust provides unsafe for which safety is not guaranteed and must be manually handled by the programmer. This creates a tension. On the one hand, compilers would like to exploit the strong guarantees of the type system in order to unlock powerful intraprocedural optimizations. On the other hand, those optimizations are easily invalidated by “badly behaved” unsafe code. To ensure correctness of such optimizations, it thus becomes necessary to clearly define what unsafe code is “badly behaved.”
In prior work, Stacked Borrows defined a set of rules achieving this goal. However, Stacked Borrows rules out several patterns that turn out to be common in real-world unsafe Rust code, and it does not account for advanced features of the Rust borrow checker that were introduced more recently.
To resolve these issues, Tree Borrows was introduced. As the name suggests, Tree Borrows swaps out the rigid stack-based approach of Stacked Borrows for a tree-structured model, tracking pointer permissions with a parent-child hierarchy. It’s like giving your references a family tree instead of a single-file line at the DMV.
This setup lets Rust enforce aliasing rules at runtime, catching undefined behavior (UB) with more finesse. The cool part? It rejects 54% fewer test cases than its predecessor, meaning your sketchy unsafe code has a better shot at surviving Miri’s scrutiny.
Plus, it’s been formalized in Rocq, so you know it’s not just hand-wavy promises - it’s mathematically legit.
What’s the catch? Well, it’s not all roses. Tree Borrows introduces concepts like Frozen and Reserved permissions to handle shared and mutable references, but it’s still stricter than LLVM’s
noaliasin some cases, potentially leaving performance gains on the table.
The community’s debating whether to make it the official Rust aliasing model, with some configs to tweak strictness for projects like the Linux kernel. It also plays nice with optimizations like read-read reordering, but don’t expect it to greenlight every wild pointer trick you’ve got up your sleeve.
Why should you care? If you’re writing unsafe Rust, Tree Borrows could save you from borrow checker rage while keeping your optimizations safe.
It’s a step toward making Rust’s memory model less of a dictator and more of a chill collaborator. Tree borrows has been available as an optional feature in Miri (since March 2023), which you can enable with the flag MIRIFLAGS=-Zmiri-tree-borrows. So, next time you’re wrangling pointers, Tree Borrows has your back - mostly. Just don’t expect it to write your unsafe code for you.
Tree Borrows might make Rust’s aliasing rules less thorny, but mess up, and you’ll still get barked at by the borrow checker!
RUST QUIZ 🦀
In our previous issue we shared a Rust Macro for concise pattern matching and situations where it’s most useful.
Let’s move on to this week’s quiz.
Guess the Output!
Can you guess what the code below will print?
Read it, make your guess, and tag us either on X, BlueSky, Mastodon, or reply to this email.
PROJECT SPOTLIGHT 💡
RustFS
RustFS is a high-performance distributed object storage system built in Rust, and designed to rival giants like MinIO while waving the flag of open-source freedom.
In today’s data-driven world, managing huge amounts of unstructured data can feel like wrestling a hydra. Many existing solutions, like MinIO, come with trade-offs: restrictive licenses, complex setups, or performance bottlenecks.
RustFS tackles these pain points, and it’s built to handle the demands of modern applications, from AI workloads to edge computing, without the baggage of proprietary constraints or risky third-party logging.
Features That make RustFS Shine
Blazing Performance - RustFS harnesses Rust’s memory-safe, high-speed capabilities, delivering faster read/write operations. It’s like giving your data a turbo boost.
S3 Compatibility Done Right - You can seamlessly integrate with existing S3-compatible apps and cloud providers, ensuring your workflows stay smooth and uninterrupted.
Scalable Distributed Architecture - It’s designed for fault tolerance and massive scalability.
User-Friendly Console - Unlike clunky dashboards, RustFS offers a powerful, intuitive web interface that simplifies bucket creation and object management.
RustFS is community-driven and open-source on GitHub at https://github.com/rustfs/rustfs.
AWESOME LINKS OF THE WEEK 🔗
Josh Triplett from the Rust Team announced a call for testing the nightly-only -Zhint-mostly-unused option and related Cargo features, potentially reducing compile times by up to 50% in some cases.
George He from CocoIndex blogged about "Thinking in Rust Ownership, Access, and Memory Safety" explaining how Rust's rules, including moves, borrows, and smart wrappers like Cell, RefCell, Mutex, and Arc, become intuitive when viewed through the lens of ownership and access levels.
Rust unit testing: test types by Jorge Ortiz-Fuentes details three test types: return tests (verifying function outputs), state tests (checking instance state changes), and behavior tests (validating interactions between instances), and provides best practices for effective test design.
The Rust nerds at Mirai AI open-sourced uzu, a high-performance inference engine for AI models on Apple Silicon.
Joe Neeman and Tor Hovland’s authored how to publish all your crates everywhere all at once sharing their game-changing contribution to Cargo, which enables simultaneous publishing of multiple interdependent crates in a workspace, with the feature now available in Cargo’s nightly builds and set for stable release in September 2025.
Yoshua Wuyts wrote placing functions, a slick Rust feature that constructs types directly in the caller’s stack frame, boosting performance and enabling cool tricks like stable memory addresses for async traits. Don’t skip this!
Robin Hänni and Marcin Wojnarowski’s published an exciting project of adding unbounded captureless lookbehinds to Rust’s regex crate. They detail the implementation process, tackling challenges like parser updates, and performance optimizations, achieving reasonable performance compared to Python’s re library.
Soares Chen is back again with part 3 of Programming Extensible Data Types in Rust with CGP. He shows how CGP’s traits like HasField and BuildField can be used to craft flexible, composable code that effortlessly merges structs, all while keeping Rust’s type safety in check.
Manav Rathi’s “A Rust Shaped Hole” is a lively journey through a programmer’s hunt for the ideal language to build a solid native app. He dismisses C++’s complexity, appreciating C’s simplicity, balancing Go’s managed memory, and cherishing TypeScript’s abstraction, before choosing Rust for its potent mix of high-level abstraction and manual memory finesse.
Raghav Anand from Figma wrote about how they supported faster file load times with memory optimizations in Rust.
Bonus:
Nicholas Nethercote, a top Rust compiler contributor, is seeking a new role to keep making Rust awesome. If your company can hire him, reach out or pass the word to colleagues. Check out his post for his epic work on compiler perf & more!
CodeCrafters: Become a Better Rust Engineer
CodeCrafters created amazing Rust courses that push your skills beyond the basics.
You’ll have fun building real-world projects from scratch, including Git, Docker, Redis, Kafka, SQLite, Grep, BitTorrent, HTTP Server, an Interpreter, and DNS.
The courses are self-paced, so you can learn at your own speed. If you’re itching to level up your Rust skills, these courses are perfect for you.
Join for free and get 40% off when you upgrade. [affiliate]
SUPPORT RUST BYTES
You’re Rust Bytes’ biggest fans, and we love to see it.
Here’s how you can help spread the word:
❤️ Recommend Rust Bytes to your friends.
🤳 Connect with us on our socials: X, BlueSky, Mastodon, Publication.
☕️ Support our editors by buying us coffee.
📨 Email us at rustaceanseditors@gmail.com for sponsorship, feedback or ideas.
I've been feeling a bit down lately, not quite sure why, but I'm hopeful things will brighten up in the coming days.
That's all for now, Rustaceans.
John & Elley.




