rust-lang / project-error-handling

Error handling project group
Apache License 2.0
268 stars 18 forks source link

Consider revisiting some details of Display for io::Error #37

Open nox opened 3 years ago

nox commented 3 years ago

The implementation of Display for io::Error currently completely omits the kind of the error for errors created with io::Error::new.

Do you think it would be possible to change that and include it for all others whose kind is not io::ErrorKind::Other? I realise that this is probably a breaking change, but I wonder if there is that much code out there using io::Error::new with a kind different to io::ErrorKind::Other.

JDuchniewicz commented 3 years ago

Do we know the rationale behind not printing them in the first place? I presume that unwillingness to print out every member of the io::ErrorKind enum was the main reason.

nox commented 3 years ago

Digging way too far in the past I've found out that it actually used to be that way.

nox commented 3 years ago

It was then changed to always ignore the error kind for custom errors in this commit.

nox commented 3 years ago

AFAICT, the PR never explains why that change was made. Do you remember, @alexcrichton?

alexcrichton commented 3 years ago

Sorry, I do not.