mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 19:55:39 +00:00
c832f2d6d6
This is mostly to verify compilation and linkage. The test itself just verifies the contents of an returned string. --HG-- extra : rebase_source : b35f41d565c6fda85ad010a328cd61b3c37681da
7 lines
164 B
Rust
7 lines
164 B
Rust
#[no_mangle]
|
|
pub extern fn test_rust() -> *const u8 {
|
|
// NB: rust &str aren't null terminated.
|
|
let greeting = "hello from rust.\0";
|
|
greeting.as_ptr()
|
|
}
|