This is an archive of the discontinued Mercurial Phabricator instance.

rhg: propogate error coming from HgError::Abort to CommandError

Authored by pulkit on Jun 7 2021, 8:00 AM.

Diff Detail

rHG Mercurial
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

pulkit created this revision.Jun 7 2021, 8:00 AM
SimonSapin added inline comments.

I believe this case is unnecessary since it is already handled in impl From<HgError> for CommandError


This change looks like a bug. Previously this line was calling into HgError::into which calls impl From<HgError> for CommandError, but now this it calls ConfigError::into such that impl From<ConfigError> for CommandError ends up recursively calling itself until the stack overflows.

The standard library defines this blanket impl to connect the From and Into traits:

impl<T, U> Into<U> for T
    U: From<T>,
    fn into(self) -> U {
pulkit updated this revision to Diff 28512.Jun 9 2021, 3:49 AM
Alphare accepted this revision.Jun 9 2021, 5:22 AM
This revision is now accepted and ready to land.Jun 9 2021, 5:22 AM
baymax updated this revision to Diff 28538.Jun 9 2021, 1:22 PM

✅ refresh by Heptapod after a successful CI run (🐙 💚)