eupn / macrotest

Test harness for declarative and procedural macros expansion via `cargo-expand`
47 stars 9 forks source link

Bump MSRV to 1.60 and check MSRV in CI #108

Closed taiki-e closed 5 months ago

taiki-e commented 5 months ago

syn 2.0.57 requires it.

error: failed to select a version for the requirement `syn = "=2.0.57"`
candidate versions found which didn't match: 2.0.56, 2.0.55, 2.0.54, ...
location searched: crates.io index

https://github.com/dtolnay/syn/commit/585df4726f3f7b3e1196a5ad416cdbd689332f56

Very confusing error message is due to https://github.com/rust-lang/cargo/issues/10623.

taiki-e commented 5 months ago

A side effect of https://github.com/rust-lang/cargo/issues/10623 is that pre-1.60 cargo cannot understand weak dependencies and namespace features, so if we generate a lockfile with pre-1.60 cargo, a version compatible with pre-1.60 will be selected.

$ cargo +1.56 generate-lockfile
$ cargo tree -p syn            
syn v2.0.56
├── proc-macro2 v1.0.79
│   └── unicode-ident v1.0.12
├── quote v1.0.35
│   └── proc-macro2 v1.0.79 (*)
└── unicode-ident v1.0.12
$ cargo +1.56 check            
    Finished dev [unoptimized + debuginfo] target(s) in 0.58s

So, as long as syn can be compiled with 1.60, I think we can revert this MSRV bump.