Releases: rust-lang/rust-analyzer
nightly
Merge pull request #22399 from A4-Tacks/ref-match-in-macro-call fix: complete ref_match in macro
2026-05-18
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,#22378addinvalid-range-pat-type,non-exhaustive-record-pat,method-call-illegal-sized-bound,fru-in-destructuring-assignment,cannot-be-dereferencedandexplicit-drop-method-usediagnostics.#22082,#22368,#22384add pattern type support.
Performance Improvements
#22329encode the name instead of index inEnumVariantIdfor better incrementality.#22191use theLineIndexinRootDatabasein the proc macro server.
Fixes
#22358,#22381showconstandunsafein signature help.#22357showRunlens forfn mainin bench targets.#22363fix false positivetrait-impl-missing-assoc_itemwithSelf: Sizedbounds.#22376hide duplicate completions originating fromDerefchains.#22367fix spurious reference completions.#22386don't complete::before existing::in paths.#22354don't drop path segment inqualify_path.#22344handle macro calls inextract_function.#22335add parameter to the closures produced byreplace_method_eager_lazy.
Internal Improvements
#22352(first contribution) migrateinline_callassist to `SyntaxEditor.#22313refactor visiting and tracking of placeholder types.#22328remove interning from#[query_group].#22119remove some usages ofDbInterner::conjure.#22391ignoreworkspace/diagnostic/refreshin slow tests.
See also the changelog post.
2026-05-11
Commit: e266f5c
Release: 2026-05-11 (v0.3.2896)
New Features
#22309,#22334(first contributions) addfunctional-record-update-on-non-structandexpected-array-or-slice-patdiagnostics.#22235,#22326addduplicate-fielddiagnostic.#22292add support for deref patterns.#22259complete::in module paths.
Performance Improvements
#22267improve performance of integer-based symbols.#22280cache more things related to lang items.
Fixes
#22303(first contribution) keeprefandmutwhen renaming bindings in macro-generated patterns.#22284(first contribution) work around alsp-modeconfiguration bug.#22295(first contribution) use runnable kind to disambiguate between Cargo and shell commands.#22272don't fetch diagnostics until proc macros are loaded.#22198infer anonymous constants instead of signatures.#22237provide anInferCtxttoTyLoweringContext.#22319don't replace closure capture place types with errors if they fail to normalize.#22285unify types inref_matchcompletions.#22275port async block expected type inference fromrustc.#22271port array andrefexpression inference fromrustc.#22299fix derive helper resolution.#22290respect lint attributes for diagnostics that don't set their main node.#22276remove usage ofreferences_errorin upvar inference.#22266fix handling ofselfinlower_coroutine_body_with_moved_arguments.#22318provide source map for the loweredlet self = selfbinding in async functions.#22274add missing lang items for the trait solver.#22282handle#[rustc_reservation_impl = "reason"].#22315add whitespace to postfix completions in macro calls.#22286use cursor position for indentation in postfix completions.#22302don't split..=inprettify_macro_expansion.#22291don't add associated types with defaults inadd_missing_impl_members.#22304don't offertoggle_macro_delimiteron inner braces.
Internal Improvements
#22312bumprustccrates.#22269fix nested edits inSyntaxEditor.#22308,#22204migratesplit_importandconvert_closure_to_fnassists toSyntaxEditor.#22261migratemissing_fieldsdiagnostic toSyntaxEditor.#22296migrateimpl Traitcompletions toSyntaxEditor.#22320,#22321,#22323migrate macro expansion toSyntaxEditor.#22310removeSourceChangeBuilder::make_mut.#22307removeted-basedincrease_indentanddecrease_indent.#22256addSyntaxEditorversion ofwrap_in_tree_list.
See also the changelog post.
2026-05-04
Commit: f04c372
Release: 2026-05-04 (v0.3.2887)
New Features
#22238,#22239,#22253(first contributions) addmismatched-array-pat-lenandunused-must-usediagnostics.#22186diagnose trait errors 🎉.#22144,#22168,#22145,#22156,#22197,#22193,#22202addtype-must-be-known,generic-default-refers-to-self,invalid-lhs-of-assignment,pattern-arg-in-extern-fn,non-exhaustive-record-exprandunion-expr-must-have-exactly-one-fielddiagnostics.#21987add initial support forgenblocks.#22178allow renaming of elided lifetimes.#22132,#22210add.newpostfix completion based on expected type.#22179addunwrap_blockassist.
Performance Improvements
#22078(first contribution) store parse errors into a side table.#22192keep nonce when cloningRootDatabase.#22187don't internAdtDef.#22189,#22131,#22133drop someArcs.
Fixes
#22098(first contribution) avoid importing prelude paths whenimports.preferPreludeis disabled.#22134,#22195port pattern inference fromrustc.#22141bring type inference closer torustc.#22135suppress inference variables in monomorphization.#22214visit all expressions.#22169parseimplrestrictions after visibility.#22170parsereturn #[attr] expr.#22124don't pick animpl Traitblock ingenerate_function.#22166fix placement of async closure capture hints.#22183propagate ABI to functions declared in extern blocks.#22201improve parser recovery in(a, , b).#22058improveprettify_macro_expansion.#22229add parentheses inconvert_match_to_let_else.#22142don't offer completions for already importedTrait as _.#22154don't completewhereafter qualified paths.#22222emitelseclause in value postfix completions.#22240improve indentation in trait item completion.#22244handle cycles inexpand_glob_import.#22150offeris_some_andandis_none_orinapply_demorgan_iterator.#22151handle negation inapply_demorgan_iterator.#22247handle match arms inunwrap_branch.#22217add semicolon after expression inunwrap_branch.#22184offerunwrap_branchon non-block match arms.#22180offerreplace_arith_opon compound assignments.#22199offerconvert_to_guarded_returnonifexpression withelse ifclause.#22079handleif matches!()inreplace_if_let_with_match.#22215fix a stack overflow when displaying projections.#22265fix panic onimpl ?Sizedinintroduce_named_type_parameter.#22207fix some issues inlower_coroutine_body_with_moved_arguments.#22122be more resilient to deleted directories inAnalysis::from_single_file.
Internal Improvements
#22129lower non-destructuring assignments intoPat::Exprinstead ofPat::Path.#22146clean up string references in postfix completions.#22190ignore a test that might be hanging.#22232refactor thehir-tygenerics data structures.#22194refactorInternedCoroutineClosureId.#22221fix incorrect offset with multiple indels.#22121migrateextract_functionassist toSyntaxEditorand remove old version ofgenerate_impl.#22125,#22020,#22159migratereplace_qualified_name_with_use,inline_callandgenerate_functionassists toSyntaxEditor.#22137migrateconvert_into_to_fromassist toSyntaxEditorand replace some usages ofmod_path_to_ast.#22241migrateinsert_useandinsert_use_as_aliastoSyntaxEditor.#22245migrateAssocItemList::add_itemtoSyntaxEditor.#22243replaceast::makewithSyntaxFactoryinto_generic_args.#22246removeWhereClause::add_predicate.#22242remove some unused methods inedit_in_place.
See also the changelog post.
2026-04-27
Commit: 8954b66
Release: 2026-04-27 (v0.3.2878)
New Features
#21979rename variables in constructors when renaming a field.
Fixes
#22116(first contribution) mark enum variants as deprecated when parent enum is deprecated.#22101port call expression type checking and closure upvar inference fromrustc.#22107improve "Go to definition" on comparison operators.#22085reduce relevance of deprecated items.
Internal Improvements
#22054(first contribution) de-duplicate lints.#22104don't check solver's cache validity on every access.#22105migratewrap_unwrap_cfg_attrassist toSyntaxEditorand replaceast::makewithSyntaxFactoryin few handlers.#22111group unstable features in a struct.
See also the changelog post.
2026-04-20
Commit: adef948
Release: 2026-04-20 (v0.3.2870)
New Features
#21906exclude dependency and standard library results from reference search.#21740support#[rust_analyzer::prefer_underscore_import]to import traitsas _.
Fixes
#22031(first contribution) demoteimplcompletions when an inherentimplblock already exists.#22083(first contribution) respect#[deprecated]when deciding if aModuleDefcompletion is deprecated.#22046(first contribution) add parser support for unstabletype constitems.#22022add parser support forimplandmutrestrictions.#22096useProofTreeVisitorfor unsized coercion.#22025don't add extra dereference after indexing inextract_function.#22044don't complete unstable items that are gated by an internal feature.#22003complete variants of hidden enums through public aliases.#21999fix ref-completion with keyword prefix.#22018enable completions inside strings in VS Code.#22032allow ambiguity in associated type shorthands if they resolve to the same associated type from a supertrait.#22087fix incorrect lifetime hints withself: Selfparameter.#22066recognize#[std::prelude::vX::test].#21487offerextract_variablein macro calls.#22067add parentheses on record literals inreplace_let_with_if_let.#22030fix MIR evaluation of sized &T with recursive const functions.#22073fix panic on empty comments inconvert_comment_block.#22077fix a panic inreplace_if_let_with_match.#22055fixes someupvars_mentionedissues.#22070handle name conflicts inextract_type_aliasa little better.
Internal Improvements
#21835addhir::Type::{as_raw_ptr,is_mutable_raw_ptr}.#22092synchronize function call argument check fudging withrustc.#22048bumprustccrates.#22061bumpsalsa.#22050represent lower coroutines to closures.#22049,#22069store aSyntaxFactoryinsideSyntaxEditor.#22043,#22095,#22042,#22039replaceast::makewithSyntaxFactoryinraw_string,convert_range_for_to_while,expand_glob_importandgenerate_blanket_trait_impl.#22091,#22036migrategenerate_impl_textandIdentPat::set_pattoSyntaxEditor.#22081migrateconvert_iter_for_each_to_forassist toSyntaxEditor.#22037removeset_visibility.#22041removeGenericParamsOwnerEdit.#22057removeclone_for_updatefrommove_const_to_impl.#22063removeLineIndexDatabase.#22065fix new Clippy lints.#22084slim downMiniCoreDebugoutput.#22074supportRUSTFMT_TOOLCHAINforxtask codegen.#22029,#22028runrustdocGitHub action on PRs.
See also the changelog post.
2026-04-13
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 tocargo metadata.#21012,#21982complete->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) loadrust-analyzer.tomlin virtual workspaces.#21965improve handling of+#[cfg_attr]+and+#[cfg]+.#21973take path context into account inImportAssets.#21962fixSyntaxEditorupmapping of nodes with mapped ancestors that aren't mapped themselves.#21981emit diagnostic for#![cfg]ed out crates.#21977disable the fix formissing-fieldswhen the fields are private.#22009,#22012fix spurious import completions in qualified paths with type anchors.#21955add semicolon for postfixprint!-like completions.#21971check coercion, not unification, in "Fill struct fields".#21953improve type mismatch "AddSome" fix on block-like expressions.#21952improve type mismatch fixes inside macro calls.#21920improveadd_missing_match_armslabels.#21957improveonEnter.#22010fixrustfmtwith relative custom command.#21738fix stale diagnostics with customcheckcommand.#21969refrsh workspace when adding a Cargo config.
Internal Improvements
#21988,#22011,#21998add workflow to update generated lints.#21996migrateextract_struct_from_enum_variantassist toSyntaxEditor.#21993replacemake::trait_withSyntaxFactoryingenerate_trait_from_impl.#21997replacemakeconstructors withSyntaxFactoryingenerate_single_field_struct_from.#21975handle token mutability inSyntaxEditor.#21960moveSyntaxEditorprecondition handling to its constructor.#21972remove some redundantclone_subtrees.#21967deriveClone, Copy, Hashforvfs::ChangeKind.#21963bump ESLint and TypeScript.#21986fixRecursiveMemoryLayoutNodefield names in the Code extension.#21985use official npm registry for the Code extension dependencies.
See also the changelog post.
2026-04-06
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.#19956implement#[feature(more_qualified_paths)].#21322add option to put type hints at the end of the line.#19659add support for folding ranges in chained expressions.#21516publish universal VSIX without a built-in server binary, for unsupported platforms.
Fixes
#21792(first contribution) makematching_bracework 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.#21915fix a cycle in bounds lowering.#21935support#[cfg]on array elements.#21926handle empty expressions in parameter inlay hints.#21937wrap guard in parentheses inreplace_if_let_with_match.#21938fix indent inconvert_let_else_to_match.#21954handle emptyelseblock inconvert_let_else_to_match.#21951report "expected type, found{" in parser.#21695match trait item order intrait_impl_redundant_assoc_item.#21936handle comma at the end of argument inextract_variable.#21902supportenv!completions in nested macro calls.#21903handle negation inifpostfix completion.#20864fix naming ofselfparameter inextract_function.#21919support labels inconvert_to_guarded_return.#21912support tail expressions inconvert_to_guarded_return.#21940support multiple snippet placeholders in VS Code extension.#21921unconditionally pass--include-ignoredfor test runnables.#21922use the correct project root when there are multiple workspaces.#21844support file systems that don't sendCreateevents.#21881fix missing argument error messages forsched_getaffinityandgetenvshims.
Internal Improvements
#21944removeRootQueryDb.#21931move node mutability handling toedit_algo.#21886replacemakeconstructors withSyntaxFactoryingen_trait_fn_body.#21930refactoradd_missing_impl_membersto use more ofSyntaxFactory.#21909allow disabling fixture support.#21933ensure tracing is configured in slow tests.#21806document when crate cycles can occur.#21923set VS Code extension kind explicitly.#21916bump@vscode/vsceandovsx.
See also the changelog post.
2026-03-30
Commit: f1297b2
Release: 2026-03-30 (v0.3.2845)
Fixes
#21588(first contribution) fixasm!symoperand parsing for parenthesizedexprfragments.#21871revertTyLoweringContext::storeafter lowering parent defaults.#21876keep value when trying to produce adefaultcall.#21904fix panic on trailing|inunmerge_match_arm.#21838skip usages inside macro expansions indestructure_{struct,tuple}_binding.#21744keep comments inadd_missing_match_arms.#20681fix indent after fixingtrait_impl_redundant_assoc_item.#21411offermerge_match_armson ambiguous identifier patterns.#21709fix spurious flychecks with multiple workspaces.
Internal Improvements
#21874(first contribution) migrategenerate_default_from_newassist toSyntaxEditor.#21879(first contribution) fix bounds check indebug_assert!.#21823,#21859,#21900implement signature type inference.#21901,#21907only allocate non-empty item blocks.#21897removeArcfromGenericParamsandAstIdMap.#21872renameIndentLevel::singletozero.#21856,#21867,#21866,#21870,#21884replacemakeinreplace_derive_with_manual_impl,generate_impl,generate_new,generate_trait_impl_text_intransitiveandgetterwithSyntaxFactory.#21853extractdefault_fill_exprtoutils.#21862don't trigger GC on slow tests, take 2.
See also the changelog post.
2026-03-23
Commit: b42b63f
Release: 2026-03-23 (v0.3.2836)
New Features
#21395changetest_nameplaceholder toexecutable_arg.
Fixes
#21784remove angle brackets if all lifetime args removed in inline type alias code assist.#21817fix overlapping edits inconvert_named_struct_to_tuple_structandconvert_tuple_struct_to_named_struct.#21333fix expected type analysis for tuple struct patterns.#21424support more runnable kinds inrust-project.json.#20407move out doc comments ingenerate_trait_from_impl.#21768keep qualifiers in function parameter completions.#21756support postfixletcompletions in closures.#21839don't add a second semicolon after postfix completions.#21324improve indentation after postfix completions.#20594fix indentation inconvert_closure_to_fn.#20614offerno_such_fieldfix for empty structs.#20762add fixes fornon_exhaustive_let.#20299name trait after first method ingenerate_trait_from_impl.#21775offerinline_local_variableinlet-chains.#21473offerunwrap_blockonlet-else.#20984offeradd_label_to_looponforandwhileexpressions.#20600offerunwrap_tupleonletexpressions.#21809offerextract_variableon some paths.#21822offeradd_missing_match_armson commas between arms.#21850offeradd_braceson assignments.#20628support nested lifetimes inadd_lifetime_to_type.#20625support multiple attributes inwrap_unwrap_cfg_attr.#20566support partial selections inmerge_imports.#21787keep extra predicates inreplace_is_method_with_if_let_method.#21828prime caches in parallel inscip.
Internal Improvements
#21843(first contribution) migrateconvert_from_to_tryfromassist toSyntaxEditor.#21847migratequalify_method_call,qualify_pathanddesugar_try_exprassists toSyntaxEditor.#21832use mappings inSyntaxFactoryconstructor methods.#21826replaceast::makewithSyntaxFactoryin a fewide-assistsmethods.#21848ignore mapping inexpr_underscore.#21779fix printing of IR types.#21827don't trigger GC on slow tests.#21795fixtest_loading_rust_analyzerwhen rust-project.json is present.#21796add codecov.io badge.
See also the changelog post.