1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#[macro_use]
mod doc;

macro_rules! impl_clone {
    () => {
        #[inline]
        fn clone(&self) -> Self {
            Self { inner: self.inner, _marker: PhantomData }
        }
    };
}

macro_rules! impl_debug {
    ($type_name:expr) => {
        #[inline]
        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
            let (ptr, tag) = self.decompose();
            f.debug_struct($type_name).field("ptr", &ptr).field("tag", &tag).finish()
        }
    };
}

macro_rules! impl_default {
    () => {
        #[inline]
        fn default() -> Self {
            Self::null()
        }
    };
}

macro_rules! impl_pointer {
    () => {
        #[inline]
        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
            fmt::Pointer::fmt(&self.decompose_ptr(), f)
        }
    };
}

macro_rules! impl_partial_eq {
    () => {
        #[inline]
        fn eq(&self, other: &Self) -> bool {
            self.inner.eq(&other.inner)
        }
    };
}

macro_rules! impl_partial_ord {
    () => {
        #[inline]
        fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
            self.inner.partial_cmp(&other.inner)
        }
    };
}

macro_rules! impl_ord {
    () => {
        #[inline]
        fn cmp(&self, other: &Self) -> cmp::Ordering {
            self.inner.cmp(&other.inner)
        }
    };
}

macro_rules! impl_hash {
    () => {
        #[inline]
        fn hash<H: Hasher>(&self, state: &mut H) {
            self.inner.hash(state)
        }
    };
}