Skip to content

Instantly share code, notes, and snippets.

@alexcrichton
Created March 1, 2019 19:53
Show Gist options
  • Save alexcrichton/6c05b08b83817991a6c745bf01cba636 to your computer and use it in GitHub Desktop.
Save alexcrichton/6c05b08b83817991a6c745bf01cba636 to your computer and use it in GitHub Desktop.
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "foo"
version = "0.1.0"
[package]
name = "foo"
version = "0.1.0"
authors = ["Alex Crichton <[email protected]>"]
edition = "2018"
[lib]
proc-macro = true
path = 'lib.rs'
[[bin]]
path = 'main.rs'
name = 'foo'
extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro_attribute]
pub fn foo(attr: TokenStream, input: TokenStream) -> TokenStream {
println!("attr: {}", attr);
println!("input: {}", input);
input
}
#[foo::foo]
extern "C" {
fn foo(x: i32, ...);
}
fn main() {
println!("Hello, world!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment