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

Conflicting trait implementations caused by Insertable, Queryable derivations. #498

Closed
SergioBenitez opened this Issue Nov 21, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@SergioBenitez
Contributor

SergioBenitez commented Nov 21, 2016

Starting with the 11/19 nightly (possibly before as well), using Diesel's derive macros results in the following errors:

error[E0119]: conflicting implementations of trait `std::fmt::Debug` for type `task::Task`:
  --> src/task.rs:16:32
   |
16 | #[derive(Serialize, Queryable, Insertable, Debug, Clone)]
   |                                ^^^^^^^^^^  ----- first implementation here
   |                                |
   |                                conflicting implementation for `task::Task`

error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `task::Task`:
  --> src/task.rs:16:32
   |
16 | #[derive(Serialize, Queryable, Insertable, Debug, Clone)]
   |                                ^^^^^^^^^^         ----- first implementation here
   |                                |
   |                                conflicting implementation for `task::Task`

error[E0119]: conflicting implementations of trait `std::fmt::Debug` for type `task::Task`:
  --> src/task.rs:16:21
   |
16 | #[derive(Serialize, Queryable, Insertable, Debug, Clone)]
   |                     ^^^^^^^^^              ----- first implementation here
   |                     |
   |                     conflicting implementation for `task::Task`

error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `task::Task`:
  --> src/task.rs:16:21
   |
16 | #[derive(Serialize, Queryable, Insertable, Debug, Clone)]
   |                     ^^^^^^^^^                     ----- first implementation here
   |                     |
   |                     conflicting implementation for `task::Task`

error[E0119]: conflicting implementations of trait `std::fmt::Debug` for type `task::Task`:
  --> src/task.rs:16:21
   |
16 | #[derive(Serialize, Queryable, Insertable, Debug, Clone)]
   |                     ^^^^^^^^^              ----- first implementation here
   |                     |
   |                     conflicting implementation for `task::Task`

error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `task::Task`:
  --> src/task.rs:16:21
   |
16 | #[derive(Serialize, Queryable, Insertable, Debug, Clone)]
   |                     ^^^^^^^^^                     ----- first implementation here
   |                     |
   |                     conflicting implementation for `task::Task`

error[E0119]: conflicting implementations of trait `diesel::Insertable<task::schema::tasks::table, _>` for type `&task::Task`:
  --> src/task.rs:16:1
   |
16 | #[derive(Serialize, Queryable, Insertable, Debug, Clone)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   | |
   | first implementation here
   | conflicting implementation for `&task::Task`
   |
   = note: this error originates in a macro outside of the current crate

The struct definition and Diesel imports look like this:

mod schema {
    infer_schema!("db/db.sql");
}

use diesel;
use diesel::prelude::*;
use self::schema::tasks;
use self::schema::tasks::dsl::{tasks as all_tasks, completed as task_completed};

#[table_name = "tasks"]
#[derive(Serialize, Queryable, Insertable, Debug, Clone)]
pub struct Task {
    id: Option<i32>,
    pub description: String,
    pub completed: Option<bool>
}

@SergioBenitez SergioBenitez changed the title from Conflicting trait implementations caused by Insertable, Queryable derivation. to Conflicting trait implementations caused by Insertable, Queryable derivations. Nov 21, 2016

@sgrif

This comment has been minimized.

Member

sgrif commented Nov 22, 2016

Duplicate of #496

@sgrif sgrif closed this Nov 22, 2016

@sgrif

This comment has been minimized.

Member

sgrif commented Nov 22, 2016

0.8.2 has been released with a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment