File: throwing-main.rs

package info (click to toggle)
rust-fehler 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid
  • size: 132 kB
  • sloc: makefile: 4
file content (18 lines) | stat: -rw-r--r-- 175 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use fehler::*;

#[derive(Debug)]
struct Error;

#[throws(_)]
fn do_it() -> i32 {
    if true {
        throw!(Error);
    }

    0
}

#[throws(_)]
fn main() {
    do_it()?;
}