D7503: rust-dirs: address failing tests for `dirs` impl with a temporary fix

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Thu Nov 28 13:14:31 UTC 2019


yuja added a comment.


  >   > Okay, then using non-debug `assert!()` seems more appropriate. If we prefer
  >   > being stricter, "checked" HgPath type can be introduced.
  >   > ...
  >   > Actually I tried to suppress these warnings by propagating Result upwards,
  >   > and I got a feeling that we're doing wrong.
  >   I sent a followup as D7522 <https://phab.mercurial-scm.org/D7522> because that gets rid of the warnings. As explained in the commit message, I am unhappy about this change, as you seem to be.
  
  Thanks. Given Rust impl is still unstable, I think it's better to back out
  the changes in Rust and leave the test failure until we find a right solution.
  
  >   We're doing it wrong, indeed, because the checks are happening at the wrong level, causing abstraction leakage all over the place. The Rust type-system makes it much more obvious than in C or Python.
  >   I am of the opinion of backing out of the original patch (5d40317d42b7083b49467502549e25f144888cb3 <https://phab.mercurial-scm.org/rHG5d40317d42b7083b49467502549e25f144888cb3>) that @durin42 introduced.
  
  I don't agree with that since raising Python exception is the only way to
  safely error out from C extension layer. It should be better than blocking
  the entire process (or exhausting resources.)

REPOSITORY
  rHG Mercurial

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

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

To: Alphare, #hg-reviewers
Cc: yuja, marmoute, durin42, kevincox, mercurial-devel


More information about the Mercurial-devel mailing list