Created
May 25, 2013 21:06
-
-
Save MaikKlein/5650789 to your computer and use it in GitHub Desktop.
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 Vec3<T>{ | |
mut x: T, | |
mut y: T, | |
mut z: T | |
} | |
impl<T: Add<T,T>+Clone> Vec3<T> { | |
fn add(&mut self,v: Vec3<T>){ | |
self.x += v.x.clone(); | |
self.y += v.y.clone(); | |
self.z += v.z.clone(); | |
} | |
} | |
fn main() { | |
let mut v1 : Vec3<int> = Vec3{x: 1,y: 1,z: 1,}; | |
let mut v2 : Vec3<int> = Vec3{x: 1,y: 1,z: 1,}; | |
v1.add(v2); | |
} | |
error: internal compiler error: unexpected failure | |
note: the compiler hit an unexpected failure path. this is a bug | |
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues | |
[Finished in 0.3s with exit code 101] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment