Skip to content

Releases: rust-lang/rust-analyzer

2023-07-17

17 Jul 05:17
Compare
Choose a tag to compare

Changelog #190

Commit: d824511
Release: 2023-07-17 (v0.3.1591)

Fixes

  • #15248 fix eager token mapping panics.
  • #15297 normalize type alias in projected_ty.
  • #15258 support getrandom syscall in MIR.
  • #15268 add write_bytes and ctlz intrinsics.
  • #15282 add type_name intrinsic and give real discriminant_type to chalk.
  • #15284 add sched_getaffinity and enable cfg(miri) in analysis.

Internal Improvements

  • #15257 (first contribution) ignore Content-Length header case in lsp-server.
  • #15270 (first contribution) make fields of mir::Terminator public.
  • #15292 (first contribution) fix typo in command line help.
  • #15295 (first contribution) fix rust-analzyer ssr help message.
  • #15251 skip building subtrees for built-in derives.
  • #15231, #15260 migrate more assists to use the structured snippet API.
  • #15263 enable derive feature for serde in lsp-server.
  • #15267 mark MIR execution limit test as slow.
  • #15252 enable useUnknownInCatchVariables TypeScript option.
  • #15259 use type imports.
  • #15254 add FIXME for exactOptionalPropertyTypes.
  • #15264, #15265 bump npm dependencies.
  • #15266 set .editorconfig default indent size to 4.
  • #15275 default to stable toolchain in the metrics workflow.

See also the changelog post.

2023-07-10

10 Jul 05:39
Compare
Choose a tag to compare

Changelog #189

Commit: ff15634
Release: 2023-07-10 (v0.3.1583)

New Features

  • #15081 (first contribution) add a memory layout viewer:

    Screenshot showing a memory layout view for a struct with i32, u8, Vec<bool> and usize fields.

  • #15152 add Generate trait from impl assist:

    Screen recording showing the assist generating a trait from an impl block

  • #14990 map our diagnostics to the rustc and clippy ones.

  • #15186 don't add panics to error jump list by default.

Fixes

  • #15118 (first contribution) follow raw pointers in autoderef chain when resolving methods with custom receiver.
  • #15235 (first contribution) don't insert semicolon when extracting match arm.
  • #15226 make Expand glob import work on enum imports.
  • #15211 support GATs in bounds for associated types.
  • #15223 don't show unresolved-field diagnostic for missing names.
  • #15216 don't mark braces around self imports as unnecessary.
  • #15212 recover from missing associated items and generic const defaults.
  • #15245 fix missing terminator in pattern matching of consts.
  • #15222 fix size_of_val and support min_align_of_val intrinsic.
  • #15244 support read_via_copy intrinsic.
  • #15228 implement recursion in MIR interpreter without recursion.
  • #15230 use Debug impl for const eval result rendering.
  • #15227 indent after pressing enter on a blank line.

Internal Improvements

  • #15202 don't diagnose built-in derives.
  • #15204 add analysis-stats flag to trigger some IDE features.
  • #15149 speed up line index calculation via SSE2.
  • #15219 unify Generate getter and setter assists.
  • #15205 split out project loading capabilities from the rust-analyzer crate.
  • #15203 shuffle some proc_macro_expand query things around.
  • #15209 use stronger typing for AstId and AstIdMap.
  • #15181 clean up ImportMap.
  • #15210 remove CfgExpander.
  • #15206 format let-else.
  • #15224 replace x with it.
  • #15160 enable noUncheckedIndexedAccess and noPropertyAccessFromIndexSignature TypeScript options.
  • #15234 remind user to check PATH after installation.

See also the changelog post.

2023-07-03

03 Jul 05:49
Compare
Choose a tag to compare

Changelog #188

Commit: ff485b6
Release: 2023-07-03 (v0.3.1575)

New Features

  • #15136 (first contribution) drop matching brace key binding.
  • #15185 bump chalk.
  • #15151 update VS Code extension dependencies and require 1.78.

Fixes

  • #15148 fix self and super path resolution in block modules.
  • #15157 fix runnable detection for #[tokio::test].
  • #15173 fix data layout of reference to nested unsized structs.
  • #15184 disable MIR interpreter for targets with different pointer size from host.
  • #15168 fix MIR realloc allocating a smaller destination.
  • #15189 fix overflow checking in shift operator.
  • #15194 fix layout of SIMD types and respect alignment in MIR interpreter.
  • #15101, #15177, #15180 check client workspace.workspaceEdit.resourceOperations capability.
  • #15138 rename runnableEnv to runnables.extraEnv.

Internal Improvements

  • #15030, #15163 (first contribution) run metrics on parallel.
  • #15172 support #[derive_const(Trait)].
  • #15140 add comment explaining why HasSource::source() returns Option.
  • #15161 add library fixture meta.
  • #15175 drop cross-env npm dep.
  • #15174 switch to @vscode/vsce.
  • #15153 clean up Code extension activationEvents.
  • #15154 use @tsconfig/strictest for type checking rules.
  • #15159 enable noImplicitOverride.
  • #15169 use anonymous lifetime where possible.
  • #15142 rename crates after removing libs from workspace.
  • #15195 don't specify proc-macro-test version.

See also the changelog post.

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.