13
13
// coherence challenge (e.g., specialization, neg impls, etc) we can
14
14
// reconsider what crate these items belong in.
15
15
16
+ use core:: any:: TypeId ;
16
17
use core:: array;
18
+ use core:: cell;
19
+ use core:: char;
20
+ use core:: fmt:: { self , Debug , Display } ;
21
+ use core:: mem:: transmute;
22
+ use core:: num;
23
+ use core:: str;
17
24
18
25
use crate :: alloc:: { AllocErr , LayoutErr , CannotReallocInPlace } ;
19
- use crate :: any:: TypeId ;
20
26
use crate :: borrow:: Cow ;
21
- use crate :: cell;
22
- use crate :: char;
23
- use crate :: fmt:: { self , Debug , Display } ;
24
- use crate :: mem:: transmute;
25
- use crate :: num;
26
- use crate :: str;
27
- use crate :: string;
27
+ use crate :: boxed:: Box ;
28
+ use crate :: string:: { self , String } ;
28
29
29
30
/// `Error` is a trait representing the basic expectations for error values,
30
31
/// i.e., values of type `E` in [`Result<T, E>`]. Errors must describe
@@ -38,9 +39,9 @@ use crate::string;
38
39
/// provide its own errors while also revealing some of the implementation for
39
40
/// debugging via [`source`] chains.
40
41
///
41
- /// [`Result<T, E>`]: ../result/enum.Result.html
42
- /// [`Display`]: ../fmt/trait.Display.html
43
- /// [`Debug`]: ../fmt/trait.Debug.html
42
+ /// [`Result<T, E>`]: ../../std/ result/enum.Result.html
43
+ /// [`Display`]: ../../std/ fmt/trait.Display.html
44
+ /// [`Debug`]: ../../std/ fmt/trait.Debug.html
44
45
/// [`source`]: trait.Error.html#method.source
45
46
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
46
47
pub trait Error : Debug + Display {
@@ -52,7 +53,7 @@ pub trait Error: Debug + Display {
52
53
///
53
54
/// To obtain error description as a string, use `to_string()`.
54
55
///
55
- /// [`Display`]: ../fmt/trait.Display.html
56
+ /// [`Display`]: ../../std/ fmt/trait.Display.html
56
57
///
57
58
/// # Examples
58
59
///
@@ -891,7 +892,7 @@ impl dyn Error + Send + Sync {
891
892
#[ cfg( test) ]
892
893
mod tests {
893
894
use super :: Error ;
894
- use crate :: fmt;
895
+ use core :: fmt;
895
896
896
897
#[ derive( Debug , PartialEq ) ]
897
898
struct A ;
0 commit comments