9 #[fail(display = "An error has occurred.")]
10 pub struct UnboundedGenericTupleError
<T
: '
static + Debug
+ Send
+ Sync
>(T
);
13 fn unbounded_generic_tuple_error() {
14 let s
= format
!("{}", UnboundedGenericTupleError(()));
15 assert_eq
!(&s
[..], "An error has occurred.");
18 #[derive(Debug, Fail)]
19 #[fail(display = "An error has occurred: {}", _0)]
20 pub struct FailBoundsGenericTupleError
<T
: Fail
>(T
);
23 fn fail_bounds_generic_tuple_error() {
24 let error
= FailBoundsGenericTupleError(UnboundedGenericTupleError(()));
25 let s
= format
!("{}", error
);
26 assert_eq
!(&s
[..], "An error has occurred: An error has occurred.");
29 pub trait NoDisplay
: '
static + Debug
+ Send
+ Sync {}
31 impl NoDisplay
for &'
static str {}
33 #[derive(Debug, Fail)]
34 #[fail(display = "An error has occurred: {:?}", _0)]
35 pub struct CustomBoundsGenericTupleError
<T
: NoDisplay
>(T
);
38 fn custom_bounds_generic_tuple_error() {
39 let error
= CustomBoundsGenericTupleError("more details unavailable.");
40 let s
= format
!("{}", error
);
43 "An error has occurred: \"more details unavailable.\""