Skip to content

0.10.6: still issues with conflicting implementations of trait #1333

@frederikhors

Description

@frederikhors

Since #1287 is closed I just tried 0.10.6: unfortunately the issue is still there:

impl Related<super::tenant::Entity> for Entity {
    fn to() -> RelationDef {
        super::house::Relation::Tenant.def()
    }
    fn via() -> Option<RelationDef> {
        Some(super::house::Relation::Player.def().rev())
    }
}

impl Related<super::tenant::Entity> for Entity {
    fn to() -> RelationDef {
        super::offer::Relation::Tenant.def()
    }
    fn via() -> Option<RelationDef> {
        Some(super::offer::Relation::Player.def().rev())
    }
}

with error:

error[E0119]: conflicting implementations of trait `sea_orm::Related<generated::tenant::Entity>` for type `generated::player::Entity`
  --> src\entities\player.rs:65:1
   |
56 | impl Related<super::tenant::Entity> for Entity {
   | ---------------------------------------------- first implementation here
...
65 | impl Related<super::tenant::Entity> for Entity {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `generated::player::Entity`

error[E0119]: conflicting implementations of trait `sea_orm::Related<generated::player::Entity>` for type `generated::tenant::Entity`
   --> src\entities\tenant.rs:135:1
    |
117 | impl Related<super::player::Entity> for Entity {
    | ------------------------------------------------ first implementation here
...
135 | impl Related<super::player::Entity> for Entity {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `generated::tenant::Entity`

The entities in this case are:

Player {
    pub tenant_id: String,
}

House {
    pub tenant_id: String,
    pub player_id: String,
}

Offer {
    pub tenant_id: String,
    pub player_id: String,
}

I'll downgrade to 0.10.2 for now.

On other entites there is the same issue too (because of tenant_id).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions