Created
August 23, 2013 20:27
-
-
Save carl-eastlund/6323637 to your computer and use it in GitHub Desktop.
bus error
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 Trait { | |
| fn method( &self ); | |
| } | |
| struct Simple; | |
| impl Trait for Simple { | |
| fn method( &self ) {} | |
| } | |
| impl<'self,D> Trait for &'self D { | |
| fn method( &self ) { | |
| self.method() | |
| } | |
| } | |
| struct Nested<D>{ elem: D } | |
| impl<D:Trait> Trait for Nested<D> { | |
| fn method( &self ) { | |
| self.elem.method(); | |
| } | |
| } | |
| fn main () { | |
| println("start"); | |
| Nested{ elem: &Simple }.method(); | |
| println("finish"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment