Skip to content
New issue

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

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

Already on GitHub? # to your account

cargo check fails oddly on binaries #3419

Closed
alexcrichton opened this issue Dec 16, 2016 · 2 comments
Closed

cargo check fails oddly on binaries #3419

alexcrichton opened this issue Dec 16, 2016 · 2 comments

Comments

@alexcrichton
Copy link
Member

Not entirely sure what's going on here....

// Cargo.toml
[package]
name = "lib"
version = "0.1.0"
authors = []

[dependencies]
rustc-serialize = "*"

// src/lib.rs
extern crate rustc_serialize;

use rustc_serialize::Decodable;

pub fn take<T: Decodable>() {}

// src/main.rs
extern crate rustc_serialize;

extern crate lib;

#[derive(RustcDecodable)]
pub struct Foo;

fn main() {
    lib::take::<Foo>();
}

With that structure:

$ cargo check
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling rustc-serialize v0.3.22
   Compiling lib v0.1.0 (file:///home/alex/code/lol)
error[E0277]: the trait bound `Foo: rustc_serialize::serialize::Decodable` is not satisfied
 --> src/main.rs:9:5
  |
9 |     lib::take::<Foo>();
  |     ^^^^^^^^^^^^^^^^ the trait `rustc_serialize::serialize::Decodable` is not implemented for `Foo`
  |
  = note: required by `lib::take`

error: aborting due to previous error

error: Could not compile `lib`.

To learn more, run the command again with --verbose.

@nrc mind taking a look?

@nrc
Copy link
Member

nrc commented Dec 18, 2016

looking into this...

@nrc
Copy link
Member

nrc commented Dec 18, 2016

This appears to be fixed by #3425. Will submit a PR with a test...

bors added a commit that referenced this issue Dec 26, 2016
Test for #3419

Based on top of #3425.

I'm not sure if this is an acceptable test because it downloads rustc-serialize.

r? @alexcrichton
@bors bors closed this as completed in 129ce53 Dec 26, 2016
bors added a commit that referenced this issue Mar 25, 2024
Remove unnecessary test

This removes a test that is blocking rust-lang/rust#116016 from landing. `@dtolnay` suggested removing the test rather than allowing the relevant lints ([comment](rust-lang/rust#116016 (comment))).

> The failure is in https://github.com/rust-lang/cargo/blob/77506e57392d94450bb3ed52cf75e3263bbb2792/tests/testsuite/check.rs#L222-L285 which is a 7 year old test for [#3419](#3419), which is from 2 days after the initial implementation of `cargo check` landed in nightly Cargo in [#3296](#3296).
>
> I would recommend just deleting the test from Cargo. The implementation of `cargo check` has matured enough since then and I don't see anything useful in that test.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants