From ed652442176aea086104479bb31aced501df48a2 Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Mon, 22 Jul 2024 12:20:46 +0200 Subject: rules-rust: bugfix: correctly propagate link args of C dependencies --- test/c-from-rust/main.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'test/c-from-rust/main.rs') 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 = env::args().collect(); match args[1].parse::() { - 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]), }; -- cgit v1.2.3