It's indeed very rare for Rust programs and libraries that have only Rust API. However, I'm using Rust to write a library for use in C and other languages. In a library with C-compatible interface every public function has to have #[no_mangle].
I've scanned 8000 files I have in ~/.cargo/registry as well as Rust's own repo (excluding test cases):
-
Inherited #[mangle]
exception_cleanupsrc/libpanic_unwind/lib.rs -
Inherited #[mangle]
locking_functionopenssl-sys-0.7.1/src/lib.rs -
Inherited #[mangle]
thread_idopenssl-sys-0.7.1/src/lib.rs -
Inherited #[mangle]
shutdownlog-0.3.4/src/lib.rs -
Inherited #[mangle]
raw_verifyopenssl/src/ssl/mod.rs -
Inherited #[mangle]
subtransport_freegit2/src/transport.rs -
Inherited #[no_mangle]
rust_eh_personalitysrc/libpanic_unwind/lib.rs -
Inherited #[no_mangle]
block_context_copyblock/src/lib.rs -
Inherited #[no_mangle]
locking_functionopenssl-sys/src/lib.rs -
Inherited #[no_mangle]
ppapi_instance_createdppapi/src/lib/lib.rs -
Inherited #[no_mangle]
ppapi_instance_destroyedppapi/src/lib/lib.rs -
Public #[no_mangle]
__rust_allocatesrc/liballoc_jemalloc/lib.rs -
Public #[no_mangle]
__rust_allocatesrc/liballoc_system/lib.rs -
Public #[no_mangle]
__rust_deallocatesrc/liballoc_jemalloc/lib.rs -
Public #[no_mangle]
__rust_deallocatesrc/liballoc_system/lib.rs -
Public #[no_mangle]
__rust_maybe_catch_panicsrc/libpanic_abort/lib.rs -
Public #[no_mangle]
__rust_maybe_catch_panicsrc/libpanic_unwind/lib.rs -
Public #[no_mangle]
__rust_reallocatesrc/liballoc_jemalloc/lib.rs -
Public #[no_mangle]
__rust_reallocatesrc/liballoc_system/lib.rs -
Public #[no_mangle]
__rust_reallocate_inplacesrc/liballoc_jemalloc/lib.rs -
Public #[no_mangle]
__rust_reallocate_inplacesrc/liballoc_system/lib.rs -
Public #[no_mangle]
__rust_start_panicsrc/libpanic_abort/lib.rs -
Public #[no_mangle]
__rust_start_panicsrc/libpanic_unwind/lib.rs -
Public #[no_mangle]
__rust_usable_sizesrc/liballoc_jemalloc/lib.rs -
Public #[no_mangle]
__rust_usable_sizesrc/liballoc_system/lib.rs -
Public #[no_mangle]
rust_eh_personalitysrc/libpanic_abort/lib.rs -
Public #[no_mangle]
rust_eh_personality_catchsrc/libpanic_unwind/lib.rs
These would be affected:
-
Public #[mangle]
callbackglutin/src/api/win32/callback.rs -- used aspub(crate) -
Public #[mangle]
curl_progress_fncurl/src/ffi/easy.rs -- used as a callback -
Public #[mangle]
did_change_focusppapi/src/lib/lib.rs -- used aspub(crate) -
Public #[mangle]
did_change_viewppapi/src/lib/lib.rs -
Public #[mangle]
did_createppapi/src/lib/lib.rs -
Public #[mangle]
did_destroyppapi/src/lib/lib.rs -
Public #[mangle]
graphics_context_lostppapi/src/lib/lib.rs -
Public #[mangle]
handle_document_loadppapi/src/lib/lib.rs -
Public #[mangle]
handle_input_eventppapi/src/lib/lib.rs -
Public #[mangle]
handle_messageppapi/src/lib/lib.rs -
Public #[mangle]
mz_crc32flate2/src/ffi.rs -- used aspub(crate)? Probably doesn't have to be extern "C" -
Public #[mangle]
mz_deflateInit2flate2/src/ffi.rs -
Public #[mangle]
mz_inflateInit2flate2/src/ffi.rs -
Public #[mangle]
openlibc/rust/src/liblibc/lib.rs -- odd, looks like an error? -
Public #[mangle]
FD_SETlibc-0.x/src/lib.rs - pub extern fn functions without #[no_mangle] · Issue #376 · rust-lang/libc · GitHub -
Public #[mangle]
FD_ZEROlibc-0.x/src/lib.rs -
Public #[mangle]
WCOREDUMPlibc-0.x/src/lib.rs -
Public #[mangle]
WEXITSTATUSlibc-0.x/src/lib.rs -
Public #[mangle]
WIFCONTINUEDlibc-0.x/src/lib.rs -
Public #[mangle]
WIFEXITEDlibc-0.x/src/lib.rs -
Public #[mangle]
WTERMSIGlibc-0.x/src/lib.rs -
Public #[mangle]
_WSTATUSlibc-0.x/src/lib.rs