File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,26 @@ use mem;
21
21
use usize;
22
22
use ptr:: { self , NonNull } ;
23
23
24
+ extern {
25
+ /// An opaque, unsized type. Used for pointers to allocated memory.
26
+ ///
27
+ /// This type can only be used behind a pointer like `*mut Void` or `ptr::NonNull<Void>`.
28
+ /// Such pointers are similar to C’s `void*` type.
29
+ pub type Void ;
30
+ }
31
+
32
+ impl Void {
33
+ /// Similar to `std::ptr::null`, which requires `T: Sized`.
34
+ pub fn null ( ) -> * const Self {
35
+ 0 as _
36
+ }
37
+
38
+ /// Similar to `std::ptr::null_mut`, which requires `T: Sized`.
39
+ pub fn null_mut ( ) -> * mut Self {
40
+ 0 as _
41
+ }
42
+ }
43
+
24
44
/// Represents the combination of a starting address and
25
45
/// a total capacity of the returned block.
26
46
#[ derive( Debug ) ]
Original file line number Diff line number Diff line change 75
75
#![ feature( custom_attribute) ]
76
76
#![ feature( doc_cfg) ]
77
77
#![ feature( doc_spotlight) ]
78
+ #![ feature( extern_types) ]
78
79
#![ feature( fn_must_use) ]
79
80
#![ feature( fundamental) ]
80
81
#![ feature( intrinsics) ]
You can’t perform that action at this time.
0 commit comments