Releases

rust-analyzer 0.3.2887 adds diagnostics, gen blocks, and smarter completions

rust-analyzer 0.3.2887 catches more bugs before cargo check, adds smarter .new completions, and starts tracking gen blocks for nightly Rust.

Nina Kowalski··2 min read
Published
Listen to this article0:00 min
Share this article:
rust-analyzer 0.3.2887 adds diagnostics, gen blocks, and smarter completions
Source: i.redd.it

rust-analyzer 0.3.2887 made the editor a better first pass at catching Rust mistakes. Released on May 4 as commit f04c372, the new build added diagnostics for mismatched array pattern lengths, unused-must-use results, trait errors, type-must-be-known cases, generic defaults that refer to self, invalid left-hand sides of assignments, pattern arguments in extern functions, non-exhaustive record expressions, and union expressions with exactly one field.

That matters because it changes the shape of a normal Rust workflow. Instead of waiting for cargo check to complain after a save, rust-analyzer is surfacing more errors earlier and with more context, which is exactly where an IDE earns its keep in a large codebase. The project’s own diagnostics documentation already describes a growing set of analyzer-driven checks alongside cargo check integration, and this release pushes that direction further rather than treating diagnostics as an afterthought.

The day-to-day polish did not stop at warnings. The release added initial support for gen blocks, let users rename elided lifetimes, and introduced a .new postfix completion that keys off the expected type. It also added the unwrap_block assist, plus parser and recovery fixes that make the editor less brittle around messy code, including cases like “(a, , b)”. For Rust work that involves jumping between half-finished edits and compiler feedback, those are the kinds of small gains that save real time.

Gen blocks are the clearest sign that rust-analyzer is trying to stay ahead of the language itself. RFC 3513 reserved gen as a keyword in the Rust 2024 edition and introduced gen { .. } blocks, with the feature gated behind #![feature(gen_blocks)] on nightly. The Rust edition guide says the feature is meant to make certain iterators easier to write. By adding initial support now, rust-analyzer is preparing editors for a language feature still moving through the toolchain.

AI-generated illustration
AI-generated illustration

There was also serious under-the-hood work. The performance section points to storing parse errors in a side table, keeping the nonce when cloning RootDatabase, avoiding interning AdtDef, and dropping some Arc references. The fixes section says rust-analyzer ported pattern inference from rustc, brought type inference closer to rustc, and improved parser recovery. It also includes repairs for a stack overflow while displaying projections and a panic in introduce_named_type_parameter.

That steady mix of smarter diagnostics and faster internals is what makes rust-analyzer feel like it is improving in visible, practical steps. The project, maintained by Ferrous Systems and now part of the Rust organization, started at the end of 2017 and has grown to 260 contributors. For Rust developers who live inside the editor, 0.3.2887 looks less like a maintenance bump and more like another nudge toward faster feedback and fewer surprises before code ever reaches the compiler.

Know something we missed? Have a correction or additional information?

Submit a Tip

Never miss a story.

Get Rust Programming updates weekly. The top stories delivered to your inbox.

Free forever · Unsubscribe anytime

Discussion

More Rust Programming News