🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now β†’
Menu

Categories

Rust 1.85: Async Closures Stabilized and New Borrow Checker

Rust 1.85: Async Closures Stabilized and New Borrow Checker

The Rust team has released version 1.85, bringing several highly anticipated features to stable Rust.

Async Closures

The async || { ... } syntax is now stable, allowing closures that return futures. This has been one of the most requested features in the async ecosystem:

let fetch = async |url: &str| {
    let response = reqwest::get(url).await?;
    response.text().await
};

Previously, creating closures that captured their environment and returned futures required complex workarounds with Box<dyn Future>.

Polonius Borrow Checker

The new Polonius borrow checker is now enabled by default. It is more permissive than the previous NLL (Non-Lexical Lifetimes) checker, accepting more valid programs while maintaining Rust's safety guarantees. Code that previously required awkward restructuring to satisfy the borrow checker may now compile directly.

Trait System Improvements

  • Return position impl Trait in traits β€” Methods can now use -> impl Trait in trait definitions
  • Associated type bounds β€” Simplified syntax for bounding associated types
  • Diagnostic attributes β€” Custom error messages for trait implementation failures

The Rust ecosystem continues to grow rapidly, with the language now ranked in the top 10 of the TIOBE index.

Share this article:
Dargslan Editorial Team (Dargslan)
About the Author

Dargslan Editorial Team (Dargslan)

Collective of Software Developers, System Administrators, DevOps Engineers, and IT Authors

Dargslan is an independent technology publishing collective formed by experienced software developers, system administrators, and IT specialists.

The Dargslan editorial team works collaboratively to create practical, hands-on technology books focused on real-world use cases. Each publication is developed, reviewed, and...

Programming Languages Linux Administration Web Development Cybersecurity Networking

Stay Updated

Subscribe to our newsletter for the latest tutorials, tips, and exclusive offers.