Coverage Report

Created: 2026-08-05 07:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.104/src/ptr.rs
Line
Count
Source
1
use alloc::boxed::Box;
2
use core::marker::PhantomData;
3
use core::ptr::NonNull;
4
5
#[repr(transparent)]
6
pub struct Own<T>
7
where
8
    T: ?Sized,
9
{
10
    pub ptr: NonNull<T>,
11
}
12
13
unsafe impl<T> Send for Own<T> where T: ?Sized {}
14
15
unsafe impl<T> Sync for Own<T> where T: ?Sized {}
16
17
impl<T> Copy for Own<T> where T: ?Sized {}
18
19
impl<T> Clone for Own<T>
20
where
21
    T: ?Sized,
22
{
23
0
    fn clone(&self) -> Self {
24
0
        *self
25
0
    }
26
}
27
28
impl<T> Own<T>
29
where
30
    T: ?Sized,
31
{
32
12.4k
    pub fn new(ptr: Box<T>) -> Self {
33
12.4k
        Own {
34
12.4k
            ptr: unsafe { NonNull::new_unchecked(Box::into_raw(ptr)) },
35
12.4k
        }
36
12.4k
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_config::lookup::existing::Error>>>::new
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_config::file::init::types::Error>>>::new
Line
Count
Source
32
838
    pub fn new(ptr: Box<T>) -> Self {
33
838
        Own {
34
838
            ptr: unsafe { NonNull::new_unchecked(Box::into_raw(ptr)) },
35
838
        }
36
838
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>>::new
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>>::new
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_config_value::Error>>>::new
Line
Count
Source
32
2.96k
    pub fn new(ptr: Box<T>) -> Self {
33
2.96k
        Own {
34
2.96k
            ptr: unsafe { NonNull::new_unchecked(Box::into_raw(ptr)) },
35
2.96k
        }
36
2.96k
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>>::new
Line
Count
Source
32
1.43k
    pub fn new(ptr: Box<T>) -> Self {
33
1.43k
        Own {
34
1.43k
            ptr: unsafe { NonNull::new_unchecked(Box::into_raw(ptr)) },
35
1.43k
        }
36
1.43k
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::iter::error::Error>>>::new
Line
Count
Source
32
42
    pub fn new(ptr: Box<T>) -> Self {
33
42
        Own {
34
42
            ptr: unsafe { NonNull::new_unchecked(Box::into_raw(ptr)) },
35
42
        }
36
42
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::buffer::open::error::Error>>>::new
Line
Count
Source
32
804
    pub fn new(ptr: Box<T>) -> Self {
33
804
        Own {
34
804
            ptr: unsafe { NonNull::new_unchecked(Box::into_raw(ptr)) },
35
804
        }
36
804
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>>::new
Line
Count
Source
32
1.63k
    pub fn new(ptr: Box<T>) -> Self {
33
1.63k
        Own {
34
1.63k
            ptr: unsafe { NonNull::new_unchecked(Box::into_raw(ptr)) },
35
1.63k
        }
36
1.63k
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::io::error::Error>>>::new
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_ref::store_impl::file::log::line::decode::error::Error>>>::new
Line
Count
Source
32
849
    pub fn new(ptr: Box<T>) -> Self {
33
849
        Own {
34
849
            ptr: unsafe { NonNull::new_unchecked(Box::into_raw(ptr)) },
35
849
        }
36
849
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_error::concrete::message::Message>>>::new
Line
Count
Source
32
846
    pub fn new(ptr: Box<T>) -> Self {
33
846
        Own {
34
846
            ptr: unsafe { NonNull::new_unchecked(Box::into_raw(ptr)) },
35
846
        }
36
846
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::io::error::Error>>>::new
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_url::parse::Error>>>::new
Line
Count
Source
32
1.25k
    pub fn new(ptr: Box<T>) -> Self {
33
1.25k
        Own {
34
1.25k
            ptr: unsafe { NonNull::new_unchecked(Box::into_raw(ptr)) },
35
1.25k
        }
36
1.25k
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_pathspec::parse::Error>>>::new
Line
Count
Source
32
1.75k
    pub fn new(ptr: Box<T>) -> Self {
33
1.75k
        Own {
34
1.75k
            ptr: unsafe { NonNull::new_unchecked(Box::into_raw(ptr)) },
35
1.75k
        }
36
1.75k
    }
37
38
24.8k
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
24.8k
        Own {
40
24.8k
            ptr: self.ptr.cast(),
41
24.8k
        }
42
24.8k
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_config::lookup::existing::Error>>>::cast::<anyhow::error::ErrorImpl>
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_config::file::init::types::Error>>>::cast::<anyhow::error::ErrorImpl>
Line
Count
Source
38
838
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
838
        Own {
40
838
            ptr: self.ptr.cast(),
41
838
        }
42
838
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_config::lookup::existing::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_config::file::init::types::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_config::lookup::existing::Error>>
<anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_config::file::init::types::Error>>
Line
Count
Source
38
838
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
838
        Own {
40
838
            ptr: self.ptr.cast(),
41
838
        }
42
838
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<alloc::string::String>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<&str>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_config_value::Error>>>::cast::<anyhow::error::ErrorImpl>
Line
Count
Source
38
2.96k
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
2.96k
        Own {
40
2.96k
            ptr: self.ptr.cast(),
41
2.96k
        }
42
2.96k
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_config_value::Error>>>
<anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_config_value::Error>>
Line
Count
Source
38
2.96k
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
2.96k
        Own {
40
2.96k
            ptr: self.ptr.cast(),
41
2.96k
        }
42
2.96k
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>>::cast::<anyhow::error::ErrorImpl>
Line
Count
Source
38
1.43k
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
1.43k
        Own {
40
1.43k
            ptr: self.ptr.cast(),
41
1.43k
        }
42
1.43k
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::iter::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Line
Count
Source
38
42
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
42
        Own {
40
42
            ptr: self.ptr.cast(),
41
42
        }
42
42
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::buffer::open::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Line
Count
Source
38
804
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
804
        Own {
40
804
            ptr: self.ptr.cast(),
41
804
        }
42
804
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_validate::reference::name::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_ref::store_impl::packed::iter::error::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_ref::store_impl::packed::buffer::open::error::Error>>>
<anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>
Line
Count
Source
38
1.43k
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
1.43k
        Own {
40
1.43k
            ptr: self.ptr.cast(),
41
1.43k
        }
42
1.43k
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::iter::error::Error>>
Line
Count
Source
38
42
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
42
        Own {
40
42
            ptr: self.ptr.cast(),
41
42
        }
42
42
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::buffer::open::error::Error>>
Line
Count
Source
38
804
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
804
        Own {
40
804
            ptr: self.ptr.cast(),
41
804
        }
42
804
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>>::cast::<anyhow::error::ErrorImpl>
Line
Count
Source
38
1.63k
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
1.63k
        Own {
40
1.63k
            ptr: self.ptr.cast(),
41
1.63k
        }
42
1.63k
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_validate::reference::name::Error>>>
<anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>
Line
Count
Source
38
1.63k
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
1.63k
        Own {
40
1.63k
            ptr: self.ptr.cast(),
41
1.63k
        }
42
1.63k
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::io::error::Error>>>::cast::<anyhow::error::ErrorImpl>
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_ref::store_impl::file::log::line::decode::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Line
Count
Source
38
849
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
849
        Own {
40
849
            ptr: self.ptr.cast(),
41
849
        }
42
849
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<core::io::error::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_ref::store_impl::file::log::line::decode::error::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::io::error::Error>>
<anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_ref::store_impl::file::log::line::decode::error::Error>>
Line
Count
Source
38
849
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
849
        Own {
40
849
            ptr: self.ptr.cast(),
41
849
        }
42
849
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_error::concrete::message::Message>>>::cast::<anyhow::error::ErrorImpl>
Line
Count
Source
38
846
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
846
        Own {
40
846
            ptr: self.ptr.cast(),
41
846
        }
42
846
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::io::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<core::io::error::Error>>>
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_error::concrete::message::Message>>>
<anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_error::concrete::message::Message>>
Line
Count
Source
38
846
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
846
        Own {
40
846
            ptr: self.ptr.cast(),
41
846
        }
42
846
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::io::error::Error>>
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_url::parse::Error>>>::cast::<anyhow::error::ErrorImpl>
Line
Count
Source
38
1.25k
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
1.25k
        Own {
40
1.25k
            ptr: self.ptr.cast(),
41
1.25k
        }
42
1.25k
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_url::parse::Error>>>
<anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_url::parse::Error>>
Line
Count
Source
38
1.25k
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
1.25k
        Own {
40
1.25k
            ptr: self.ptr.cast(),
41
1.25k
        }
42
1.25k
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_pathspec::parse::Error>>>::cast::<anyhow::error::ErrorImpl>
Line
Count
Source
38
1.75k
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
1.75k
        Own {
40
1.75k
            ptr: self.ptr.cast(),
41
1.75k
        }
42
1.75k
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_pathspec::parse::Error>>>
<anyhow::ptr::Own<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_pathspec::parse::Error>>
Line
Count
Source
38
1.75k
    pub fn cast<U: CastTo>(self) -> Own<U::Target> {
39
1.75k
        Own {
40
1.75k
            ptr: self.ptr.cast(),
41
1.75k
        }
42
1.75k
    }
43
44
12.4k
    pub unsafe fn boxed(self) -> Box<T> {
45
12.4k
        unsafe { Box::from_raw(self.ptr.as_ptr()) }
46
12.4k
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_config::lookup::existing::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_config::file::init::types::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_config::lookup::existing::Error>>>::boxed
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_config::file::init::types::Error>>>::boxed
Line
Count
Source
44
838
    pub unsafe fn boxed(self) -> Box<T> {
45
838
        unsafe { Box::from_raw(self.ptr.as_ptr()) }
46
838
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<alloc::string::String>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<&str>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_config_value::Error>>>>::boxed
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_config_value::Error>>>::boxed
Line
Count
Source
44
2.96k
    pub unsafe fn boxed(self) -> Box<T> {
45
2.96k
        unsafe { Box::from_raw(self.ptr.as_ptr()) }
46
2.96k
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_validate::reference::name::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_ref::store_impl::packed::iter::error::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_ref::store_impl::packed::buffer::open::error::Error>>>>::boxed
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>>::boxed
Line
Count
Source
44
1.43k
    pub unsafe fn boxed(self) -> Box<T> {
45
1.43k
        unsafe { Box::from_raw(self.ptr.as_ptr()) }
46
1.43k
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::iter::error::Error>>>::boxed
Line
Count
Source
44
42
    pub unsafe fn boxed(self) -> Box<T> {
45
42
        unsafe { Box::from_raw(self.ptr.as_ptr()) }
46
42
    }
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::buffer::open::error::Error>>>::boxed
Line
Count
Source
44
804
    pub unsafe fn boxed(self) -> Box<T> {
45
804
        unsafe { Box::from_raw(self.ptr.as_ptr()) }
46
804
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_validate::reference::name::Error>>>>::boxed
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>>::boxed
Line
Count
Source
44
1.63k
    pub unsafe fn boxed(self) -> Box<T> {
45
1.63k
        unsafe { Box::from_raw(self.ptr.as_ptr()) }
46
1.63k
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<core::io::error::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_ref::store_impl::file::log::line::decode::error::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::io::error::Error>>>::boxed
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_ref::store_impl::file::log::line::decode::error::Error>>>::boxed
Line
Count
Source
44
849
    pub unsafe fn boxed(self) -> Box<T> {
45
849
        unsafe { Box::from_raw(self.ptr.as_ptr()) }
46
849
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<core::io::error::Error>>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_error::concrete::message::Message>>>>::boxed
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_error::concrete::message::Message>>>::boxed
Line
Count
Source
44
846
    pub unsafe fn boxed(self) -> Box<T> {
45
846
        unsafe { Box::from_raw(self.ptr.as_ptr()) }
46
846
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::io::error::Error>>>::boxed
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_url::parse::Error>>>>::boxed
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_url::parse::Error>>>::boxed
Line
Count
Source
44
1.25k
    pub unsafe fn boxed(self) -> Box<T> {
45
1.25k
        unsafe { Box::from_raw(self.ptr.as_ptr()) }
46
1.25k
    }
Unexecuted instantiation: <anyhow::ptr::Own<anyhow::error::ErrorImpl<core::mem::manually_drop::ManuallyDrop<gix_pathspec::parse::Error>>>>::boxed
<anyhow::ptr::Own<anyhow::error::ErrorImpl<gix_pathspec::parse::Error>>>::boxed
Line
Count
Source
44
1.75k
    pub unsafe fn boxed(self) -> Box<T> {
45
1.75k
        unsafe { Box::from_raw(self.ptr.as_ptr()) }
46
1.75k
    }
47
48
5.92k
    pub fn by_ref(&self) -> Ref<T> {
49
5.92k
        Ref {
50
5.92k
            ptr: self.ptr,
51
5.92k
            lifetime: PhantomData,
52
5.92k
        }
53
5.92k
    }
54
55
0
    pub fn by_mut(&mut self) -> Mut<T> {
56
0
        Mut {
57
0
            ptr: self.ptr,
58
0
            lifetime: PhantomData,
59
0
        }
60
0
    }
61
}
62
63
#[repr(transparent)]
64
pub struct Ref<'a, T>
65
where
66
    T: ?Sized,
67
{
68
    pub ptr: NonNull<T>,
69
    lifetime: PhantomData<&'a T>,
70
}
71
72
impl<'a, T> Copy for Ref<'a, T> where T: ?Sized {}
73
74
impl<'a, T> Clone for Ref<'a, T>
75
where
76
    T: ?Sized,
77
{
78
0
    fn clone(&self) -> Self {
79
0
        *self
80
0
    }
81
}
82
83
impl<'a, T> Ref<'a, T>
84
where
85
    T: ?Sized,
86
{
87
0
    pub fn new(ptr: &'a T) -> Self {
88
0
        Ref {
89
0
            ptr: NonNull::from(ptr),
90
0
            lifetime: PhantomData,
91
0
        }
92
0
    }
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_config::lookup::existing::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_config::file::init::types::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_config_value::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::iter::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::buffer::open::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<core::io::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_ref::store_impl::file::log::line::decode::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_error::concrete::message::Message>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<core::io::error::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_url::parse::Error>>>::new
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_pathspec::parse::Error>>>::new
93
94
5.92k
    pub fn from_raw(ptr: NonNull<T>) -> Self {
95
5.92k
        Ref {
96
5.92k
            ptr,
97
5.92k
            lifetime: PhantomData,
98
5.92k
        }
99
5.92k
    }
Unexecuted instantiation: <anyhow::ptr::Ref<dyn core::error::Error + core::marker::Sync + core::marker::Send>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<gix_config::lookup::existing::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<gix_config::file::init::types::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<dyn core::error::Error + core::marker::Sync + core::marker::Send>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<alloc::string::String>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<&str>>::from_raw
<anyhow::ptr::Ref<dyn core::error::Error + core::marker::Sync + core::marker::Send>>::from_raw
Line
Count
Source
94
5.92k
    pub fn from_raw(ptr: NonNull<T>) -> Self {
95
5.92k
        Ref {
96
5.92k
            ptr,
97
5.92k
            lifetime: PhantomData,
98
5.92k
        }
99
5.92k
    }
Unexecuted instantiation: <anyhow::ptr::Ref<gix_config_value::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<dyn core::error::Error + core::marker::Sync + core::marker::Send>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<gix_validate::reference::name::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<gix_ref::store_impl::packed::iter::error::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<gix_ref::store_impl::packed::buffer::open::error::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<dyn core::error::Error + core::marker::Sync + core::marker::Send>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<gix_validate::reference::name::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<dyn core::error::Error + core::marker::Sync + core::marker::Send>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<core::io::error::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<gix_ref::store_impl::file::log::line::decode::error::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<dyn core::error::Error + core::marker::Sync + core::marker::Send>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<gix_error::concrete::message::Message>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<core::io::error::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<dyn core::error::Error + core::marker::Sync + core::marker::Send>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<gix_url::parse::Error>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<dyn core::error::Error + core::marker::Sync + core::marker::Send>>::from_raw
Unexecuted instantiation: <anyhow::ptr::Ref<gix_pathspec::parse::Error>>::from_raw
100
101
5.92k
    pub fn cast<U: CastTo>(self) -> Ref<'a, U::Target> {
102
5.92k
        Ref {
103
5.92k
            ptr: self.ptr.cast(),
104
5.92k
            lifetime: PhantomData,
105
5.92k
        }
106
5.92k
    }
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_config::lookup::existing::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_config::file::init::types::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_config::lookup::existing::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_config::file::init::types::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<gix_config::lookup::existing::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<gix_config::file::init::types::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<alloc::string::String>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<&str>>
Unexecuted instantiation: <anyhow::ptr::Ref<alloc::string::String>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<&str>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_config_value::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<gix_config_value::Error>>::cast::<()>
<anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_config_value::Error>>
Line
Count
Source
101
5.92k
    pub fn cast<U: CastTo>(self) -> Ref<'a, U::Target> {
102
5.92k
        Ref {
103
5.92k
            ptr: self.ptr.cast(),
104
5.92k
            lifetime: PhantomData,
105
5.92k
        }
106
5.92k
    }
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::iter::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::buffer::open::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::iter::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::buffer::open::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<gix_validate::reference::name::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<gix_ref::store_impl::packed::iter::error::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<gix_ref::store_impl::packed::buffer::open::error::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<gix_validate::reference::name::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<core::io::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_ref::store_impl::file::log::line::decode::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::io::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_ref::store_impl::file::log::line::decode::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<core::io::error::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<gix_ref::store_impl::file::log::line::decode::error::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_error::concrete::message::Message>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<core::io::error::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_error::concrete::message::Message>>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<core::io::error::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<gix_error::concrete::message::Message>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<core::io::error::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_url::parse::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_url::parse::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<gix_url::parse::Error>>::cast::<()>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_pathspec::parse::Error>>>::cast::<anyhow::error::ErrorImpl>
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::cast::<anyhow::error::ErrorImpl<gix_pathspec::parse::Error>>
Unexecuted instantiation: <anyhow::ptr::Ref<gix_pathspec::parse::Error>>::cast::<()>
107
108
0
    pub fn by_mut(self) -> Mut<'a, T> {
109
0
        Mut {
110
0
            ptr: self.ptr,
111
0
            lifetime: PhantomData,
112
0
        }
113
0
    }
114
115
5.92k
    pub fn as_ptr(self) -> *const T {
116
5.92k
        self.ptr.as_ptr().cast_const()
117
5.92k
    }
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_config::lookup::existing::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_config::file::init::types::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<alloc::string::String>>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::MessageError<&str>>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<anyhow::wrapper::BoxedError>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<alloc::string::String>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<&str>>>::as_ptr
<anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_config_value::Error>>>::as_ptr
Line
Count
Source
115
5.92k
    pub fn as_ptr(self) -> *const T {
116
5.92k
        self.ptr.as_ptr().cast_const()
117
5.92k
    }
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::iter::error::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_ref::store_impl::packed::buffer::open::error::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_validate::reference::name::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<core::io::error::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_ref::store_impl::file::log::line::decode::error::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_error::concrete::message::Message>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<core::io::error::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_url::parse::Error>>>::as_ptr
Unexecuted instantiation: <anyhow::ptr::Ref<anyhow::error::ErrorImpl<gix_pathspec::parse::Error>>>::as_ptr
118
119
8.89k
    pub unsafe fn deref(self) -> &'a T {
120
8.89k
        unsafe { &*self.ptr.as_ptr() }
121
8.89k
    }
<anyhow::ptr::Ref<dyn core::error::Error + core::marker::Sync + core::marker::Send>>::deref
Line
Count
Source
119
5.92k
    pub unsafe fn deref(self) -> &'a T {
120
5.92k
        unsafe { &*self.ptr.as_ptr() }
121
5.92k
    }
<anyhow::ptr::Ref<anyhow::error::ErrorImpl>>::deref
Line
Count
Source
119
2.96k
    pub unsafe fn deref(self) -> &'a T {
120
2.96k
        unsafe { &*self.ptr.as_ptr() }
121
2.96k
    }
122
}
123
124
#[repr(transparent)]
125
pub struct Mut<'a, T>
126
where
127
    T: ?Sized,
128
{
129
    pub ptr: NonNull<T>,
130
    lifetime: PhantomData<&'a mut T>,
131
}
132
133
impl<'a, T> Copy for Mut<'a, T> where T: ?Sized {}
134
135
impl<'a, T> Clone for Mut<'a, T>
136
where
137
    T: ?Sized,
138
{
139
0
    fn clone(&self) -> Self {
140
0
        *self
141
0
    }
142
}
143
144
impl<'a, T> Mut<'a, T>
145
where
146
    T: ?Sized,
147
{
148
0
    pub fn cast<U: CastTo>(self) -> Mut<'a, U::Target> {
149
0
        Mut {
150
0
            ptr: self.ptr.cast(),
151
0
            lifetime: PhantomData,
152
0
        }
153
0
    }
154
155
0
    pub fn by_ref(self) -> Ref<'a, T> {
156
0
        Ref {
157
0
            ptr: self.ptr,
158
0
            lifetime: PhantomData,
159
0
        }
160
0
    }
161
162
0
    pub fn extend<'b>(self) -> Mut<'b, T> {
163
0
        Mut {
164
0
            ptr: self.ptr,
165
0
            lifetime: PhantomData,
166
0
        }
167
0
    }
168
169
0
    pub unsafe fn deref_mut(self) -> &'a mut T {
170
0
        unsafe { &mut *self.ptr.as_ptr() }
171
0
    }
172
}
173
174
impl<'a, T> Mut<'a, T> {
175
0
    pub unsafe fn read(self) -> T {
176
0
        unsafe { self.ptr.as_ptr().read() }
177
0
    }
178
}
179
180
// Force turbofish on all calls of `.cast::<U>()`.
181
pub trait CastTo {
182
    type Target;
183
}
184
185
impl<T> CastTo for T {
186
    type Target = T;
187
}