-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
A-crate-dependenciesArea: [dependencies] of any kindArea: [dependencies] of any kindA-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-easyExperience: EasyExperience: Easy
Description
When specifying a crate without a library target kind as a dependency, cargo currently just silently ignores it. For example:
[package]
name = "deptest"
version = "0.1.0"
edition = "2018"
[dependencies]
ripgrep = "*"
$ cargo run
Compiling deptest v0.1.0 (/tmp/deptest)
Finished dev [unoptimized + debuginfo] target(s) in 0.31s
Running `target/debug/deptest`
Hello, world!
Note that the dependency isn't even compiled. Clearly, Cargo has already decided to elide this crate in the dependency graph, but the cause is not obvious to the user. All this can be confusing if the user is expecting to be able to use the dependency. I think a warning message is in order.
OptimisticPeach, kornelski, drmason13, MonliH and Yakinopat
Metadata
Metadata
Assignees
Labels
A-crate-dependenciesArea: [dependencies] of any kindArea: [dependencies] of any kindA-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-easyExperience: EasyExperience: Easy