Support cfg features generated by build scripts
See original GitHub issueEnvironment
- IntelliJ Rust plugin version: 0.2.110.5742-193-dev
- Rust toolchain version: 1.39 stable
- IDE name and version: IntelliJ IDEA 2019.3 beta 2
- Operating system: Windows 10 x64
Problem description
Ctrl-clicking function in specific circumstance takes me to wrong function. Experimental macro expansion engine is enabled.
Steps to reproduce
Cargo.toml:
[package]
name = "bug-repro"
version = "0.1.0"
authors = ["Alyosha Vasilieva <1284317+AlyoshaVasilieva@users.noreply.github.com>"]
edition = "2018"
[dependencies]
indexmap = "=1.3.0"
digest = "=0.8.1"
main.rs:
use indexmap::map::IndexMap;
fn main() {
let mut map = IndexMap::new();
map.insert("key", "value");
}
IndexMap::new
is highlighted as error with “Unresolved reference: `new`”.
Ctrl-clicking IndexMap, despite being highlighted red, correctly takes me to its declaration.
Ctrl-clicking new
incorrectly takes me to the new
function inside impl<D: Input + FixedOutput + Reset + Clone + Default> Digest for D
, part of the digest
crate.
Compilation works and gives no warnings or errors.
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Build Scripts - The Cargo Book
Outputs of the Build Script. Build scripts may save any output files or intermediate artifacts in the directory specified in the OUT_DIR environment...
Read more >Evaluating Build Scripts in the IntelliJ Rust Plugin
Build scripts is a Cargo feature that allows executing any code prior to building a package. We implemented support for build scripts ......
Read more >Build Scripts - The Cargo Book
Building a bundled C library. Finding a C library on the host system. Generating a Rust module from a specification. Performing any platform-specific ......
Read more >cfg_rust_features - Rust - Docs.rs
A build-script helper to set cfg options according to probing which features of your choice are enabled in the Rust compiler, language, and...
Read more >Access Cargo features *inside* the build script - Stack Overflow
... inside the build.rs script as well. So you can use any of the standard ways to check configuration, like the cfg! and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Now there is a way to collect info about generated items including generated cfg option while project refresh action. Under the hood, it uses
cargo check
so it may significantly increase refresh time (especially, in the first time when it has to compile all dependencies). It’s disabled by default for now. To turn it on, enableorg.rust.cargo.evaluate.build.scripts
option inExperimental Features
dialog. The dialog can be found viaHelp | Find Action
@MSxDOS, please, try the nightly IntelliJ Rust plugin (see instructions), #5186 is included there