Can't find crate for dev-dependencies while rustc has no problems!
See original GitHub issueSystem or Software | Version |
---|---|
Sublime Text | Build 3126 |
Rust Enhanced | 1.2.3 |
An image for the problem: http://i.imgur.com/PK5nSVr.png
I experience this problem in my crate “prophet” at this position.
The crate approx
is my only dev-dependency. Maybe this has something to do with the false-positive error?
rustc and cargo do have no problems at all and everything compiles fine even without warnings.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Unable to find crate that is listed in [build-dependencies] section
The problem is that you've chosen build-dependencies for some reason, ... build any dev-dependencies; build the main crate with --test to ...
Read more >Dependency Resolution - The Cargo Book
When multiple versions of a crate appear in the resolve graph, this can cause problems when types from those crates are exposed by...
Read more >Can't find crate when compiling : r/rust - Reddit
When you invoke the compiler directly, you'll need to tell the compiler where to find other crates. This is done through argument flags....
Read more >The Cargo Book
Note that Cargo will also require that Rust is already installed on the system. ... Dev-dependencies are not used when compiling a package...
Read more >2957-cargo-features2 - The Rust RFC Book
Note: The new feature resolver does not address all of the enhancement requests for feature ... See dev-dependencies below for how this problem...
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
There’s not much that can be done about this for now (other than disable checking of test code as mentioned above). Running “cargo rustc” will not pull in dev-dependencies, and I don’t see a way to force it. “cargo check” doesn’t check test code either (see rust-lang/cargo#3431).
I’d prefer to leave it open until checking of tests is fixed. I recently added support for
cargo check
to validate test code (Rust 1.23, with--profile test
). However, I haven’t updated Rust Enhanced to take advantage of this, yet. I’ll try to work on it soon, since I find it annoying when tests don’t get checked.