The Wire · Showcase
RUST-ANALYZER FIXES MACRO EXTRACTION BUG WHILE COMPILER CLEANS HOUSE
By RepoJournal · Filed · About Rust
Rust-analyzer's extract variable refactor now preserves whitespace from macro input, fixing a bug that corrupted generated code with invalid syntax like `&mutbar`.
The fix [1] keeps semantic analysis on expanded macros but builds the initializer from original source text, solving a problem that plagued developers using extract variable inside proc macros. In parallel, rust-analyzer's fuzzy import matching got a performance boost [2] by reusing lowercase buffers across comparisons while preserving case-insensitive ranking. The compiler itself shipped a rollup of 22 PRs [3] including fixes for trait method resolution on never types, comptime inherent impls, and Windows MSVC EII support. On the cleanup front, the compiler removed obsolete verbose flags from deref/ref suggestions [4], [5] and eliminated a stale comment about lint translatability [6]. Miri merged a fix [7] removing a bogus sanity check from weak memory mixed-size logic, tightening memory model validation.
Action items
- → Update rust-analyzer to get macro extraction fix if using refactor assists rust-lang/rust-analyzer [plan]
- → Sync latest compiler rollup to stay current on trait resolution and Windows support rust-lang/rust [monitor]
References
- [1] Fix extract variable preserving whitespace from macro input ↗ rust-lang/rust-analyzer
- [2] tidy: Reuse flyimport lowercase buffer rust-lang/rust-analyzer
- [3] Auto merge of #159293 - JonathanBrouwer:rollup-bZ1e8vF, r=JonathanBrouwer rust-lang/rust
- [4] Remove obsolete verbose flag from deref/ref suggestions rust-lang/rust
- [5] Rollup merge of #159283 - reidliu41:cleanup-obsolete-suggestion-verbose, r=mejrs rust-lang/rust
- [6] Rollup merge of #159275 - tshepang:patch-2, r=Kivooeo rust-lang/rust
- [7] Merge pull request #5188 from RalfJung/mixed-size-ice rust-lang/miri