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

Yuya Nishihara yuya at tcha.org
Mon Nov 25 08:46:12 EST 2019


>   > Might be better to do `path.check_state()` in cpython layer, and insert
>   > `debug_assert` to hg-core.
>   
>   That would be cleaner for the current purposes, but using `debug_assert` in `hg-core` indicates to me that we want the Rust code to not worry about checking for consecutive slashes in `dirs`, because we would have the `pathauditor`. Am I correct?

I generally prefer adding safety checks at ABI boundary. If malicious input
makes Rust code crash or exhaust CPU/memory resource, I would add sanity
check to rust-cpython layer.


More information about the Mercurial-devel mailing list