Rust Rant Contest: std::io::Error, the oversized junk drawer of failure

98 points OliveTreeFounder 51 comments

I've been coding in Rust for five years, and std::io::Error has never been anything but a headache. The error code? Never useful. It’s impossible to handle—too big, too vague—so we all end up just passing this bloated mess back to the caller without even knowing what’s inside or what actually caused the error.

But it gets worse. Traits, instead of being parameterized over an Error type, just return Result<..., std::io::Error>. Once a trait like this becomes popular—like Write or AsyncRead—you're stuck. You can’t handle errors properly unless you rewrite every crate that depends on these traits.

std::io::Error is a contagious disease infecting the entire ecosystem. We need to stop this pandemic!