dtolnay/cargo-expand

Updating to syn 2 changed the output

Closed this issue · 2 comments

Hi.

In derive-adhoc we use macrotest for our tests, and that uses cargo expand (which it expects to have been cargo installed)

Recently, our CI started failing, reporting, basically, this diff (comparing expected and actual output):

+        ds.field("bar", &<PrettyVec<String> as From<&Vec<String>>>::from(&self.bar));
-        ds.field("bar", &<PrettyVec<String> as From::<&Vec<String>>>::from(&self.bar));

Experimenting, this changed betweencargo-expand 1.0.40 and 1.0.44.

I don't know if there is anything useful or better to be done here in cargo-expand. Perhaps it would make sense to treat this as a major version bump for cargo-expand and for people who run cargo-expand in CI in this rather-brittle way to specify the major version?

Anyway, I thought you should be told. I've dealt with the problem in our CI by pinning to the precise cargo-expand version.

Thanks for your attention.

Preserving byte-for-byte identical output across releases has never been a commitment that this crate has made.

OK, fair enough, thanks.

I will file a ticket against macrotest, which I think needs to tell users that they need to use cargo install --version=... --locked.