Avatar ·

How to view the expanded macro that causes a compilation error in Rust?

I'm new to Rust and trying to use macros for code generation. I took the popular crate `serde` and wrote this code: ```rust use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize)] struct User { name: String, age: u32, email: String, } fn main() { let user = User { name: "Alice".to_string(), age: 30, email: "alice@example.com".to_string(), }; let json = serde_json::to_string(&user).unwrap(); println!("{}", json); } ``` It works. But when I tried to write my own macro for automatic trait implementation: ```rust macro_rules! impl_display { ($type:ty, $format:expr) => { impl std::fmt::Display for $type { fn fmt(&self, f: &mut std::fmt::Formatte