Skip to content

Instantly share code, notes, and snippets.

@tiehuis
Created April 10, 2016 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiehuis/2000a3e1a3e2cfdd031208863b75f9f5 to your computer and use it in GitHub Desktop.
Save tiehuis/2000a3e1a3e2cfdd031208863b75f9f5 to your computer and use it in GitHub Desktop.
macro_rules! foo {
($id:ident) => {
struct $id {}
fn new() -> &'static $id {
$id {}
}
}
}
foo!(Bar);
fn main() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment