Skip to content

Releases: rust-lang/rust-analyzer

nightly

05 May 01:12
91c7c2c

Choose a tag to compare

nightly Pre-release
Pre-release
Merge pull request #22284 from xitep/master

Backwards compatible CompletionImport#as_underscore

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.

2026-03-16

16 Mar 05:35
90c8906

Choose a tag to compare

Commit: 90c8906
Release: 2026-03-16 (v0.3.2828)

Fixes

  • #21793 (first contribution) handle multi-byte UTF-8 identifiers in NameGenerator::suggest_name.
  • #21767 remove crate from EditionedFileId.
  • #21785 allow duplicate associated type shorthand resolution if it points to the same associated type.
  • #21820 infer generic args for TraitRef and its associated types.
  • #21794 validate naming convention for union types.
  • #21771 make file watcher recursive.

Internal Improvements

  • #21818 refactor MirLowerCtx to use &ExpressionStore instead of &Body.
  • #21788 don't re-query source roots per-crate in analysis-stats.
  • #21804 disambiguate error messages when proc-macro-srv changes the working directory.

See also the changelog post.

2026-03-09

09 Mar 05:33
51966da

Choose a tag to compare

Commit: 51966da
Release: 2026-03-09 (v0.3.2819)

New Features

  • #21752 go to From impl when on "Go to definition" for ?.

Fixes

  • #21745 fix a bug in associated type lowering.
  • #21750 don't use TypingMode::PostAnalysis for IDE method resolution.
  • #21747 allow never coercions in struct update syntax.
  • #21726 align is_rust ABI check with rustc.
  • #21705 support expressions in cfg_select!.
  • #21728 use correct range for add_missing_match_arms in macro calls.
  • #21719 improve formatting in replace_if_let_with_match.
  • #21687 offer destructure_struct_binding on self parameters.
  • #21671 complete postfix let on references in match arms.
  • #21770 update VFS when a watched file is deleted.
  • #21763 tweak -Zlockfile-path pre-release check for beta.

Internal Improvements

  • #21782 (first contribution) add rust-analyzer parse --json.
  • #21755 (first contribution) add has_pending methods to Incoming/Outgoing/ReqQueue in lsp_server.
  • #21764 improve smol_str API surface in anticipation for 1.0.0.
  • #21774 migrate unqualify_method_call assist to SyntaxEditor.
  • #21734 replace ast::make in already migrated assists.
  • #21660 set up codecov.
  • #21732 define rules for LLMs.

See also the changelog post.