Created
January 25, 2013 19:43
-
-
Save Lazin/4637224 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Foo { | |
fn foo(&self); | |
} | |
trait Bar : Foo {} // trait is empty | |
impl MyStruct : Foo { | |
fn foo(&self) { | |
// implementation goes here | |
} | |
} | |
let a = MyStruct { ... }; | |
let b = a as Bar; // compile time error, MyStruct must explicitly impl Bar trait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment