File tree 2 files changed +11
-2
lines changed
trust_pypi_example/rust/src
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 2
2
History
3
3
=======
4
4
5
- 0.5.0 (2017-05-19 )
5
+ 0.5.0 (2017-05-21 )
6
6
------------------
7
7
8
8
* First release on PyPI.
Original file line number Diff line number Diff line change @@ -14,6 +14,15 @@ pub extern "C" fn is_prime(n: *const c_int) -> c_int {
14
14
1
15
15
}
16
16
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
+
17
26
#[ test]
18
27
fn test_is_prime ( ) {
19
28
let not_prime = 12 ;
@@ -22,4 +31,4 @@ fn test_is_prime() {
22
31
let _false: c_int = 0 ;
23
32
assert_eq ! ( is_prime( not_prime as * const c_int) , _false) ;
24
33
assert_eq ! ( is_prime( is_a_prime as * const c_int) , _true) ;
25
- }
34
+ }
You can’t perform that action at this time.
0 commit comments