66
77/*! Error reporting. */
88
9+ use alloc:: sync:: Arc ;
10+ use core:: fmt;
11+ use std:: io;
912use std:: os:: raw:: c_int;
10- use std:: sync:: { Arc , Mutex } ;
11- use std:: { fmt, io} ;
13+ use std:: sync:: Mutex ;
1214
1315/// A result of a fallible operation.
14- pub ( crate ) type Result < T > = std :: result:: Result < T , Error > ;
16+ pub ( crate ) type Result < T > = core :: result:: Result < T , Error > ;
1517
1618/// Actual storage for an error.
1719#[ derive( Debug , Clone ) ]
@@ -34,7 +36,7 @@ pub enum ErrorKind {
3436
3537 /// Casting an integer caused data loss.
3638 #[ non_exhaustive]
37- IntegerCast ( std :: num:: TryFromIntError ) ,
39+ IntegerCast ( core :: num:: TryFromIntError ) ,
3840}
3941
4042/// Call stack back trace where the `Error` object was created.
@@ -113,8 +115,8 @@ impl fmt::Display for Error {
113115 }
114116}
115117
116- impl std :: error:: Error for Error {
117- fn source ( & self ) -> Option < & ( dyn std :: error:: Error + ' static ) > {
118+ impl core :: error:: Error for Error {
119+ fn source ( & self ) -> Option < & ( dyn core :: error:: Error + ' static ) > {
118120 match & self . 0 . kind {
119121 // Errors that are self-descriptive.
120122 ErrorKind :: TooManyVMPages => None ,
@@ -142,8 +144,8 @@ impl From<ErrorKind> for Error {
142144}
143145
144146/// Wrap another error into an instance of `Error`.
145- impl From < std :: num:: TryFromIntError > for Error {
146- fn from ( err : std :: num:: TryFromIntError ) -> Self {
147+ impl From < core :: num:: TryFromIntError > for Error {
148+ fn from ( err : core :: num:: TryFromIntError ) -> Self {
147149 Self :: from ( ErrorKind :: IntegerCast ( err) )
148150 }
149151}
0 commit comments