Skip to content

Commit 69bd7f3

Browse files
vagrantvagrant
vagrant
authored and
vagrant
committed
Make compiler happy for linux and OSX
1 parent dfafb88 commit 69bd7f3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

HISTORY.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
History
33
=======
44

5-
0.5.0 (2017-05-19)
5+
0.5.0 (2017-05-21)
66
------------------
77

88
* First release on PyPI.

trust_pypi_example/rust/src/lib.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ pub extern "C" fn is_prime(n: *const c_int) -> c_int {
1414
1
1515
}
1616

17+
#[allow(dead_code)]
18+
#[no_mangle]
19+
pub extern "C" fn spare() {
20+
// https://github.com/rust-lang/rust/issues/38281 😂
21+
println!("");
22+
//adding this (doesn't have to be named "spare") makes the compilation work.
23+
// you don't even need to add this function signature where you're using these functions.
24+
}
25+
1726
#[test]
1827
fn test_is_prime() {
1928
let not_prime = 12;
@@ -22,4 +31,4 @@ fn test_is_prime() {
2231
let _false: c_int = 0;
2332
assert_eq!(is_prime(not_prime as *const c_int), _false);
2433
assert_eq!(is_prime(is_a_prime as *const c_int), _true);
25-
}
34+
}

0 commit comments

Comments
 (0)