Initial commit to test proc func macro
This commit is contained in:
commit
0b56d77364
|
@ -0,0 +1,3 @@
|
|||
/target
|
||||
Cargo.lock
|
||||
.env
|
|
@ -0,0 +1,12 @@
|
|||
[package]
|
||||
name = "dev-macros"
|
||||
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]
|
||||
syn = "1.0"
|
||||
quote = "1.0"
|
|
@ -0,0 +1,12 @@
|
|||
use proc_macro::TokenStream;
|
||||
use quote::{quote};
|
||||
|
||||
|
||||
#[proc_macro]
|
||||
pub fn nigga(_input: TokenStream) -> TokenStream {
|
||||
TokenStream::from(quote!(
|
||||
fn deez() -> i32 {
|
||||
122
|
||||
}
|
||||
))
|
||||
}
|
Loading…
Reference in New Issue