Closed
Description
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?
Metadata
Metadata
Assignees
Labels
No labels