Created
March 1, 2019 19:53
-
-
Save alexcrichton/6c05b08b83817991a6c745bf01cba636 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
# This file is automatically @generated by Cargo. | |
# It is not intended for manual editing. | |
[[package]] | |
name = "foo" | |
version = "0.1.0" | |
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
[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' |
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
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 | |
} |
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
#[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