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
76
77
78
79
80
81
82
// #![skerry]
// extern crate self as skerry;
// pub use skerry::*;
// pub struct OuterErrorFromLib;
// #[skerry_mod]
// pub mod errors {
// pub struct ErrA;
// pub struct ErrB;
// pub struct ErrC;
// pub struct ErrD;
// pub struct ErrE;
// pub struct ErrF;
// #[from]
// pub struct Outer(OuterErrorFromLib);
// }
// fn my_fn1() -> Result<(), e![ErrA, ErrB, ErrC]> {
// non_existent();
// Err(MyFn1Error::ErrA(ErrA))
// }
// fn my_fn2() -> Result<(), e![ErrE, ErrF, Outer]> {
// let r: std::result::Result<(), OuterErrorFromLib> = std::result::Result::Err(OuterErrorFromLib);
// let _ = r?;
// Ok(())
// }
// pub fn my_fn3() -> Result<(), e![ErrA, ErrB, ErrC, *MyFn2Error]> {
// my_fn2()?;
// my_fn1()?;
// Ok(())
// }
// define_error!(DefineTest, [ErrA]);
// pub struct MyStruct;
// impl MyStruct {
// pub fn struct_fn() -> Result<(), e![*DefineTest, *MyFn3Error]> {
// my_fn3()?;
// Ok(())
// }
// pub fn struct_fn_2() -> Result<(), e![*MyStructStructFnError]> {
// Self::struct_fn()?;
// Ok(())
// }
// }
// trait TestTrait {
// fn test() -> Result<(), e![ErrA, ErrB, *MyFn3Error]>;
// fn test_2() -> Result<(), e![ErrA, ErrB, *MyFn3Error]> {
// Ok(())
// }
// }
// impl TestTrait for MyStruct {
// fn test() -> Result<(), TestTraitTestError> {
// my_fn3()?;
// Ok(())
// }
// }
// fn no_expand_func() -> Result<(), MyFn3Error> {
// let r: Result<(), MyFn2Error> = Err(MyFn2Error::ErrE(ErrE));
// Ok(r?)
// }
// #[test]
// pub fn test() {
// let _ = my_fn3();
// let _ = MyStruct::test();
// let _ = MyStruct::test_2();
// let _ = MyStruct::struct_fn_2();
// let _ = no_expand_func();
// }