This file contains hidden or 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 MyTrait { | |
| fn foo(&self); | |
| } | |
| impl <'self> MyTrait for &'self str { | |
| fn foo(&self) {} | |
| } | |
| fn main() {} |
This file contains hidden or 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
| struct MyStruct {} | |
| impl MyStruct { | |
| fn takes_mut_self(&mut self, _x:int) {} | |
| fn takes_self(&self) -> int { 42 } | |
| fn also_takes_mut_self(&mut self) { | |
| self.takes_mut_self(self.takes_self()); |
This file contains hidden or 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
| enum TileType { | |
| WALL, | |
| FLOOR | |
| } | |
| pub struct Tile { | |
| known : bool, | |
| t : TileType | |
| } |