Skip to content

Releases: rust-lang/rust-analyzer

nightly

19 May 01:24
cdfe408

Choose a tag to compare

nightly Pre-release
Pre-release
Merge pull request #22399 from A4-Tacks/ref-match-in-macro-call

fix: complete ref_match in macro

2026-05-18

18 May 02:50
ce81cf6

Choose a tag to compare

Commit: ce81cf6
Release: 2026-05-18 (v0.3.2904)

VS Code Extension Publishing Issue

This release is not available on the VS Code Marketplace and OpenVSX due to an infrastructure issue.
Until it's fixed, you can still download it from the GitHub release page.

New Features

  • #22347, #22355, #22372, #22379, #22380, #22378 add invalid-range-pat-type, non-exhaustive-record-pat, method-call-illegal-sized-bound, fru-in-destructuring-assignment, cannot-be-dereferenced and explicit-drop-method-use diagnostics.
  • #22082, #22368, #22384 add pattern type support.

Performance Improvements

  • #22329 encode the name instead of index in EnumVariantId for better incrementality.
  • #22191 use the LineIndex in RootDatabase in the proc macro server.

Fixes

  • #22358, #22381 show const and unsafe in signature help.
  • #22357 show Run lens for fn main in bench targets.
  • #22363 fix false positive trait-impl-missing-assoc_item with Self: Sized bounds.
  • #22376 hide duplicate completions originating from Deref chains.
  • #22367 fix spurious reference completions.
  • #22386 don't complete :: before existing :: in paths.
  • #22354 don't drop path segment in qualify_path.
  • #22344 handle macro calls in extract_function.
  • #22335 add parameter to the closures produced by replace_method_eager_lazy.

Internal Improvements

  • #22352 (first contribution) migrate inline_call assist to `SyntaxEditor.
  • #22313 refactor visiting and tracking of placeholder types.
  • #22328 remove interning from #[query_group].
  • #22119 remove some usages of DbInterner::conjure.
  • #22391 ignore workspace/diagnostic/refresh in slow tests.

See also the changelog post.

2026-05-11

11 May 04:58
e266f5c

Choose a tag to compare

Commit: e266f5c
Release: 2026-05-11 (v0.3.2896)

New Features

  • #22309, #22334 (first contributions) add functional-record-update-on-non-struct and expected-array-or-slice-pat diagnostics.
  • #22235, #22326 add duplicate-field diagnostic.
  • #22292 add support for deref patterns.
  • #22259 complete :: in module paths.

Performance Improvements

  • #22267 improve performance of integer-based symbols.
  • #22280 cache more things related to lang items.

Fixes

  • #22303 (first contribution) keep ref and mut when renaming bindings in macro-generated patterns.
  • #22284 (first contribution) work around a lsp-mode configuration bug.
  • #22295 (first contribution) use runnable kind to disambiguate between Cargo and shell commands.
  • #22272 don't fetch diagnostics until proc macros are loaded.
  • #22198 infer anonymous constants instead of signatures.
  • #22237 provide an InferCtxt to TyLoweringContext.
  • #22319 don't replace closure capture place types with errors if they fail to normalize.
  • #22285 unify types in ref_match completions.
  • #22275 port async block expected type inference from rustc.
  • #22271 port array and ref expression inference from rustc.
  • #22299 fix derive helper resolution.
  • #22290 respect lint attributes for diagnostics that don't set their main node.
  • #22276 remove usage of references_error in upvar inference.
  • #22266 fix handling of self in lower_coroutine_body_with_moved_arguments.
  • #22318 provide source map for the lowered let self = self binding in async functions.
  • #22274 add missing lang items for the trait solver.
  • #22282 handle #[rustc_reservation_impl = "reason"].
  • #22315 add whitespace to postfix completions in macro calls.
  • #22286 use cursor position for indentation in postfix completions.
  • #22302 don't split ..= in prettify_macro_expansion.
  • #22291 don't add associated types with defaults in add_missing_impl_members.
  • #22304 don't offer toggle_macro_delimiter on inner braces.

Internal Improvements

  • #22312 bump rustc crates.
  • #22269 fix nested edits in SyntaxEditor.
  • #22308, #22204 migrate split_import and convert_closure_to_fn assists to SyntaxEditor.
  • #22261 migrate missing_fields diagnostic to SyntaxEditor.
  • #22296 migrate impl Trait completions to SyntaxEditor.
  • #22320, #22321, #22323 migrate macro expansion to SyntaxEditor.
  • #22310 remove SourceChangeBuilder::make_mut.
  • #22307 remove ted-based increase_indent and decrease_indent.
  • #22256 add SyntaxEditor version of wrap_in_tree_list.

See also the changelog post.

2026-05-04

04 May 05:21
f04c372

Choose a tag to compare

Commit: f04c372
Release: 2026-05-04 (v0.3.2887)

New Features

  • #22238, #22239, #22253 (first contributions) add mismatched-array-pat-len and unused-must-use diagnostics.
  • #22186 diagnose trait errors 🎉.
  • #22144, #22168, #22145, #22156, #22197, #22193, #22202 add type-must-be-known, generic-default-refers-to-self, invalid-lhs-of-assignment, pattern-arg-in-extern-fn, non-exhaustive-record-expr and union-expr-must-have-exactly-one-field diagnostics.
  • #21987 add initial support for gen blocks.
  • #22178 allow renaming of elided lifetimes.
  • #22132, #22210 add .new postfix completion based on expected type.
  • #22179 add unwrap_block assist.

Performance Improvements

Fixes

  • #22098 (first contribution) avoid importing prelude paths when imports.preferPrelude is disabled.
  • #22134, #22195 port pattern inference from rustc.
  • #22141 bring type inference closer to rustc.
  • #22135 suppress inference variables in monomorphization.
  • #22214 visit all expressions.
  • #22169 parse impl restrictions after visibility.
  • #22170 parse return #[attr] expr.
  • #22124 don't pick an impl Trait block in generate_function.
  • #22166 fix placement of async closure capture hints.
  • #22183 propagate ABI to functions declared in extern blocks.
  • #22201 improve parser recovery in (a, , b).
  • #22058 improve prettify_macro_expansion.
  • #22229 add parentheses in convert_match_to_let_else.
  • #22142 don't offer completions for already imported Trait as _.
  • #22154 don't complete where after qualified paths.
  • #22222 emit else clause in value postfix completions.
  • #22240 improve indentation in trait item completion.
  • #22244 handle cycles in expand_glob_import.
  • #22150 offer is_some_and and is_none_or in apply_demorgan_iterator.
  • #22151 handle negation in apply_demorgan_iterator.
  • #22247 handle match arms in unwrap_branch.
  • #22217 add semicolon after expression in unwrap_branch.
  • #22184 offer unwrap_branch on non-block match arms.
  • #22180 offer replace_arith_op on compound assignments.
  • #22199 offer convert_to_guarded_return on if expression with else if clause.
  • #22079 handle if matches!() in replace_if_let_with_match.
  • #22215 fix a stack overflow when displaying projections.
  • #22265 fix panic on impl ?Sized in introduce_named_type_parameter.
  • #22207 fix some issues in lower_coroutine_body_with_moved_arguments.
  • #22122 be more resilient to deleted directories in Analysis::from_single_file.

Internal Improvements

  • #22129 lower non-destructuring assignments into Pat::Expr instead of Pat::Path.
  • #22146 clean up string references in postfix completions.
  • #22190 ignore a test that might be hanging.
  • #22232 refactor the hir-ty generics data structures.
  • #22194 refactor InternedCoroutineClosureId.
  • #22221 fix incorrect offset with multiple indels.
  • #22121 migrate extract_function assist to SyntaxEditor and remove old version of generate_impl.
  • #22125, #22020, #22159 migrate replace_qualified_name_with_use, inline_call and generate_function assists to SyntaxEditor.
  • #22137 migrate convert_into_to_from assist to SyntaxEditor and replace some usages of mod_path_to_ast.
  • #22241 migrate insert_use and insert_use_as_alias to SyntaxEditor.
  • #22245 migrate AssocItemList::add_item to SyntaxEditor.
  • #22243 replace ast::make with SyntaxFactory in to_generic_args.
  • #22246 remove WhereClause::add_predicate.
  • #22242 remove some unused methods in edit_in_place.

See also the changelog post.

2026-04-27

27 Apr 04:56
8954b66

Choose a tag to compare

Commit: 8954b66
Release: 2026-04-27 (v0.3.2878)

New Features

  • #21979 rename variables in constructors when renaming a field.

Fixes

  • #22116 (first contribution) mark enum variants as deprecated when parent enum is deprecated.
  • #22101 port call expression type checking and closure upvar inference from rustc.
  • #22107 improve "Go to definition" on comparison operators.
  • #22085 reduce relevance of deprecated items.

Internal Improvements

  • #22054 (first contribution) de-duplicate lints.
  • #22104 don't check solver's cache validity on every access.
  • #22105 migrate wrap_unwrap_cfg_attr assist to SyntaxEditor and replace ast::make with SyntaxFactory in few handlers.
  • #22111 group unstable features in a struct.

See also the changelog post.

2026-04-20

20 Apr 04:36
adef948

Choose a tag to compare

Commit: adef948
Release: 2026-04-20 (v0.3.2870)

New Features

  • #21906 exclude dependency and standard library results from reference search.
  • #21740 support #[rust_analyzer::prefer_underscore_import] to import traits as _.

Fixes

  • #22031 (first contribution) demote impl completions when an inherent impl block already exists.
  • #22083 (first contribution) respect #[deprecated] when deciding if a ModuleDef completion is deprecated.
  • #22046 (first contribution) add parser support for unstable type const items.
  • #22022 add parser support for impl and mut restrictions.
  • #22096 use ProofTreeVisitor for unsized coercion.
  • #22025 don't add extra dereference after indexing in extract_function.
  • #22044 don't complete unstable items that are gated by an internal feature.
  • #22003 complete variants of hidden enums through public aliases.
  • #21999 fix ref-completion with keyword prefix.
  • #22018 enable completions inside strings in VS Code.
  • #22032 allow ambiguity in associated type shorthands if they resolve to the same associated type from a supertrait.
  • #22087 fix incorrect lifetime hints with self: Self parameter.
  • #22066 recognize #[std::prelude::vX::test].
  • #21487 offer extract_variable in macro calls.
  • #22067 add parentheses on record literals in replace_let_with_if_let.
  • #22030 fix MIR evaluation of sized &T with recursive const functions.
  • #22073 fix panic on empty comments in convert_comment_block.
  • #22077 fix a panic in replace_if_let_with_match.
  • #22055 fixes some upvars_mentioned issues.
  • #22070 handle name conflicts in extract_type_alias a little better.

Internal Improvements

  • #21835 add hir::Type::{as_raw_ptr,is_mutable_raw_ptr}.
  • #22092 synchronize function call argument check fudging with rustc.
  • #22048 bump rustc crates.
  • #22061 bump salsa.
  • #22050 represent lower coroutines to closures.
  • #22049, #22069 store a SyntaxFactory inside SyntaxEditor.
  • #22043, #22095, #22042, #22039 replace ast::make with SyntaxFactory in raw_string, convert_range_for_to_while, expand_glob_import and generate_blanket_trait_impl.
  • #22091, #22036 migrate generate_impl_text and IdentPat::set_pat to SyntaxEditor.
  • #22081 migrate convert_iter_for_each_to_for assist to SyntaxEditor.
  • #22037 remove set_visibility.
  • #22041 remove GenericParamsOwnerEdit.
  • #22057 remove clone_for_update from move_const_to_impl.
  • #22063 remove LineIndexDatabase.
  • #22065 fix new Clippy lints.
  • #22084 slim down MiniCore Debug output.
  • #22074 support RUSTFMT_TOOLCHAIN for xtask codegen.
  • #22029, #22028 run rustdoc GitHub action on PRs.

See also the changelog post.

2026-04-13

13 Apr 06:35
7b6e124

Choose a tag to compare

Commit: 7b6e124
Release: 2026-04-13 (v0.3.2862)

New Features

  • #21978 (first contribution) enhance runnable command placeholders.
  • #21964 (first contribution) allow passing extra arguments to cargo metadata.
  • #21012, #21982 complete -> in function return position.

Fixes

  • #21995 (first contribution) don't let Cargo [env] variables override the process ones.
  • #21970, #21968 (first contribution) load Markdown files into the VFS and watch for changes.
  • #21704 (first contribution) load rust-analyzer.toml in virtual workspaces.
  • #21965 improve handling of +#[cfg_attr]+ and +#[cfg]+.
  • #21973 take path context into account in ImportAssets.
  • #21962 fix SyntaxEditor upmapping of nodes with mapped ancestors that aren't mapped themselves.
  • #21981 emit diagnostic for #![cfg]ed out crates.
  • #21977 disable the fix for missing-fields when the fields are private.
  • #22009, #22012 fix spurious import completions in qualified paths with type anchors.
  • #21955 add semicolon for postfix print!-like completions.
  • #21971 check coercion, not unification, in "Fill struct fields".
  • #21953 improve type mismatch "Add Some" fix on block-like expressions.
  • #21952 improve type mismatch fixes inside macro calls.
  • #21920 improve add_missing_match_arms labels.
  • #21957 improve onEnter.
  • #22010 fix rustfmt with relative custom command.
  • #21738 fix stale diagnostics with custom check command.
  • #21969 refrsh workspace when adding a Cargo config.

Internal Improvements

  • #21988, #22011, #21998 add workflow to update generated lints.
  • #21996 migrate extract_struct_from_enum_variant assist to SyntaxEditor.
  • #21993 replace make::trait_ with SyntaxFactory in generate_trait_from_impl.
  • #21997 replace make constructors with SyntaxFactory in generate_single_field_struct_from.
  • #21975 handle token mutability in SyntaxEditor.
  • #21960 move SyntaxEditor precondition handling to its constructor.
  • #21972 remove some redundant clone_subtrees.
  • #21967 derive Clone, Copy, Hash for vfs::ChangeKind.
  • #21963 bump ESLint and TypeScript.
  • #21986 fix RecursiveMemoryLayoutNode field names in the Code extension.
  • #21985 use official npm registry for the Code extension dependencies.

See also the changelog post.

2026-04-06

06 Apr 06:10
38fb8f9

Choose a tag to compare

Commit: 38fb8f9
Release: 2026-04-06 (v0.3.2854)

Universal VSIX

This release adds a platform-independent VSIX that VS Code will install on platforms where rust-analyzer doesn't offer binaries.
On supported platforms, the extension should keep working as before, but a Code bug might cause it to fail to activate.
If that happens, you should uninstall and reintall the rust-analyzer extension.

New Features

  • #21928 (first contribution) support macro expansion in #[doc = ...] attributes.
  • #19956 implement #[feature(more_qualified_paths)].
  • #21322 add option to put type hints at the end of the line.
  • #19659 add support for folding ranges in chained expressions.
  • #21516 publish universal VSIX without a built-in server binary, for unsupported platforms.

Fixes

  • #21792 (first contribution) make matching_brace work when cursor the cursor is not on a bracket.
  • #21942 (first contribution) silence type mismatch diagnostic when type is unknown.
  • #21924 (first contribution) update Neovim setup instructions.
  • #21915 fix a cycle in bounds lowering.
  • #21935 support #[cfg] on array elements.
  • #21926 handle empty expressions in parameter inlay hints.
  • #21937 wrap guard in parentheses in replace_if_let_with_match.
  • #21938 fix indent in convert_let_else_to_match.
  • #21954 handle empty else block in convert_let_else_to_match.
  • #21951 report "expected type, found {" in parser.
  • #21695 match trait item order in trait_impl_redundant_assoc_item.
  • #21936 handle comma at the end of argument in extract_variable.
  • #21902 support env! completions in nested macro calls.
  • #21903 handle negation in if postfix completion.
  • #20864 fix naming of self parameter in extract_function.
  • #21919 support labels in convert_to_guarded_return.
  • #21912 support tail expressions in convert_to_guarded_return.
  • #21940 support multiple snippet placeholders in VS Code extension.
  • #21921 unconditionally pass --include-ignored for test runnables.
  • #21922 use the correct project root when there are multiple workspaces.
  • #21844 support file systems that don't send Create events.
  • #21881 fix missing argument error messages for sched_getaffinity and getenv shims.

Internal Improvements

  • #21944 remove RootQueryDb.
  • #21931 move node mutability handling to edit_algo.
  • #21886 replace make constructors with SyntaxFactory in gen_trait_fn_body.
  • #21930 refactor add_missing_impl_members to use more of SyntaxFactory.
  • #21909 allow disabling fixture support.
  • #21933 ensure tracing is configured in slow tests.
  • #21806 document when crate cycles can occur.
  • #21923 set VS Code extension kind explicitly.
  • #21916 bump @vscode/vsce and ovsx.

See also the changelog post.

2026-03-30

30 Mar 04:56
f1297b2

Choose a tag to compare

Commit: f1297b2
Release: 2026-03-30 (v0.3.2845)

Fixes

  • #21588 (first contribution) fix asm! sym operand parsing for parenthesized expr fragments.
  • #21871 revert TyLoweringContext::store after lowering parent defaults.
  • #21876 keep value when trying to produce a default call.
  • #21904 fix panic on trailing | in unmerge_match_arm.
  • #21838 skip usages inside macro expansions in destructure_{struct,tuple}_binding.
    • #21860, #21865 wrap ascribed type in Option<> or Result<> in desugar_try_expr with let - else.
  • #21744 keep comments in add_missing_match_arms.
  • #20681 fix indent after fixing trait_impl_redundant_assoc_item.
  • #21411 offer merge_match_arms on ambiguous identifier patterns.
  • #21709 fix spurious flychecks with multiple workspaces.

Internal Improvements

  • #21874 (first contribution) migrate generate_default_from_new assist to SyntaxEditor.
  • #21879 (first contribution) fix bounds check in debug_assert!.
  • #21823, #21859, #21900 implement signature type inference.
  • #21901, #21907 only allocate non-empty item blocks.
  • #21897 remove Arc from GenericParams and AstIdMap.
  • #21872 rename IndentLevel::single to zero.
  • #21856, #21867, #21866, #21870, #21884 replace make in replace_derive_with_manual_impl, generate_impl, generate_new, generate_trait_impl_text_intransitive and getter with SyntaxFactory.
  • #21853 extract default_fill_expr to utils.
  • #21862 don't trigger GC on slow tests, take 2.

See also the changelog post.

2026-03-23

23 Mar 06:05
b42b63f

Choose a tag to compare

Commit: b42b63f
Release: 2026-03-23 (v0.3.2836)

New Features

  • #21395 change test_name placeholder to executable_arg.

Fixes

  • #21784 remove angle brackets if all lifetime args removed in inline type alias code assist.
  • #21817 fix overlapping edits in convert_named_struct_to_tuple_struct and convert_tuple_struct_to_named_struct.
  • #21333 fix expected type analysis for tuple struct patterns.
  • #21424 support more runnable kinds in rust-project.json.
  • #20407 move out doc comments in generate_trait_from_impl.
  • #21768 keep qualifiers in function parameter completions.
  • #21756 support postfix let completions in closures.
  • #21839 don't add a second semicolon after postfix completions.
  • #21324 improve indentation after postfix completions.
  • #20594 fix indentation in convert_closure_to_fn.
  • #20614 offer no_such_field fix for empty structs.
  • #20762 add fixes for non_exhaustive_let.
  • #20299 name trait after first method in generate_trait_from_impl.
  • #21775 offer inline_local_variable in let-chains.
  • #21473 offer unwrap_block on let-else.
  • #20984 offer add_label_to_loop on for and while expressions.
  • #20600 offer unwrap_tuple on let expressions.
  • #21809 offer extract_variable on some paths.
  • #21822 offer add_missing_match_arms on commas between arms.
  • #21850 offer add_braces on assignments.
  • #20628 support nested lifetimes in add_lifetime_to_type.
  • #20625 support multiple attributes in wrap_unwrap_cfg_attr.
  • #20566 support partial selections in merge_imports.
  • #21787 keep extra predicates in replace_is_method_with_if_let_method.
  • #21828 prime caches in parallel in scip.

Internal Improvements

  • #21843 (first contribution) migrate convert_from_to_tryfrom assist to SyntaxEditor.
  • #21847 migrate qualify_method_call, qualify_path and desugar_try_expr assists to SyntaxEditor.
  • #21832 use mappings in SyntaxFactory constructor methods.
  • #21826 replace ast::make with SyntaxFactory in a few ide-assists methods.
  • #21848 ignore mapping in expr_underscore.
  • #21779 fix printing of IR types.
  • #21827 don't trigger GC on slow tests.
  • #21795 fix test_loading_rust_analyzer when rust-project.json is present.
  • #21796 add codecov.io badge.

See also the changelog post.