Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display::fmt for de::Error is infinitely recursive #221

Closed
CAD97 opened this issue May 1, 2020 · 1 comment · Fixed by #222
Closed

Display::fmt for de::Error is infinitely recursive #221

CAD97 opened this issue May 1, 2020 · 1 comment · Fixed by #222

Comments

@CAD97
Copy link
Contributor

CAD97 commented May 1, 2020

Caused by #208.

  impl fmt::Display for Error {
      fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
          match *self {
              Error::IoError(ref s) => write!(f, "{}", s),
              Error::Message(ref s) => write!(f, "{}", s),
-             Error::Parser(_, pos) => write!(f, "{}: {}", pos, self.description()),
+             Error::Parser(_, pos) => write!(f, "{}: {}", pos, self),
          }
      }
  }
bors bot added a commit that referenced this issue May 1, 2020
222: Use conventional module layout r=kvark a=CAD97

This includes unifying ser::Error and de::Error.

Closes #220, closes #221.

Co-authored-by: CAD97 <[email protected]>
@kvark
Copy link
Collaborator

kvark commented May 1, 2020

Would be very useful to have a test for this (basically, display printing some type... Also, to have the fix for it separately, as opposed to the giant #222

@kvark kvark closed this as completed in #222 May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants