diff options
author | Alberto Sartori <alberto.sartori@huawei.com> | 2024-07-22 12:20:46 +0200 |
---|---|---|
committer | Alberto Sartori <alberto.sartori@huawei.com> | 2024-07-23 15:41:45 +0200 |
commit | ed652442176aea086104479bb31aced501df48a2 (patch) | |
tree | 582322cce152505eaac16aff5442fcbefbbe3938 /test/c-from-rust/main.rs | |
parent | cda960a4cd846ca97f90b172014fd02206eb74a0 (diff) | |
download | rules-rust-ed652442176aea086104479bb31aced501df48a2.tar.gz |
rules-rust: bugfix: correctly propagate link args of C dependencies
Diffstat (limited to 'test/c-from-rust/main.rs')
-rw-r--r-- | test/c-from-rust/main.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/test/c-from-rust/main.rs b/test/c-from-rust/main.rs index 961150a..081c9d9 100644 --- a/test/c-from-rust/main.rs +++ b/test/c-from-rust/main.rs @@ -1,19 +1,11 @@ use std::env; -extern "C" { - fn c_func(input: i32) -> i32; -} - -fn c_call(i:i32) -> i32{ - unsafe { - return c_func(i); - } -} +extern crate foo_rust; fn main() { let args: Vec<String> = env::args().collect(); match args[1].parse::<i32>() { - Ok(i) => println!("Absolute value of {} is {}",i, c_call(i)), + Ok(i) => println!("Absolute value of {} is {}", i, foo_rust::c_call(i)), Err(..) => println!("Wrong argument {}",args[1]), }; |