chore(vendor): add anyhow crate
This commit was merged in pull request #68.
This commit is contained in:
19
third_party/crates/anyhow-1.0.104/tests/test_ffi.rs
vendored
Normal file
19
third_party/crates/anyhow-1.0.104/tests/test_ffi.rs
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
#![deny(improper_ctypes, improper_ctypes_definitions)]
|
||||
#![allow(clippy::uninlined_format_args)]
|
||||
|
||||
use anyhow::anyhow;
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn anyhow1(err: anyhow::Error) {
|
||||
println!("{:?}", err);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn anyhow2(err: &mut Option<anyhow::Error>) {
|
||||
*err = Some(anyhow!("ffi error"));
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn anyhow3() -> Option<anyhow::Error> {
|
||||
Some(anyhow!("ffi error"))
|
||||
}
|
||||
Reference in New Issue
Block a user