sapling/apiserver
David Tolnay 4c90bc48f7 rust: Replace implementation of failure_ext to remove failure dependency
Summary:
This diff changes failure_ext::Error from reexporting failure::Error to anyhow::Error instead.

Failure's error type requires all errors to have an implementation of failure's own failure::Fail trait in order for cause chains and backtraces to work. The necessary methods for this functionality have made their way into the standard library error trait, so modern error libraries build directly on std::error::Error rather than something like failure::Fail. Once we are no longer tied to failure 0.1's Fail trait, different parts of the codebase will be free to use any std::error::Error-based libraries they like while still working nicely together.

Sadly this diff is not the end of the remove-failure stack, it is near the middle. This diff is the point where we've made failure look as much as possible like anyhow and made anyhow look as much like failure via failure_ext, such that we can atomically cut over with a relatively small diff. That means some of the code here isn't necessarily idiomatic. Later diffs will follow up on removing failurisms like the bail_err / bail_msg / ensure_err / ensure_msg distinction which should no longer be necessary.

Reviewed By: Imxset21

Differential Revision: D18577341

fbshipit-source-id: 5689c3c9ddeaa79a123e710831986cf4656a5205
2019-11-22 09:27:59 -08:00
..
client/src Rename rust client_async module to plain client 2019-11-08 14:22:16 -08:00
fastlog/src rust: Replace derive(Fail) with derive(Error) 2019-11-14 22:04:37 -08:00
if Rename rust2 code generator to rust 2019-11-04 13:06:55 -08:00
src rust: Replace implementation of failure_ext to remove failure dependency 2019-11-22 09:27:59 -08:00