diff options
| author | kennytm <kennytm@gmail.com> | 2018-01-31 16:36:09 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-31 16:36:09 +0800 |
| commit | 33d175f74d588235751302a8dbb6350d893bbff0 (patch) | |
| tree | 7d560a21df674b2969791a3ca2339ffad4eb3921 /src/libstd | |
| parent | c66c6b7ee73a89ac6a6266f98244a71c0bf05f4d (diff) | |
| parent | e9d70417cae7fcb08323351d9388b65b39560156 (diff) | |
| download | rust-33d175f74d588235751302a8dbb6350d893bbff0.tar.gz rust-33d175f74d588235751302a8dbb6350d893bbff0.zip | |
Rollup merge of #47874 - jcowgill:mips-from_raw_os_error, r=dtolnay
std: use more portable error number in from_raw_os_error docs On MIPS, error number 98 is not `EADDRINUSE` (it is `EPROTOTYPE`). To fix the resulting test failure this causes, use a more portable error number in the example documentation. `EINVAL` shold be more reliable because it was defined in the original Unix as 22 so hopefully most derivatives have defined it the same way.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/error.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs index f0b41f30251..bdd675e6e2b 100644 --- a/src/libstd/io/error.rs +++ b/src/libstd/io/error.rs @@ -292,8 +292,8 @@ impl Error { /// # if cfg!(target_os = "linux") { /// use std::io; /// - /// let error = io::Error::from_raw_os_error(98); - /// assert_eq!(error.kind(), io::ErrorKind::AddrInUse); + /// let error = io::Error::from_raw_os_error(22); + /// assert_eq!(error.kind(), io::ErrorKind::InvalidInput); /// # } /// ``` /// @@ -303,8 +303,8 @@ impl Error { /// # if cfg!(windows) { /// use std::io; /// - /// let error = io::Error::from_raw_os_error(10048); - /// assert_eq!(error.kind(), io::ErrorKind::AddrInUse); + /// let error = io::Error::from_raw_os_error(10022); + /// assert_eq!(error.kind(), io::ErrorKind::InvalidInput); /// # } /// ``` #[stable(feature = "rust1", since = "1.0.0")] |
