summaryrefslogtreecommitdiffstats
path: root/third_party/rust/error-chain/tests/quick_main.rs
blob: 4ada3b4e03d12b4ad2e5d0e1ba49952205301874 (plain)
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
#![allow(dead_code)]
#[macro_use]
extern crate error_chain;

error_chain!();

mod unit {
    use super::*;
    quick_main!(run);

    fn run() -> Result<()> {
        Ok(())
    }
}

mod i32 {
    use super::*;
    quick_main!(run);

    fn run() -> Result<i32> {
        Ok(1)
    }
}

mod closure {
    use super::*;
    quick_main!(|| -> Result<()> { Ok(()) });
}