Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo check recompiles dependencies when checking lib and bin separately #3421

Closed
crumblingstatue opened this issue Dec 17, 2016 · 1 comment

Comments

@crumblingstatue
Copy link

For this project:

Cargo.toml:

[package]
name = "foo"
version = "0.1.0"
authors = ["Mika Attila <radiantstatue@gmail.com>"]

[dependencies]
rand = "*"

src/lib.rs:

#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
    }
}

src/bin/bar.rs: fn main() {}

cargo check does this:

$ cargo check --lib
   Compiling libc v0.2.18
   Compiling rand v0.3.15
   Compiling foo v0.1.0 (file:///tmp/foo)
    Finished debug [unoptimized + debuginfo] target(s) in 4.87 secs
$ cargo check --bin bar
   Compiling libc v0.2.18
   Compiling rand v0.3.15
   Compiling foo v0.1.0 (file:///tmp/foo)
warning: function is never used: `main`, #[warn(dead_code)] on by default
 --> src/bin/bar.rs:1:1
  |
1 | fn main() {}
  | ^^^^^^^^^^^^

@alexcrichton
Copy link
Member

I believe this is a dupe of #3418, so closing in favor of that, but thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants