From 7c06c5a90015a73cdcb6cd6b6243bc99fcd9d357 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Tue, 18 Aug 2015 13:53:32 -0400 Subject: [PATCH] Improve std::io::ErrorKind Hopefully make this distinction a little more clear. Fixes #27637 --- src/libstd/io/error.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs index 17a72e0f1b5e5..eb39a836c439a 100644 --- a/src/libstd/io/error.rs +++ b/src/libstd/io/error.rs @@ -125,6 +125,9 @@ pub enum ErrorKind { /// Unlike `InvalidInput`, this typically means that the operation /// parameters were valid, however the error was caused by malformed /// input data. + /// + /// For example, a function that reads a file into a string will error with + /// `InvalidData` if the file's contents are not valid UTF-8. #[stable(feature = "io_invalid_data", since = "1.2.0")] InvalidData, /// The I/O operation's timeout expired, causing it to be canceled.