[Updated] D11412: rhg: Don’t compare ambiguous files one byte at a time

SimonSapin phabricator at mercurial-scm.org
Tue Sep 14 04:12:16 UTC 2021


SimonSapin added inline comments.

INLINE COMMENTS

> Alphare wrote in Cargo.lock:3
> I think this shouldn't have been included. What is the reason for this, I'm curious?

Reverted.

What happened is that at first CI failed with:

  error[E0277]: can't compare `&[u8]` with `std::vec::Vec<u8>`
     --> rhg/src/commands/status.rs:280:30
      |
  280 |     return Ok(contents_in_p1 == fs_contents);
      |                              ^^ no implementation for `&[u8] == std::vec::Vec<u8>`
      |
      = help: the trait `std::cmp::PartialEq<std::vec::Vec<u8>>` is not implemented for `&[u8]`

… even though the same code compiled on my machine. It looks like that `PartialEq` impl was added at some point between 1.41 and 1.55. I added `&*` to compare two `&[u8]` values instead, and ran `cargo +1.41.1 test` to double-check. I assume the older Cargo removed the version line it doesn’t know about, or something like that. Then I didn’t look at the diff again when amending and pushing.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11412/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11412

To: SimonSapin, #hg-reviewers
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210914/f516f061/attachment-0002.html>


More information about the Mercurial-patches mailing list