New Features

  • #6423 Support Find Usages action (Edit | Find Usages or Alt+F7) for Cargo features. Note, in order to make this feature work, you need to update your TOML plugin to the latest version as well

  • cfg attribute support improvements:
    • #6436, #6444 Provide completion for feature argument of cfg attribute as well as completion for values of Cargo feature themselves

    • #6467 Gray out cfg-disabled items in structure view
    • #6432 Provide name resolution for Cargo features in doc(cfg()) attributes
    • #6466 Handle function arguments under cfg attribute during type inference and analyses
  • Support cfg_attr attribute in some cases during name resolution and completion. In general, the plugin now knows that cfg_attr can be expanded to other attributes, and the following stuff was adapted to use this knowledge:
    • #6462, #6460 Resolve and complete paths of path attribute and traits in derive attributes under cfg_attr
    • #6448 Take into account cfg_attr attribute during attribute and lint attribute completion
    • #6461 Resolve procedural macro attributes under cfg_attr
    • #6445 Add completion for conditional compilation options and operators inside cfg_attr() and doc(cfg()) attributes
    • #6434 Provide name resolution for Cargo features in conditional attributes like cfg_attr(docsrs, doc(cfg(feature = "macros")))
    • #6440 Extend Attribute without parentheses inspection scope to highlight attributes under cfg_attr

    Note, the plugin can’t evaluate predicates of cfg_attr attribute yet

  • #6417 Provide a way to fetch actual info about stdlib packages like dependencies, edition, Cargo features. It should help the plugin understand stdlib structure better. For example, the feature allows providing proper completion and navigation for items defined in std::os module. Note, the corresponding feature works since Rust 1.41 and is disabled by default for now. You can enable it via org.rust.cargo.fetch.actual.stdlib.metadata option in Experimental Feature dialog (Help | Find Action and type Experimental features to open the dialog)

  • #6332 Add Redirect input option for Cargo run configuration to provide stdin from the desired file

  • #6428 Remove empty use groups by Optimize Imports action (Code | Optimize Imports or Alt+Cmd+O)

  • #6421 Provide Make public quick-fix for items with restricted visibility like pub(crate)

  • #6458 Provide completion for type_length_limit, windows_subsystem, panic_handler, must_use ignore, used, global_allocator attributes

  • #5939 Show Build tool window for wasm-pack run configurations if org.rust.cargo.build.tool.window experimental feature is enabled

Performance Improvements

  • #6426 Reduce memory consumption with new name resolution engine. Note, you can enable the new engine via Use experimental name resolution engine option in Preferences | Languages & Frameworks | Rust settings

Fixes

  • #6465 Fix cfg attributes support in E0023 detection and the corresponding quick-fix.

  • #6464 Create method intention is no longer offered for types from external or stdlib crates (by @Kobzol)

  • #6453 Take into account inner attributes like #![allow(deprecated)] in trait items during cfg attribute evaluation, lint suppression, etc.

  • #6435 Exclude private items from completion when using new name resolution engine

  • #6430 Fix wrong name resolution of Cargo features in cfg_attr

  • #6429 Use unqualified paths for references to target mod by Move (Refactor | Move or F6) refactoring

  • #6427 Properly validate DTrace settings before running CPU profiler on macOS

  • #6421 Make Item is private error highlighting range more precise

Full set of changes can be found here