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

Yuya Nishihara yuya at tcha.org
Thu Nov 28 08:12:37 EST 2019


>   > 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.)


More information about the Mercurial-devel mailing list