New Features

  • #7816, #8596, #8597, #8629, #8675, #8705, #8730, #8996, #8767 You can now paste JSON objects into Rust files and convert them to a set of Rust structs (by @Kobzol)

  • #9012 Introduce new approach of project model reloading and detection changes in configuration files starting with 2022.2 major IDE release. Now the plugin detects changes in configuration files like Cargo.toml even if they are not saved into disk yet, takes into account Cargo config, toolchain and build script files and notifies you if the project model is not up-to-date via floating button in the top-right corner of the editor. You can select preferable way when the project model should be reloaded automatically in Preferences | Build, Execution, Deployment | Build Tools. At the same time, Cargo settings were moved to Preferences | Build, Execution, Deployment | Build Tools | Cargo

  • #8868 Highlight macro-machinery-specific syntax in declarative macro definitions. New highlighting should help to distinguish a syntax specific to macros from an expansion code (by @daym)

    Macro highlighting

  • #8869 Enable by default some inspections for dependencies in Cargo.toml

    • Invalid crate version warns you about a non-existing crate version

      Invalid crate version

    • New crate version available notifies you about a crate that could be updated.

      We tried to make the highlighting not too intrusive, because using an older version of a crate may be quite normal. If you still don’t like the inspection, you can simply disable it

  • Improve detection of some errors:

    • #9026 Improve detection of duplicate definitions. Add support for E0254, E0259 and E0260 errors

    • #9020 Detect E0430 The self import appears more than once in the list compiler error

    • #9000 Detect E0742 Visibility is restricted to a module which isn’t an ancestor of the current item compiler error

  • #7299 Provide debugger pretty-printers to render HashMap/HashSet with MSVC LLDB on Windows

  • #9024 Support View | Type Info action (Ctrl + Shift + P) for field shorthand syntax

Performance Improvements

  • #9021, #9016, #9015, #8968 Slightly speed up type inference

  • #8986 Speed up completion in procedural macros. Please, note that procedural macro expansion is experimental. If you want to try it, enable org.rust.cargo.evaluate.build.scripts and org.rust.macros.proc experimental features

  • #9085 Fix possible deadlock during indexing

Fixes

  • #8986 Try to fix up rust syntax before calling an attribute procedural macro placed on a function. This fixes highlighting blinking during typing in a body of a function with a proc attribute macro on it

  • #9090 Limit the maximal #![recursion_limit] attribute value to 1000 when expanding macros. This fixes possible stack overflows

  • #9058 Fixes procedural macro expansion on Rust beta

  • #9009 Fix “Inline function” refactoring dialog when function has single usage in another module

  • #8951 Do not offer remove unused variables quick-fix if the variable is not declared in a let binging (for example, if it is declared in a for loop) (by @Kobzol)

  • #9067 Fixes exception on opening Configure features popup in Cargo.toml (by @Stzx) The popup can be observed only if org.rust.cargo.features.settings.gutter experimental feature is enabled

Internal Improvements

Full set of changes can be found here