Interesting macro
This commit is contained in:
parent
20dd8f1dee
commit
de30a033ec
|
@ -4,7 +4,6 @@ version = "0.1.0"
|
|||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
|
|
14
src/lib.rs
14
src/lib.rs
|
@ -1,10 +1,10 @@
|
|||
use proc_macro::TokenStream;
|
||||
use quote::{quote};
|
||||
|
||||
macro_rules! test_macro {
|
||||
($out_struct:path, $path:literal) => ( {
|
||||
println!($path);
|
||||
});
|
||||
}
|
||||
|
||||
#[proc_macro]
|
||||
pub fn nigga(_input: TokenStream) -> TokenStream {
|
||||
TokenStream::from(quote!(
|
||||
122
|
||||
))
|
||||
fn _s() {
|
||||
test_macro!(String, "a");
|
||||
}
|
Loading…
Reference in New Issue