New Features

  • #4914 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.

  • #4758 Support custom test attributes like #[tokio::test] (by @Kobzol)

  • #4710 Add liveness analysis. Now unused local variables are highlighted as unused.

  • #4913 Support impls for trait objects. Now the plugin provides name resolution and completion for items declared in impl dyn Trait {} (by @rrevenantt)

  • #4734 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 org.rust.cargo.evaluate.build.scripts option in Experimental Features dialog. Note that under the hood it uses cargo check, so this can significantly slow down project import.

  • #4952 Support referring to enum variants through type aliases from Rust 1.37

  • #4942, #4946 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:

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

Performance Improvements

  • #4925 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).

  • #4862 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.

  • #4950 Slightly optimized parser

Fixes

  • #4955 Correctly parse crate-qualified paths in tuple struct fields (struct Foo(crate::foo::Bar))

  • #4939 Fix “Run with coverage” on 2020.1

  • #4932 Take into account type aliases in Type Info action (ctrl+P) (by @Kobzol)

  • #4919 Show Cargo tool window after attaching a first cargo project

  • #4849 Fix type checking for async blocks

  • #4847 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")]
  • #4783 Display ?Sized trait bound properly for impl blocks in structure view (by @rrevenantt)

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

Internal Improvements

  • #4948 New parser benchmark

Full set of changes can be found here