New Features

  • Introduce new intention actions:

    • #7480 Implement Trait to implement a trait for a struct or enum (by @Kobzol)

      This intention action simplifies the writing of trait impls. It automatically fills struct or enum generics, generates implementations of trait members and allows you to change the concrete types of generics.

    • #6838 Convert function to closure to convert a local function to a closure (by @nschoellhorn)

    • #6813 Convert closure to function to convert a closure to a local named function (by @nschoellhorn)

    • #6414 Replace successive '_' with '..' to replace redundant _ patterns with a single .. (by @zeroeightysix)

    • #7559 Simplify dependency specification for dependencies in Cargo.toml

  • Completion improvements:

  • Unused import inspection improvements:

    • #7492 Add a quick fix to remove an unused import (by @Kobzol)

    • #7555, #7535, #7574 Fix false positives related to unresolved method calls, method calls with type qualifiers and usages in custom derive procedural macros

    • #7552 Move Unused import inspection into Rust/Lints inspection group in settings

    • #7538, #7563 Disable Unused import inspection in doctests, add an option in the inspection settings to enable it

    • #7564, #7496 Do not remove unused imports disabled by cfg attribute

    • #7495 Remove unused imports by Optimize Imports action (Code | Optimize Imports or Ctrl+Alt+O) (by @Kobzol)

    Note, the inspection is disabled by default for now due to possible false-positive warnings. You can enable it via Preferences | Editor | Inspections settings

  • #7532 Provide quick-fix to implement missing supertraits for impl block (by @Kobzol)

  • #7519 Add .wrap postfix template that wraps an existing type in another type (by @Kobzol)

  • #7499 Add filter to Structure View panel to hide macro-generated items (by @afetisov)

  • #7521, #7503 Support type aliases for all Rust types in inlay hints and code generation. Previously, only aliases for struct or enum types were accounted (by @Kobzol)

    type aliases

  • #7321 Show macro expansion actions and intentions now show the reason for the expansion failure

  • #7308 Provide an option to add --nocapture flag to cargo test commands. You can turn it on via Registry... | org.rust.cargo.test.nocapture

  • #7228 Properly construct links to Rust paths in quick documentation (by @shocoman)

  • #6003 Allow inlining functions with diverging exit points by Inline Function refactoring (Refactor | Inline... or Ctrl+Alt+N) (by @SaarYogev)

Performance Improvements

  • #7576 Slightly optimize Find usages for non-pub items


  • #7479 Support const arguments that look like type arguments

  • #7611 Fix experimental procedural macro expansion with Rust 1.54 and Rust nightly

  • #7120 Don’t suggest pub(crate) from other crates for auto-import

  • #6060 Check if asm!() macro is contained in an unsafe block or function (by @Stzx)

  • #7567 Render const generics in Parameter Info (Ctrl + P)

  • #7553 Add a trailing comma by Move Statement Up/Down action (Ctrl+Shift+Up/Down) even when there are multiple elements in the last line (by @t-kameyama)

  • #6904 Fix Move Statement Up/Down action on vec! macro arguments (by @t-kameyama)

  • #7547 Do not offer live templates in patterns

  • #7546 Add comma to match arm if needed by Lift return quick-fix (by @t-kameyama)

  • #7540 Filter out existing features in dependency features completion in Cargo.toml

  • #7527 Enable Go to generated declaration line marker in WASM projects for 2021.2 IDEs

  • #7516 Fix auto-import-aware completion when invoked at an empty place

  • #7428 Show crate roots first in the project view

  • #7411 Take into account the CARGO_HOME environment variable when using crates local index

  • #7383 Fix Convert impl Trait intention when the corresponding function already has const parameters (by @Kobzol)

  • #7334 Do not warn about missing format macro arguments if format_args_capture unstable feature is enabled (by @Kobzol)

  • #7168 Fix false-positive Module is private (E0603) when using the new name resolution engine

Internal Improvements

  • #7512 Introduce new RsTemplateBuilder API

  • #7321 Improve macro expansion error types & error handling

  • #7452 Use the new FormattingService on 2021.2 IDEs

Full set of changes can be found here