Skip to content

Releases: rust-lang/rust-analyzer

2023-06-26

26 Jun 05:45
Compare
Choose a tag to compare

Changelog #187

Commit: 4a2ceef
Release: 2023-06-26 (v0.3.1566)

New Features

  • #14948 add "generate delegate impl" assist:

    Screen recording showing the assist generating code that delegates a trait implementation to a field.

  • #15116 remove Markdown injection grammar.

Fixes

  • #15105 (first contribution) fix display of negative integers.
  • #15074 fix inlining of async functions.
  • #15112 support manual implementation of Fn traits in the MIR interpreter.
  • #15119 support more intrinsics in the MIR interpreter.
  • #15135 fix some unsizing problems in MIR.
  • #15085 include project path in workspace loading errors.
  • #15104 skip mutability diagnostics on synthetic bindings.

Internal Improvements

  • #15093 use ArgumentV1 instead of Argument.
  • #15071, #15089 remove spurious regex dependency.
  • #15087, #15097, #15100 use consistent style for error handling.
  • #15086 intern use and extern crate items like other items.
  • #15095 change in-tree libs to workspace dependencies and bump versions.
  • #15098 use lib crates from crates.io.
  • #15070 report metric timings for file item trees and crate def map creation.
  • #15110 add run-tests CLI command.

See also the changelog post.

2023-06-19

19 Jun 05:30
Compare
Choose a tag to compare

Changelog #186

Commit: cd3bf9f
Release: 2023-06-19 (v0.3.1557)

Fixes

  • #15026, #15044 deduplicate fields, and tuple indices in deref handling for completion.
  • #14932 lower const params with a bad id.
  • #15054 use correct const param and default type names in "Implement missing members".
  • #15032 exclude Markdown injection grammar from .vscodeignore.
  • #15040 use a more obscure hasher name in #[derive] expansion.
  • #15075 add binding definition for for-expr iterator desugared binding.

Internal Improvements

  • #15076 shrink size of hir::Binding.
  • #15036 give ConstBlockId and InTypeConstId named Location types.
  • #15047 record file dependencies in crate graph construction.
  • #15053 add a CrateRootModuleId that encodes a module id that is always a crate root.
  • #15058 improve "terminator is none" message.
  • #14693 support Pointee trait.
  • #15065 do not allocate unnecessarily when importing macros from parent modules.
  • #15067 add more context to "overly long loop turn" messages.
  • #15066 analyze all bodies in analysis-stats, not just functions.
  • #15069 add body lowering step, track time of each step separtely.

See also the changelog post.

2023-06-12

12 Jun 05:35
Compare
Choose a tag to compare

Changelog #185

Commit: a4407b4
Release: 2023-06-12 (v0.3.1549)

New Features

  • #14925 (first contribution) add "Inline constant as literal" assist.
  • #15028 give rustfmt jobs a separate thread.

Fixes

  • #14960 (first contribution) add span to token groups.
  • #14974 (first contribution) properly format documentation for SignatureHelpRequests.
  • #14978 emit '_ for lifetime generics in HirDisplay.
  • #15000 only generate derived trait bound for associated types in field types.
  • #15006 fix panic in format_args! expansion.
  • #15012 infer async return type in generate_function.
  • #14875 handle lifetimes in assists.
  • #14989, #15025 derive source scope from syntax node to be transformed.
  • #15019 fix panic in displaying const trait objects.
  • #15022 fix panic in displaying unsized structs.
  • #14998 make eager macros lazier.

Internal Improvements

  • #15005 (first contribution) fix typo in reload.rs.
  • #14980, #14988 sync from downstream.
  • #14984, #14997 bring back the sysroot-abi feature.
  • #14979 migrate some assists to use the structured snippet API.
  • #15014 document the sysroot field in JsonProject.
  • #15020 show query entry counts in memory usage command.
  • #14827 offset version number when auto-publishing.
  • #14994 fix CI to actually run when proc-macro things change.
  • #14995 fix proc-macro slow test.

See also the changelog post.

2023-06-05

05 Jun 06:58
Compare
Choose a tag to compare

Changelog #184

Commit: 2f1b7ce
Release: 2023-06-05 (v0.3.1541)

New Features

  • #14938 add signature help for tuple patterns and expressions:

    Screenshot showing a signature help of (i32, &str, char) for (0, "a", 'c')

  • #14892, #14942 MIR episode 6, separate monomorphization and speed up interpretation.

  • #14905 render niches on hover.

  • #14911 allow setting cfgs (rust-analyzer.cargo.cfgs).

  • #14929 add render configuration for memory layout hovers.

  • #14888 prioritize threads affected by user typing.

Fixes

  • #14935 don't duplicate sysroot crates in rustc workspace.
  • #14939 don't discard file id from differing macro upmapping in nav target calculation.
  • #14947 add enum, reference, array and slice to render_const_scalar.
  • #14952 make assignment operators right associative.
  • #14971 consider outer binders when folding captured items' type.
  • #14912 don't add --all-targets to runnables for no_std or no_core crates.
  • #14945 don't trigger "replace generic with impl trait" assist when it would produce broken code.
  • #14920 fix edits for convert_named_struct_to_tuple_struct.
  • #14950 support floating-point intrinsics in const eval.
  • #14951 fix string pattern matching in mir interpreter.
  • #14955 remove unnecessary StorageDead.
  • #14961 fix drop scopes problems in mir.
  • #14970 detect multiple bindings for one identifier in the same pattern and suppress need-mut.
  • #14972 fix unused-mut false positive for Box.
  • #14976 fix missing terminator for slice pattern.

Internal Improvements

  • #14941 shrink DefMap, share crate level items with block def maps.
  • #14842 improve ast::make.
  • #14969 update built-in attribute list.

See also the changelog post.

2023-05-29

29 May 06:04
Compare
Choose a tag to compare

Changelog #183

Commit: 505fd09
Release: 2023-05-29 (v0.3.1533)

New Features

  • #14866 (first contribution) add Markdown syntax highlighting to doc-comments in VS Code:

    Screenshot showing Markdown highlighting in a block comment

  • #14849 implement symbol search by alias:

    Screen recording of symbol search including aliases

  • #14816 add assist to replace a named generic parameter with impl trait:

    replace-generic.mp4

  • #14916 add diagnostic for incorrect _ expressions:

    Screenshot of an error on `let _s: String = _;

Fixes

  • #14752 (first contribution) fix indentation in generate_derive, add_missing_impl_members and add_missing_default_members.
  • #14878 implement ${count()} metavariable expressions.
  • #14872 introduce new type variable when expectation for ref pattern is not a reference.
  • #14891, #14897 evaluate UnevaluatedConst during unification.
  • #14913 evaluate UnevaluatedConst before trait solving.
  • #14890 use ::core instead of $crate in option_env! expansion.
  • #14893 fix need-mut false positive in closure capture of match scrutinee.
  • #14874 change how #![cfg(FALSE)] behaves on crate root.
  • #14895 don't try to determine type of token inside macro calls.
  • #14904 render size, align and offset hover values in hex.
  • #14906 add a toggle to disable the dependency explorer.
  • #14910 filter out unused cargo features from config.

Internal Improvements

  • #14894 (first contribution) allow overriding the SCIP output path.
  • #14914 (first contribution) update outdated rustup installation instructions.
  • #14859 specify thread types using Quality of Service API.
  • #14880 remove double lookups from Interned.
  • #14881 replace Display impl for Name to support interning.
  • #14889 add context to "overly long loop" message.
  • #14901 move flycheck and config errors to status notification.
  • #14909 run CI on nightly rust when proc-macro-* crates change.
  • #14755 fix a TODO and some Clippy lints.

See also the changelog post.

2023-05-22

22 May 05:17
Compare
Choose a tag to compare

Changelog #182

Commit: 7ac161c
Release: 2023-05-22 (v0.3.1524)

New Features

  • #14775 add #[doc(alias(..))]-based method completions:

    Screenshot showing completion for method aliases

  • #14811 render hover actions for closure captures and signature:

    Screenshot showing a closure hover with 'Go to' links for returned and captured types, and also its signature

  • #14812 highlight used associated trait items when cursor is on trait import or trait bound:

    "Screenshot showing usages of a trait items

  • #14789 add moved-out-of-ref diagnostic:

    Screenshot showing a diagnostic when a local is moved out of a reference

  • #14845 add layout info for enum variant and locals:

    Screenshot showing the size of an enum variant on hover

  • #14837 support C string literals.

  • #14787 MIR episode 5, lower slice patterns and anonymous const blocks.

Fixes

  • #14848 (first contribution) traverse else blocks of let-else in preorder_expr.
  • #14809 support #[macro_use(name, ...)].
  • #14824 diagnose non-value return and break type mismatches.
  • #14825 fix evaluation of negation for floating point types.
  • #14828 process macro_use prelude in semantic scope resolver.
  • #14823 only render discriminant hints for data-carrying enums with primitive repr.
  • #14822 force-disable the augmentsSyntaxTokens capability on VS Code.
  • #14802 fix layout for hir_ty::Ty and friends.
  • #14820 expand format_args! with more details.
  • #14851 handle match scrutinee in closure captures.
  • #14855 consider block impls in lookup_impl_assoc_item_for_trait_ref.
  • #14863 consider all tokens in macro calls when analyzing locals.

Internal Improvements

  • #14746 parse unstable associated return type bounds.
  • #14794, #14818, #14835 restructure InlayHint, no longer derive properties from its kind.
  • #14810 inline handlers module.
  • #14834 do less file parsing for symbol index generation.
  • #14836 bump rustc_lexer.
  • #14843 partially support panic message in MirEvalError.
  • #14847 reduce MIR memory usage.
  • #14857 shrink ProcMacroExpander from 8 to 4 bytes.
  • #14819 fix division by zero in analysis-stats.

See also the changelog post.

2023-05-15

15 May 05:21
Compare
Choose a tag to compare

Changelog #181

Commit: e5c7228
Release: 2023-05-15 (v0.3.1514)

A Note on Today's Release

Because of an infrastructure issue, today's release is not available on the VS Code Marketplace and OpenVSX.
The VSIX can still be downloaded manually from GitHub Releases, and Code should be able to update it automatically in the future.

We hope we can get everything sorted out by next Monday.

New Features

  • #14742 add closure capture inlay hints, disabled by default:

    A screenshow showing capture hints, like move(&mut count) || { count += 1; }

  • #14777 add rust-analyzer.semanticHighlighting.nonStandardTokens setting to control the usage of non-standard tokens and modifiers.

Fixes

  • #14781, #14800 introduce macro sub-namespaces and macro_use prelude.
  • #14727 evaluate consts lazily in path_to_const.
  • #14795 add macro modifier for highlighting tokens in macro calls.
  • #14797 fix perf regression from symbol index refactor.
  • #14801 fix process_changes duplicating change events.
  • #14788 fix derived Debug implementation for unsized structs.

Internal Improvements

  • #14799 (first contribution) remove root component from patched Windows UNC path prefix.
  • #14735 drop canonicalization of paths and normalize all rust-project.json paths.
  • #14808 add metrics for unevaluated constants, failed MIR bodies and failed data layouts.
  • #14747 add more APIs to la_arena::IdxRange.

See also the changelog post.

2023-05-08

08 May 04:56
Compare
Choose a tag to compare

Changelog #180

Commit: 833d530
Release: 2023-05-08 (v0.3.1506)

New Features

  • #11557 (first contribution) add dependency tree explorer:

    Screenshot showing a new VS Code panel with a tree of the project dependencies

  • #14662 (first contribution) support locally-built documentation for experimental/externalDocs with compatible clients.

  • #14664 MIR episode 4, support arithmentic assignment operators, statics, constants in patterns and associated constants in traits.

  • #14711 highlight closure captures when cursor is on | or move.

  • #14732 fix pattern type mismatches for bindings, enable pattern type mismatch diagnostics again.

  • #14725 emit function bodies when expanding built-in derives.

  • #14749 define problem matcher for panics, F8 will go to the panic location in Code.

  • #14758 add rust-analyzer.hover.memoryLayout.enable config for disabling memory layout info on hover.

Fixes

  • #14745 (first contribution) sort dependencies in VS Code tree view.
  • #14707 don't generate already-existing methods on generate_delegate_methods.
  • #14713 don't highlight escapes in raw strings.
  • #14714 exclude Sized from go-to actions in hover.
  • #14705 fix floating point evaluation and try block tracking in MIR.
  • #14712 only pass unstable flags to cargo metadata from extra args config.
  • #14738 use block def maps in body lowering.
  • #14739 parse bare dyn types with leading lifetime.
  • #14750 ignore impls with #[rustc_reservation_impl]
  • #14748 show memory layout type aliases.

Internal Improvements

  • #14716 reduce memory consumption by not merging trait_impls_in_deps results (saves 59 MB on self).
  • #14720 use boxed slices instead of Vecs in declarative macros (saves 8 MB on self).
  • #14718 use triomphe::Arc instead of std::sync::Arc (saves 4 MB on self).
  • #14715 refactor symbol index.
  • #14710 refactor notification handlers.
  • #14733 publish line-index and switch to nohash_hasher.
  • #14757 fix library publish branch filter.

See also the changelog post.

2023-05-01

01 May 06:43
Compare
Choose a tag to compare

Changelog #179

Commit: 3a27518
Release: 2023-05-01 (v0.3.1498)

New Features

  • #14690 add hover for closures:

    Screenshot showing a a closure hover with details about captured fields

  • #14513 add #[doc(alias(..))]-based field and function completions.

  • #14659 de-duplicate crates when extending crate graphs.

  • #14644, #14686 don't underline whole for loops and iterator chains on errors.

Fixes

  • #14647 (first contribution) remove extra rustc argument in target layout loading.
  • #14641 register obligations during path inference.
  • #14652 fix pat fragment handling in the 2021 edition.
  • #14651 fix VS Code workspace root de-duplication.
  • #14689 force InitializeParams path drives to uppercase on Windows.
  • #14667 handle nested types in unwrap_result_return_type.
  • #14671 fix proc-macro-srv path config.
  • #14678 fix "Restart server" button trying to start instead of restart the server.
  • #14639 fix some typos in StructFlags.

Internal Improvements

  • #14648 (first contribution) specify --pre-release when publishing on the Code Marketplace.
  • #14658 remove proc-macro server command from the rust-analyzer binary.
  • #14654 fix status command panicking when additional LRU caches are set up.
  • #14636 remove unnecessary is_derive field from MacroCallKind::Attr.

See also the changelog post.

2023-04-24

24 Apr 05:12
Compare
Choose a tag to compare

Changelog #178

Commit: bc78ebd
Release: 2023-04-24 (v0.3.1489)

New Features

  • #14610 resolve $crate in derive paths.

Fixes

  • #14591 (first contribution) restrict Sort items assist range.
  • #14618 (first contribution) respect editor.parameterHints.enabled after triggering a completion.
  • #14598 fix release channel detection for unstable completion filtering.
  • #14619 fix false need-mut positive and too large span in closures.
  • #14625 fix token conversion for doc-comments.
  • #14634 report remaining macro errors in associated item collection.
  • #14643 fix const eval panic with parameter destructing.
  • #14603 try to de-duplicate workspaces by top level cargo workspace.

Internal Improvements

  • #14577 (first contribution) fix all spelling mistakes.
  • #14621 (first contribution) support type parameters in make::impl_trait.
  • #14622 add syntax::make::ty_alias.
  • #14632 increase LRU cache size for parse_expansion and macro_expand queries.
  • #14633 don't reparse files when trying to expand assoc item macro calls.
  • #14630 replace Arc<String> with Arc<str>.
  • #14594 move Expander and LowerCtx into separate modules.
  • #14604 add minicore smoke test.
  • #14599 add RA_UNSTABLE_SYSROOT_HACK.
  • #14628 restructure symbol queries.
  • #14629 add additional query information to status ouput.

See also the changelog post.