New Features

  • #9532 Enable build script evaluation by default. Now the plugin builds and executes all build scripts in the project (including build scripts in external dependencies) during project model loading to create source code generated during compilation and collect information about generated environment variables and cfg options. A typical use case is to generate some code by a build script and include it via include!(concat!(env!("OUT_DIR"), "/path_to_generated_file.rs")). Now the plugin understands where generated sources are located and includes them into its own analysis. Under the hood, build script evaluation uses cargo check call modified in a way to compile and execute only host code (i.e. only build scripts and procedural macros as well as their dependencies). Besides execution of build scripts code, it also allows the plugin to compile all procedural macro libraries which is required for procedural macro expansion. Note, procedural macro expansion is still disabled by default. To turn it on, enable org.rust.macros.proc experimental feature.

    Read more about build scripts and how to work with them in Rust plugin in the corresponding blog post

  • #9239 Support new Cargo features syntax from Rust 1.60.0. See Rust release blog post for more info about the syntax

  • #9429 Add Inline type alias refactoring in addition to existing Substitute type alias intention

  • #9517 Provide code folding for extern blocks (extern "C" { ... }) (by @Kobzol)

  • #9459 Resolve and complete items from the stdlib in Rust files which don’t belong to a particular Cargo project (detached and scratch files)

  • #9451 Provide completion for 'static lifetime (by @Kobzol)

  • #9443 Add imports for macros by Move refactoring. Currently, only macros from dependency crates are supported

  • #9433 Take into account return type of some stdlib macros in completion sorting. For example, now vec![] will be bubbled up in the completion list if expected expression type is Vec

  • #9502 Annotate usage of wasm external ABI as experimental

Performance Improvements

  • #9488 Fix IDE freezing on searching implementation via Has Implementation line marker in gutter

  • #9357 Slightly speed up name resolution

Fixes

  • #9567 Fix possible stack overflow during type inference

  • #9545 Fix name resolution of absolute path when there is extern crate with alias

  • #9537 Fix Attach file to module quick-fix. Now File is not included in module tree bar will disappear after attaching the file to a module tree as expected

  • #9510 Don’t use private re-exports declared in the same crate by Import quick-fix

  • #9507 Improve error message for E0407 error

  • #9506 Don’t reorder re-exports of legacy macros when optimizing imports

  • #9504 Add imports for return type by Change signature refactoring properly

  • #9485 Handle $crate variable during procedural macro expansion properly

  • #9430 Fix inference of types with mixed type/const type arguments

  • #9416 Fix false-positive E0117 in some cases

  • #9374 Fix nested loop/block labels shadowing

  • #9358 Fix todo!() macro type inference

  • #9312, #9558 Filter out attribute and derive procedural macros in usual macro calls completion

  • #9540 Fix procedural macro expansion cache invalidation. See issue #9539 for more details

Internal Improvements

  • #9480 Keep info about compiler features in json instead of generated Kotlin code

Full set of changes can be found here