-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-trait-systemArea: Trait systemArea: Trait systemA-type-systemArea: Type systemArea: Type systemE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Description
When I used bound::typeparam as type, thread rustc
panicked.
use rustc_serialize::{Encodable, Decodable};
use std::fmt::Display;
pub trait Entity : Decodable + Encodable + Sized {
type Key: Clone + Decodable + Encodable + ToString + Display + Eq + Ord + Sized;
fn id(&self) -> Self::Key;
fn find_by_id(id: Self::Key) -> Option<Self>;
}
pub struct DbRef<E: Entity> {
pub id: E::Key,
}
impl<E> DbRef<E>
where E: Entity {
fn get(self) -> Option<E> {
E::find_by_id(self.id)
}
}
Source code: https://github.com/ceram1/appcore/blob/master/src/db/mod.rs
Build log: https://travis-ci.org/ceram1/appcore/builds/60641835
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemA-type-systemArea: Type systemArea: Type systemE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️