New Features

  • Improve the new macro expansion engine in order to support nested modules declared with macros. Now the plugin provides code completion and other code insight features for crates like tokio and async-std in proper way. Note that you should enable the new macro expansion engine via Preferences | Languages & Frameworks | Rust | Expand declarative macros option.
  • Support custom test attributes like #[tokio::test] (by @Kobzol)
  • Add liveness analysis. Now unused local variables are highlighted as unused.

  • Support impls for trait objects. Now the plugin provides name resolution and completion for items declared in impl dyn Trait {} (by @rrevenantt)
  • Experimentally support items generated by build scripts. Recently, we did a first attempt to support build scripts. In this release we’re trying to use compiler output to get info about generated items. The output contains all environment variables generated by a build script, so now we support not only env!("OUT_DIR"), but any env!("FOO_BAR"). Also, it brings support of cfg options set by a build scripts, e.g. #[cfg(foobar)]. To turn it on just enable option in Experimental Features dialog. Note that under the hood it uses cargo check, so this can significantly slow down project import.
  • Support referring to enum variants through type aliases from Rust 1.37
  • Comments generated by Comment with / action (Ctrl+//Cmd+/) now follow Rustfmt style. You can change this behavior in File | Settings | Editor | Code Style | Rust | Code Generation. (by @SeekingMeaning)

  • Implement members quick fix improvements:

    • Do not expand type aliases (by @Kobzol)
    • Select content of the first item after generation of missing items (by @Kobzol)
    • Generate Fn-family traits in the correct way (by @rrevenantt)

Performance Improvements

  • Function bodies are now skipped by the parser during indexation. This speeds up the indexation process by about 20% and improves macro expansion speed (if you use the experimental expansion engine).
  • Function bodies are now parsed incrementally. This means that when you’re typing in a function body, only the body will be re-parsed. This can speed up code completion in large documents.
  • Slightly optimized parser


  • Correctly parse crate-qualified paths in tuple struct fields (struct Foo(crate::foo::Bar))
  • Fix “Run with coverage” on 2020.1
  • Take into account type aliases in Type Info action (ctrl+P) (by @Kobzol)
  • Show Cargo tool window after attaching a first cargo project
  • Fix type checking for async blocks
  • Highlighting improvements:
    • Fix highlighting blinking on the dark theme
    • Don’t incorrectly highlight a variable as primitive type if it has primitive type name like let i32 = 1;
    • Fix highlighting of string literals inside attributes like #[foo("bar")]
  • Display ?Sized trait bound properly for impl blocks in structure view (by @rrevenantt)

  • REPL integration improvements:

    • Rust REPL now is not experimental. You can find it in Tools | Rust REPL (by @dima74)
    • Don’t add commands with errors to completion context (by @dima74)

Internal Improvements

  • New parser benchmark

Full set of changes can be found here