You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 9, 2023. It is now read-only.
The Syn crate has fairly coarse compile-time control over the set of available syntax tree types. There is default-features = false mode where only the parsing API is provided with no syntax tree types at all, there is features = ["derive"] which is the default and supports structs and enums, and there is features = ["full"] which supports all possible Rust syntax.
Sometimes Rust macros, especially attribute macros, need to parse just slightly more than what is exposed by the default feature set. For example wasm-bindgen wants to parse function signatures but not their bodies. That means there should be no need for any of the expression-parsing logic enabled by features = ["full"]. They could save compile time by using features = ["derive"] in combination with a library that just parses function signatures.
The return struct would look like pretty much like syn::ItemFn except where the function body is kept as an unparsed TokenStream instead of a fully parsed syn::Block.