]> git.lizzy.rs Git - rust.git/blob - src/test/run-make-fulldeps/c-unwind-abi-catch-lib-panic/panic.rs
Rollup merge of #96081 - eduardosm:masks_usize_size_agnostic, r=yaahc
[rust.git] / src / test / run-make-fulldeps / c-unwind-abi-catch-lib-panic / panic.rs
1 #![crate_type = "staticlib"]
2 #![feature(c_unwind)]
3
4 /// This function will panic if `x` is greater than 10.
5 ///
6 /// This function is called by `add_small_numbers`.
7 #[no_mangle]
8 pub extern "C-unwind" fn panic_if_greater_than_10(x: u32) {
9     if x > 10 {
10         panic!("{}", x); // That is too big!
11     }
12 }