dtolnay / syn

Parser for Rust source code
Apache License 2.0
2.81k stars 308 forks source link

Consider moving Visit, VisitMut, Fold traits to separate crate(s) #1638

Open dtolnay opened 4 months ago

dtolnay commented 4 months ago

https://docs.rs/syn/2/syn/visit/index.html https://docs.rs/syn/2/syn/visit_mut/index.html https://docs.rs/syn/2/syn/fold/index.html

These account for a surprisingly large proportion of the compile time of the syn crate, on the order of 31% when "parsing", "printing", and "full" features are enabled.

It is not necessary for this code to be in the same crate as the rest of syn. Each of these modules could be its own crate, which depends on syn. This would allow crates which depend on syn but do not use those traits to begin compiling sooner in a clean build.