Skip to content

Releases: rust-lang/rust-analyzer

2024-08-12

12 Aug 05:10
Compare
Choose a tag to compare

Commit: 0daeb5c
Release: 2024-08-12 (v0.3.2070)

New Features

  • #17791 add diagnostic for await outside of async.
  • #17795 load sysroot library via cargo metadata (for toolchains after 176e54520 2024-08-04).
  • #17775, #17824 segregate syntax and semantic diagnostics to improve latency.
  • #17771 load VFS config changes in parallel.

Fixes

  • #17802 supress type mismatches in calls with mismatched argument counts.
  • #17823 attach unconfigured diagnostics to the right file for modules.
  • #17784 support inlay hints for more expressions with labels.
  • #17844 respect non-std preference in find_path.
  • #17805 fix panic in path_transform with default type parameters.
  • #17813 fix type equality check for non-ADT types in usage search.
  • #17832 fix panic while rendering function type hint with impl Trait parameters.
  • #17818 support .rust-project.json in addition to rust-project.json.

Internal Improvements

  • #17825 offload diagnostics serialization to the task pool.
  • #17794 turn ErasedFileAstId into a newtype.
  • #17821 remove unnecessary CfgFlag definition in project-model.
  • #17809 include vendored crates in StaticIndex.
  • #17831 merge flycheck into the main rust-analyzer crate.
  • #17799 split out syntax-bridge into a separate crate.
  • #17772 reorganize debug.ts.
  • #17745, #17827 add missing repository and description fields to the crate manifests.
  • #17793 suggest installing the MSVC Redistributable in the manual.

See also the changelog post.

2024-08-05

05 Aug 04:46
Compare
Choose a tag to compare

Commit: c9109f2
Release: 2024-08-05 (v0.3.2062)

New Features

  • #17707 use spans for built-in and declarative macro expansion errors.
  • #17735 introduce workspace-level rust-analyzer.toml.

Fixes

  • #17750 don't require absolute paths in linkedProjects.
  • #17715 let glob imports override other globs' visibility.
  • #17747 fix inference for method calls with elided lifetimes.
  • #17755 apply IndexMut obligations for non-assigning mutable usages.
  • #17741 make include! work with raw string literals.
  • #17763 insert a tail Ok(()) in type mismatch quick fix.
  • #17736 show async in trait method completions.
  • #17789 insert a generic args for impl Trait during lowering.
  • #17742 don't retry inlay hint and code lens requests.

Internal Improvements

  • #17705 (first contribution) use oldest rustup rust-analyzer when toolchain override is present.
  • #17722 use VS Code logging helpers.
  • #17770 remove TryFrom implementation for AbsPathBuf.

See also the changelog post.

2024-07-29

29 Jul 05:25
Compare
Choose a tag to compare

Commit: fd74511
Release: 2024-07-29 (v0.3.2053)

New Features

  • #17542 Support "Go to definition" and "Find all references" on control flow keywords.
  • #17676 add preliminary support for the + use<..> precise_capturing syntax.

Fixes

  • #17511 (first contribution) fix trait solving with Deref as a supertrait.
  • #17472 (first contribution) filter run unit tests by crate when running them.
  • #17660 fix again the path resolution for included submodules.
  • #17706 fix include!s with expr fragment inputs.
  • #17586 allow macro expansions into RestPat in tuple args.
  • #17697 support the new cargo config get env format.
  • #17709 fix hover links.
  • #17713 fix panic on unresolved index fields.
  • #17720 flip the naming of the doc-comment to comment assist.

Internal Improvements

  • #17675 (first contribution) remove the lens.forceCustomCommands config.
  • #17670 enable LRU for the body_with_source_map query.
  • #17671 shrink Binding.
  • #17695 shrink TypeRef by 8 bytes.
  • #17693 remove params and fields from AstIdMap.
  • #17668 remove incorrect never! invocations for async functions.
  • #17647 rename internal rust-analyzer commands.
  • #17698 remove unused trace module.
  • #17690 fix and enable unsafe_op_in_unsafe_fn.
  • #17483 improve rust-analyzer.toml error reporting.
  • #17667 use the rustup rust-analyzer component when rust-toolchain.toml exists.
  • #17610 add Impl::all_in_module(…) for more localized querying.
  • #17674 add version and config to the Status command.
  • #17395 remove UnindexedProject notification.

Others

See also the changelog post.

2024-07-22

22 Jul 05:08
Compare
Choose a tag to compare

Commit: 4afe0d5
Release: 2024-07-22 (v0.3.2045)

New Features

  • #17588 (first contribution) add incorrect case diagnostics for enum variant fields and all variables/params.
  • #17620, #17640, #17646 make parser edition-aware.
  • #17635 add inlay hint support for lifetime labels in block expressions.
  • #17246 teach rust-analyzer to discover linked_projects.

Fixes

  • #17650 (first contribution) fix path resolution for child modules of those expanded by include!.
  • #17587 trigger a rename in VS Code "Extract variable".
  • #17649 be more robust to type errors in match analysis.
  • #17656 allow flyimport to import modules that shadow a primitive.
  • #17653 prefer standard library paths over shorter extern re-exports.
  • #17611 don't call macro_arg directly in ExpandDatabase::syntax_context.
  • #17622 handle renaming in "Merge imports".
  • #17605 set RUSTC_TOOLCHAIN for runnables.

Internal Improvements

  • #17584, #17603, #17604 implement symbol interning.
  • #17657 make CfgExpr slightly smaller.
  • #17638 reduce memory usage of salsa slots by 8 bytes.
  • #17639 some more salsa memory improvements.
  • #17559, #17601 encode ident rawness and literal kind separately in tt::Leaf.
  • #17655 more find_path improvements.
  • #17618 support rustc_skip_during_method_dispatch.
  • #17617 derive syntax kind information from ungrammar file.
  • #17637 remove rust-analyzer.openFAQ command.
  • #17616 fix incorrect generic parameter hint defaults.
  • #17641 don't take references in format_args! and friends.

See also the changelog post.

2024-07-15

15 Jul 05:38
Compare
Choose a tag to compare

Commit: e9afba5
Release: 2024-07-15 (v0.3.2037)

New Features

  • #17544 (first contribution) add inlay hints for generic parameters.
  • #17572 add f16 and f128 support.

Fixes

  • #17558 (first contribution) fix double rounding of f32 literals.
  • #17571 do not add duplicate enum in "bool to enum".
  • #17561 add --keep-going to the check command.

Internal Improvements

  • #17565 drop version check for --keep-going (drops support for pre-1.74).
  • #17576 remove FAQ landing page, improve main one.

See also the changelog post.

2024-07-08

08 Jul 09:15
Compare
Choose a tag to compare

Commit: a5b21ea
Release: 2024-07-08 (v0.3.2029)

New Features

  • #17508 add walkthrough and FAQ pages.

Fixes

  • #17523 (first contribution) add an option to use :: for the external crate prefix.
  • #17529 fix lifetime parameters shifting parameter defaults.
  • #17534 skip match exhaustiveness checking if pattern type contains errors.
  • #17536 don't emit semantic diagnostics in files with a lot of syntax errors.
  • #17552 use original source ranges in macro parameter completions.
  • #17554 fix callHierarchy LSP violation.
  • #17541 fix stack overflow on recursive calls with impl Trait.
  • #17494 don't normalize use foo::{self} to use foo.
  • #17546 diagnose unresolved self value in path expressions.
  • #17549 fix runnable construction.
  • #17495, #17548 pass extra Cargo args when debugging.

Internal Improvements

  • #17522 bump rustc_pattern_analysis.
  • #17551 set InferenceResult::has_errors on error types.
  • #17526 improve error message when the proc macro server unexpectedly exits.
  • #17535 fix up the syntax tree for macro 2.0.
  • #17547 clean up runnable LSP extension.
  • #17555 inline generated syntax methods.
  • #17553 move remaining codegen things to xtask codegen.
  • #17530 move lifetimes in front of type and const params.
  • #17527 move capability querying out of the config module.

See also the changelog post.

2024-07-01

01 Jul 05:06
Compare
Choose a tag to compare

Commit: ea7fdad
Release: 2024-07-01 (v0.3.2020)

Fixes

  • #17467 (first contribution) allow "Bool to enum" assist on function parameters.
  • #17505 fix stack overflow with TAITs.
  • #17481 allow pattern completions in let statements.
  • #17471 keep parentheses for calls of function-like fields.
  • #17513 fix completions after async.
  • #17518 fix expression scope calculation in macro expansions.
  • #17488 fix duplicate snippets showing up on hover.
  • #17516 allow disabling borrow checking in term search and don't emit explicit generics.
  • #17411 improve hover text in unlinked file diagnostics.

Internal Improvements

  • #17478 simplify and speed up data constructor term search tactic.
  • #17487 small memory usage optimizations.
  • #17519 move dylib version testing to proc-macro-srv.
  • #17520 some proc-macro-srv clean-ups.
  • #17501 allow non-org members to assign area labels.

See also the changelog post.

2024-06-24

24 Jun 05:05
Compare
Choose a tag to compare

Commit: 2fd803c
Release: 2024-06-24 (v0.3.2011)

New Features

  • #17438 (first contribution) add Toggle LSP Logs command.

Fixes

  • #17419 (first contribution) don't expand built-in macros in Expand macros recursively.
  • #17431 add space after specific keywords in completion.
  • #17459 include async keyword in completions.
  • #17442 handle end of input in pat fragment parsers.
  • #17415 only show unlinked-file diagnostic on first line during startup.
  • #17426 handle character boundaries for wide chars in extend_selection
  • #17457 actually prevent cycles in the source_root_parent_map.
  • #17461 fix panic when cancelling flycheck.
  • #17462 fix IDE features breaking in some attribute macros.
  • #17469 handle ItemInNs::Macros when converting ModuleItem to ItemInNs.
  • #17449 add associated item constants tactic for term search.
  • #17439, #17464 properly prime all crate def maps in parallel_prime_caches.
  • #17440 fix and cleanup VS Code task building.

Internal Improvements

  • #17434 (first contribution) document for parameter inlay hints heuristics.
  • #17456 (first contribution) remove conflict warning with panicbit.cargo.
  • #17473 tidy up generics handling in hir-ty.
  • #17474 avoid some allocations in hir-ty.
  • #17455 tidy up the VS Code extension a bit.
  • #17435 fix manual generation instructions.

See also the changelog post.

2024-06-17

17 Jun 04:43
Compare
Choose a tag to compare

Commit: 6b8b8ff
Release: 2024-06-17 (v0.3.2002)

New Features

  • #17372 compute native diagnostics in parallel.
  • #17364 show type bounds from containers when hovering on functions.
  • #17374 allow choosing logical cores for cache priming threads.
  • #16840 allow arbitrary commands for runnables in rust-project.json.

Fixes

  • #17412 (first contribution) add a breaker to avoid infinite loops with source root cycles.
  • #17381 ensure that a SourceRoot cannot be its own parent.
  • #17380 remove again extra parse cache from Semantics.
  • #17394 fix HirDisplay stack overflow for Self parameter defaults.
  • #17407 avoid doubling Cargo args in runnables.

Internal Improvements

  • #17405, #17406 avoid unnecessary ModPath clones.
  • #17377 improve HIR formatting.
  • #17392 rename ${length()} to ${len()} in MBE.
  • #17398 remove FileId::BOGUS.
  • #17418 fix rustdoc warnings.
  • #17417 prefer a trait over the impl_intern_value_trivial macro.

See also the changelog post.

2024-06-11

11 Jun 07:52
Compare
Choose a tag to compare
Auto merge of #17381 - roife:fix-issue-17378, r=Veykril

fix: ensure that the parent of a SourceRoot cannot be itself

fix #17378.

In `FileSetConfig.map`, different roots might be mapped to the same `root_id` due to deduplication in `ProjectFolders::new`:

```rust
// Example from rustup
/Users/roife/code/rustup/target/debug/build/rustup-863a063426b56c51/out
/Users/roife/code/rustup
```

In `source_root_parent_map`, r-a might encounter paths where their SourceRootId (i.e. `root_id`) is identical, yet one the them is the parent of the another. This situation can cause the `root_id` to be its own parent, potentially leading to an infinite loop.

This PR resolves such cases by adding a check.