Cargo.toml:
[package] name = "customderive" version = "0.1.0" [lib] proc-macro=true
src/lib.rs:
#![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::TokenStream; #[proc_macro_derive(Dummy)] pub fn qqq(input: TokenStream) -> TokenStream { "".parse().unwrap() }
examples/hello.rs
#[macro_use] extern crate customderive; #[derive(Dummy)] struct Qqq; fn main(){}