dtolnay/cargo-expand

How to print macro expansion of syn internal library code?

lancejpollard opened this issue · 0 comments

Hi there, I am excited by the possibilities of this project. I am looking at code like this:

ast_enum! {
    /// A grouping token that surrounds a macro body: `m!(...)` or `m!{...}` or `m![...]`.
    ///
    /// *This type is available if Syn is built with the `"derive"` or `"full"`
    /// feature.*
    pub enum MacroDelimiter {
        Paren(Paren),
        Brace(Brace),
        Bracket(Bracket),
    }
}

It is in the internal syn library. How can I quickly macro expand some internal library code using cargo expand? I tried this but no go:


$ cargo expand syn::UseTree
    Checking rust-ast v0.1.0 (/Users/me/code/rust-ast)
    Finished dev [unoptimized + debuginfo] target(s) in 0.20s
WARNING: no such item: syn::UseTree
$ cargo expand syn::UseTree::Name
    Checking rust-ast v0.1.0 (/Users/me/code/rust-ast)
    Finished dev [unoptimized + debuginfo] target(s) in 0.14s
WARNING: no such item: syn::UseTree::Name
$ cargo expand syn::Item::Use
    Checking rust-ast v0.1.0 (/Users/me/code/rust-ast)
    Finished dev [unoptimized + debuginfo] target(s) in 0.14s
WARNING: no such item: syn::Item::Use