rustc: Implement generic cross-crate trait inheritance
This commit is contained in:
parent
705afcd844
commit
ec1c60c4d6
9 changed files with 203 additions and 42 deletions
9
src/test/auxiliary/trait_inheritance_overloading_xc.rs
Normal file
9
src/test/auxiliary/trait_inheritance_overloading_xc.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
pub trait MyNum : Add<self,self>, Sub<self,self>, Mul<self,self> {
|
||||
}
|
||||
|
||||
pub impl int : MyNum {
|
||||
pure fn add(other: &int) -> int { self + *other }
|
||||
pure fn sub(other: &int) -> int { self - *other }
|
||||
pure fn mul(other: &int) -> int { self * *other }
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue