Skip to content

Instantly share code, notes, and snippets.

@jbclements
Created July 31, 2013 22:19
Show Gist options
  • Save jbclements/6126704 to your computer and use it in GitHub Desktop.
Save jbclements/6126704 to your computer and use it in GitHub Desktop.
macro_rules! ok (($T:ident) => ($T))
macro_rules! bad (($T:ty) => ($T))
ok!(int); // compiles
//bad!(int); // crashes
fn main() { }
oiseau:~/tryrust/src clements> rust run /tmp/foo.rs
/tmp/foo.rs:3:8: 3:9 error: expected item but found `;`
/tmp/foo.rs:3 ok!(int); // compiles
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment