Coverage Report

Created: 2026-03-31 06:24

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.58/src/wrapper.rs
Line
Count
Source
1
use crate::StdError;
2
use core::fmt::{self, Debug, Display};
3
4
#[repr(transparent)]
5
pub struct MessageError<M>(pub M);
6
7
impl<M> Debug for MessageError<M>
8
where
9
    M: Display + Debug,
10
{
11
0
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
12
0
        Debug::fmt(&self.0, f)
13
0
    }
Unexecuted instantiation: <anyhow::wrapper::MessageError<alloc::string::String> as core::fmt::Debug>::fmt
Unexecuted instantiation: <anyhow::wrapper::MessageError<&str> as core::fmt::Debug>::fmt
14
}
15
16
impl<M> Display for MessageError<M>
17
where
18
    M: Display + Debug,
19
{
20
0
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
21
0
        Display::fmt(&self.0, f)
22
0
    }
Unexecuted instantiation: <anyhow::wrapper::MessageError<alloc::string::String> as core::fmt::Display>::fmt
Unexecuted instantiation: <anyhow::wrapper::MessageError<&str> as core::fmt::Display>::fmt
23
}
24
25
impl<M> StdError for MessageError<M> where M: Display + Debug + 'static {}
26
27
#[repr(transparent)]
28
pub struct DisplayError<M>(pub M);
29
30
impl<M> Debug for DisplayError<M>
31
where
32
    M: Display,
33
{
34
0
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
35
0
        Display::fmt(&self.0, f)
36
0
    }
Unexecuted instantiation: <anyhow::wrapper::DisplayError<alloc::string::String> as core::fmt::Debug>::fmt
Unexecuted instantiation: <anyhow::wrapper::DisplayError<&str> as core::fmt::Debug>::fmt
Unexecuted instantiation: <anyhow::wrapper::DisplayError<_> as core::fmt::Debug>::fmt
37
}
38
39
impl<M> Display for DisplayError<M>
40
where
41
    M: Display,
42
{
43
0
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
44
0
        Display::fmt(&self.0, f)
45
0
    }
Unexecuted instantiation: <anyhow::wrapper::DisplayError<alloc::string::String> as core::fmt::Display>::fmt
Unexecuted instantiation: <anyhow::wrapper::DisplayError<&str> as core::fmt::Display>::fmt
Unexecuted instantiation: <anyhow::wrapper::DisplayError<_> as core::fmt::Display>::fmt
46
}
47
48
impl<M> StdError for DisplayError<M> where M: Display + 'static {}
49
50
#[cfg(feature = "std")]
51
#[repr(transparent)]
52
pub struct BoxedError(pub Box<dyn StdError + Send + Sync>);
53
54
#[cfg(feature = "std")]
55
impl Debug for BoxedError {
56
0
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
57
0
        Debug::fmt(&self.0, f)
58
0
    }
59
}
60
61
#[cfg(feature = "std")]
62
impl Display for BoxedError {
63
0
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
64
0
        Display::fmt(&self.0, f)
65
0
    }
66
}
67
68
#[cfg(feature = "std")]
69
impl StdError for BoxedError {
70
    #[cfg(backtrace)]
71
    fn backtrace(&self) -> Option<&crate::backtrace::Backtrace> {
72
        self.0.backtrace()
73
    }
74
75
0
    fn source(&self) -> Option<&(dyn StdError + 'static)> {
76
0
        self.0.source()
77
0
    }
78
}