Created
February 24, 2015 07:31
-
-
Save johnynek/cb0081e0c84eedb8f079 to your computer and use it in GitHub Desktop.
rust compiler 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
| use std::old_io as io; | |
| use std::sync::mpsc::channel; | |
| use std::thread::Thread; | |
| use std::ops::Fn; | |
| use std::marker::PhantomData; | |
| pub struct Test<F, X>(F, PhantomData<X>); | |
| impl <F, X> Test<F, X> where F: Fn(X) { | |
| fn go(self, x: X) { | |
| let Test(f, _) = self; | |
| f(x) | |
| } | |
| } | |
| fn main() { | |
| let (tx, rx) = channel(); | |
| Thread::spawn(move|| { | |
| tx.send(Test(|x: isize| { println!("{:?}", x) }, PhantomData)).unwrap() | |
| }); | |
| //println!("{:?}", | |
| rx.recv().unwrap().go(12); | |
| } | |
| /* | |
| Global is external, but doesn't have external or weak linkage! | |
| void (%closure*, i64)* @_ZN4main12closure.4347E | |
| invalid linkage type for function declaration | |
| void (%closure*, i64)* @_ZN4main12closure.4347E | |
| LLVM ERROR: Broken module found, compilation aborted! | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment