Closed
Description
Type parameters to traits can have trait bounds, but these bounds are not checked when implementing the trait.
pub trait Clone2 {
fn clone(&self) -> Self;
}
trait Getter<T: Clone2> {
fn get(&self) -> T;
}
impl Getter<int> for int {
fn get(&self) -> int { *self }
}
int doesn't implement Clone2, but this program is accepted.
Metadata
Metadata
Assignees
Labels
No labels