Releases: rust-lang/rust-analyzer
nightly
Merge pull request #22112 from WeiTheShinobi/simplify_drop_may_danble…
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.
2026-03-16
Commit: 90c8906
Release: 2026-03-16 (v0.3.2828)
Fixes
#21793(first contribution) handle multi-byte UTF-8 identifiers inNameGenerator::suggest_name.#21767remove crate fromEditionedFileId.#21785allow duplicate associated type shorthand resolution if it points to the same associated type.#21820infer generic args forTraitRefand its associated types.#21794validate naming convention for union types.#21771make file watcher recursive.
Internal Improvements
#21818refactorMirLowerCtxto use&ExpressionStoreinstead of&Body.#21788don't re-query source roots per-crate inanalysis-stats.#21804disambiguate error messages whenproc-macro-srvchanges the working directory.
See also the changelog post.
2026-03-09
Commit: 51966da
Release: 2026-03-09 (v0.3.2819)
New Features
#21752go toFromimpl when on "Go to definition" for?.
Fixes
#21745fix a bug in associated type lowering.#21750don't useTypingMode::PostAnalysisfor IDE method resolution.#21747allow never coercions in struct update syntax.#21726alignis_rustABI check withrustc.#21705support expressions incfg_select!.#21728use correct range foradd_missing_match_armsin macro calls.#21719improve formatting inreplace_if_let_with_match.#21687offerdestructure_struct_bindingonselfparameters.#21671complete postfixleton references inmatcharms.#21770update VFS when a watched file is deleted.#21763tweak-Zlockfile-pathpre-release check forbeta.
Internal Improvements
#21782(first contribution) addrust-analyzer parse --json.#21755(first contribution) addhas_pendingmethods toIncoming/Outgoing/ReqQueueinlsp_server.#21764improvesmol_strAPI surface in anticipation for1.0.0.#21774migrateunqualify_method_callassist toSyntaxEditor.#21734replaceast::makein already migrated assists.#21660set upcodecov.#21732define rules for LLMs.
See also the changelog post.
2026-03-02
Commit: 566fe41
Release: 2026-03-02 (v0.3.2811)
Fixes
#21699enable diagnostic for adding auto traits by casting*dyn Tr.#21654mark the RHS of compound assignments asExprIsRead::Yes.#21725fix wrong condition inVisibility::min.#21669supportSpan::parentin proc macro expansion.#21716use-Zlockfile-pathon pre-release 1.95 toolchains as well.#21708don't panic on invalid LSP notifications.#21706don't duplicate enum variants in pattern completion.#21698fix scrutinee indent inreplace_if_let_with_match.
Internal Improvements
#21710,#21720(first contribution) migratefix_visibilityandgenerate_deriveassists toSyntaxEditor.#21681skiprustfmttest if nightly toolchain is missing.
See also the changelog post.
2026-02-23
Commit: 0c746f6
Release: 2026-02-23 (v0.3.2803)
Fixes
#21635(first contribution) improve#[cfg]handling when inserting or merging imports.#21665(first contribution) don't qualify parameter names inadd_missing_impl_members.#21675(first contribution) exclude references in macro calls inside tests whenexcludeTestsis enabled.#21664handle cycles insizedness_constraint_for_ty.#21652,#21692fix predicates of built-in derive traits with two parameters defaulting toSelf.#21655complete derive helpers on empty namerefs.#21594complete postfixletandletmin match arms.#21600complete postfixleton block tail expression.#21650don't complete suggested parameters in complex patterns.#21536offertoggle_macro_delimiterin nested macro calls.#21623offerreplace_is_method_with_if_let_methodonis_some_and.#21684pick the enclosing instead of first impl block ingenerate_function.#21688correctly parenthesize inverted condition inconvert_bool_then.#20353support selecting only a subset of fields ingenerate_getter_or_setter.#21389handle references better inconvert_to_guarded_return,replace_if_let_with_matchandreplace_let_with_if_let.#21657supportSpan::span_sourcein proc macro expansion.
Internal Improvements
#21631refactor handling of associated type shorthands.#21630useCARGO_RESOLVER_LOCKFILE_PATHfor lockfile copies on1.95and later.#21643replaceedit_in_place::Indentingenerate_impl.#21661,#21666add integration tests for flycheck.
See also the changelog post.