question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find crate for dev-dependencies while rustc has no problems!

See original GitHub issue
System 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:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ehusscommented, Mar 21, 2017

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).

0reactions
ehusscommented, Jan 28, 2018

Can this ticket be closed?

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found