mitsuhiko / insta

A snapshot testing library for rust
https://insta.rs
Apache License 2.0
2.14k stars 95 forks source link

Similar dependency broke our CI #161

Closed kvark closed 3 years ago

kvark commented 3 years ago

Description

See https://github.com/gfx-rs/naga/pull/472/checks?check_run_id=1904641293#step:4:93

When testing on Rust-1.43.0, similar fails to build:

error[E0034]: multiple applicable items in scope
Error:   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/similar-1.2.0/src/algorithms/lcs.rs:25:18
   |
25 |     if new_range.is_empty() {
   |        ----------^^^^^^^^--
   |        |         |
   |        |         multiple `is_empty` found
   |        help: disambiguate the method call for candidate #2: `std::iter::ExactSizeIterator::is_empty(&new_range)`
   |
   = note: candidate #1 is defined in an impl for the type `std::ops::Range<_>`
   = note: candidate #2 is defined in an impl of the trait `std::iter::ExactSizeIterator` for the type `std::ops::Range<usize>`

Reproduction steps

  1. Build 1.5.3 and up on Rust-1.43.0

Additional helpful information:

What did you expect

Not breakage

Notes

Of course we can work around this by either fixing the insta version to 1.5.2, or not building it on our MSRV. Just thought I'd fire up this bug to see your thoughts on it.

mitsuhiko commented 3 years ago

@kvark I'm sorry for that. I lowered the minimum requirements to 1.41.0 now which I think should be a good base for both similar and insta. Upgrading to 1.6.2 should fix it for you.

CI also now checks against 1.41.0 so this should not regress again.