dtolnay / syn

Parser for Rust source code
Apache License 2.0
2.78k stars 306 forks source link

Implement `Debug` for the AST nodes #1665

Closed angelcaru closed 2 months ago

angelcaru commented 2 months ago

When I'm using a Rust library for the first time, my general learning process is usually just spraying dbg!() and todo!() everywhere to get a better feel for the datatypes I'm working with. With Syn, I can't do that because the AST nodes don't implement Debug. Is there a reason behind this? Doesn't seem hard to just add #[derive(Debug)] to every struct defintion.

Bruflot commented 2 months ago

This is already supported, you just need to enable the extra-traits feature: https://github.com/dtolnay/syn/issues/583#issuecomment-466830944