]> git.lizzy.rs Git - rust.git/commit
Auto merge of #23430 - alexcrichton:io-error, r=aturon
authorbors <bors@rust-lang.org>
Thu, 19 Mar 2015 19:15:22 +0000 (19:15 +0000)
committerbors <bors@rust-lang.org>
Thu, 19 Mar 2015 19:15:22 +0000 (19:15 +0000)
commit7f53b943f94b338e4c5401f1ce9efbe7da92b0c5
tree4521e024b5d87d395b9648a098659caf618641ca
parent81e2396c7695360c56b10683bdbea0c6214b41ac
parentdedac5eb3c657c39f9f328f303dc7ef01dd760c3
Auto merge of #23430 - alexcrichton:io-error, r=aturon

This commit stabilizes the `ErrorKind` enumeration which is consumed by and
generated by the `io::Error` type. The purpose of this type is to serve as a
cross-platform namespace to categorize errors into. Two specific issues are
addressed as part of this stablization:

* The naming of each variant was scrutinized and some were tweaked. An example
  is how `FileNotFound` was renamed to simply `NotFound`. These names should not
  show either a Unix or Windows bias and the set of names is intended to grow
  over time. For now the names will likely largely consist of those errors
  generated by the I/O APIs in the standard library.

* The mapping of OS error codes onto kinds has been altered. Coalescing no
  longer occurs (multiple error codes become one kind). It is intended that each
  OS error code, if bound, corresponds to only one `ErrorKind`. The current set
  of error kinds was expanded slightly to include some networking errors.

This commit also adds a `raw_os_error` function which returns an `Option<i32>`
to extract the underlying raw error code from the `Error`.

Closes #16666

[breaking-change]