1use crate::emit_traits;
2use newer_type::target;
3
4#[rustversion::since(1.81)]
5emit_traits! {
6 #[implement_of(
7 newer_type_std::fmt::Display,
8 newer_type_std::fmt::Debug,
9 newer_type_std::error::Error
10 )]
11 #[slot(std::io::Error)]
12 #[target(alternative = ::core::error::Error)]
13 pub trait Error: [::core::fmt::Debug + ::core::fmt::Display] {
14 fn source(&self) -> ::core::option::Option<&(dyn ::core::error::Error + 'static)>;
15 }
16}
17
18#[rustversion::before(1.81)]
19emit_traits! {
20 #[implement_of(
21 newer_type_std::fmt::Display,
22 newer_type_std::fmt::Debug,
23 newer_type_std::error::Error
24 )]
25 #[slot(std::io::Error)]
26 #[target(alternative = ::std::error::Error)]
27 pub trait Error: [::core::fmt::Debug + ::core::fmt::Display] {
28 fn source(&self) -> ::core::option::Option<&(dyn ::std::error::Error + 'static)>;
29 }
30}