Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created April 13, 2018 14:07
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 rust-play/a5caf7b9ebc7d93d987048692ebf8183 to your computer and use it in GitHub Desktop.
Save rust-play/a5caf7b9ebc7d93d987048692ebf8183 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
mod somemod {
#[derive(Debug)]
pub struct B;
}
macro_rules! get_type {
($struct_name:ident) => (self::somemod::$struct_name)
}
fn main() {
println!("{:?}", get_type!(B));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment