6
6
7
7
/*! Error reporting. */
8
8
9
+ use alloc:: sync:: Arc ;
10
+ use core:: fmt;
11
+ use std:: io;
9
12
use std:: os:: raw:: c_int;
10
- use std:: sync:: { Arc , Mutex } ;
11
- use std:: { fmt, io} ;
13
+ use std:: sync:: Mutex ;
12
14
13
15
/// 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 > ;
15
17
16
18
/// Actual storage for an error.
17
19
#[ derive( Debug , Clone ) ]
@@ -34,7 +36,7 @@ pub enum ErrorKind {
34
36
35
37
/// Casting an integer caused data loss.
36
38
#[ non_exhaustive]
37
- IntegerCast ( std :: num:: TryFromIntError ) ,
39
+ IntegerCast ( core :: num:: TryFromIntError ) ,
38
40
}
39
41
40
42
/// Call stack back trace where the `Error` object was created.
@@ -113,8 +115,8 @@ impl fmt::Display for Error {
113
115
}
114
116
}
115
117
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 ) > {
118
120
match & self . 0 . kind {
119
121
// Errors that are self-descriptive.
120
122
ErrorKind :: TooManyVMPages => None ,
@@ -142,8 +144,8 @@ impl From<ErrorKind> for Error {
142
144
}
143
145
144
146
/// 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 {
147
149
Self :: from ( ErrorKind :: IntegerCast ( err) )
148
150
}
149
151
}
0 commit comments