std: Stabilize last bits of io::Error
This commit stabilizes a few remaining bits of the `io::Error` type: * The `Error::new` method is now stable. The last `detail` parameter was removed and the second `desc` parameter was generalized to `E: Into<Box<Error>>` to allow creating an I/O error from any form of error. Currently there is no form of downcasting, but this will be added in time. * An implementation of `From<&str> for Box<Error>` was added to liballoc to allow construction of errors from raw strings. * The `Error::raw_os_error` method was stabilized as-is. * Trait impls for `Clone`, `Eq`, and `PartialEq` were removed from `Error` as it is not possible to use them with trait objects. This is a breaking change due to the modification of the `new` method as well as the removal of the trait implementations for the `Error` type. [breaking-change]
This commit is contained in:
@@ -75,8 +75,7 @@ macro_rules! seek {
|
||||
|
||||
if pos < 0 {
|
||||
Err(Error::new(ErrorKind::InvalidInput,
|
||||
"invalid seek to a negative position",
|
||||
None))
|
||||
"invalid seek to a negative position"))
|
||||
} else {
|
||||
self.pos = pos as u64;
|
||||
Ok(self.pos)
|
||||
|
||||
Reference in New Issue
Block a user