dtolnay/cargo-expand

serde_derive breaks module path

Closed this issue · 1 comments

serde_derive emits macro_rules! try, which doesn't parse with syn v2

minimum reproducible example

// src/lib.rs
#[derive(serde::Deserialize)]
struct A;

pub fn a() {}
cargo expand a

expected: pub fn a() {}

actual: everything gets printed because syn::parse_file fails here

if let Ok(mut syntax_tree) = syn::parse_file(&wip) {

Fixed in cargo-expand 1.0.42.