UID22302性别保密经验 EP铁粒 粒回帖0主题精华在线时间 小时注册时间2020-12-10最后登录1970-1-1
|
无奖竞猜
lib.rs
- use proc_macro::TokenStream;
- #[proc_macro]
- pub fn throw_into_toilet(item: TokenStream) -> TokenStream {
- // Parse the name
- let name = item.to_string();
- // Return the token stream that defines the function
- format!("let flush = |_| (); flush({})", name).parse().unwrap()
- }
- #[proc_macro]
- pub fn make_toliet(_: TokenStream) -> TokenStream {
- // This macro doesn't do anything in this context, but you can define it if needed
- "let flush = |_| (); ".parse().unwrap()
- }
- #[proc_macro]
- pub fn make_flush(item: TokenStream) -> TokenStream {
- // Parse the name
- let name = item.to_string();
- // Return the token stream that defines the function
- format!("flush({})", name).parse().unwrap()
- }
复制代码
可以运行的 main 代码
main.rs
- use proc2_toliet::*;
- fn main() {
- let a = 1;
- throw_into_toilet!(a);
- let b = String::from("Poopoo");
- throw_into_toilet!(b);
- // make_toliet!();
- // let a = 1;
- // make_flush!(a);
- // let b = String::from("A Lot Of Poo Poo");
- // make_flush!(b);
- }
复制代码
不可以运行的 main.rs
- use proc2_toliet::*;
- fn main() {
- // let a = 1;
- // throw_into_toilet!(a);
- // let b = String::from("Poopoo");
- // throw_into_toilet!(b);
- make_toliet!();
- let a = 1;
- make_flush!(a);
- let b = String::from("A Lot Of Poo Poo");
- make_flush!(b);
- }
复制代码
为什么后面的代码跑不起来呢?
【1】第一次代码杂鱼主人用了明明两个厕所,后面的那次杂鱼主人居然两次工作都交给同一个厕所简直太坏了!
【2】啊啊啊,主人的粑粑太多了... 厕所再冲... 要坏掉的❤️ 厕所溢出来了呜呜呜... 所以就跑不起来了呜呜呜
【3】杂鱼主人的屁屁是不是干了什么不干净的事情,居然要上这么多次厕所!厕所当然不会让主人冲的
【4】其他
|
|