File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,8 @@ description = "The uninhabited void type for use in statically impossible cases.
8
8
readme = " README.md"
9
9
license = " MIT"
10
10
11
+ [features ]
12
+
13
+ default = [ " std" ]
14
+ std = []
15
+
Original file line number Diff line number Diff line change 1
1
#![ cfg_attr( test, deny( warnings) ) ]
2
2
#![ deny( missing_docs) ]
3
+ #![ cfg_attr( not( feature = "std" ) , no_std) ]
3
4
4
5
//! # Void
5
6
//!
10
11
//! extra functionality to `Result<T, Void>` and `Result<Void, E>`.
11
12
//!
12
13
13
- use std:: { fmt, cmp, error} ;
14
+ extern crate core;
15
+ use core:: { fmt, cmp} ;
16
+
17
+ #[ cfg( feature = "std" ) ]
18
+ use std:: error;
14
19
15
20
/// The empty type for cases which can't occur.
16
21
#[ derive( Copy ) ]
@@ -46,6 +51,7 @@ impl<T> cmp::PartialOrd<T> for Void {
46
51
}
47
52
}
48
53
54
+ #[ cfg( feature = "std" ) ]
49
55
impl error:: Error for Void {
50
56
fn description ( & self ) -> & str {
51
57
unreachable ( * self )
You can’t perform that action at this time.
0 commit comments