Created
April 24, 2014 02:08
-
-
Save shadowmint/11239084 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
macro_rules! trace( | |
($($arg:tt)*) => ( | |
{ let x = ::std::io::stdout().write_line(format_args!(::std::fmt::format, $($arg)*)); println!("{}", x); } | |
); | |
) | |
pub fn do_something() -> uint { | |
return 99; | |
} | |
struct Blah<'a> { | |
x:&'a fn() -> uint | |
} | |
#[test] | |
fn test_this_thing() { | |
let x = Blah { x: &do_something }; | |
let y = (*x.x)(); | |
trace!("{}", y); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment