gemini-code-assist[bot] commented on code in PR #590:
URL: https://github.com/apache/tvm-ffi/pull/590#discussion_r3245605749
##########
rust/tvm-ffi/src/macros.rs:
##########
@@ -260,11 +260,22 @@ macro_rules! impl_arg_into_ref {
macro_rules! tvm_ffi_dll_export_typed_func {
($name:ident, $func:expr) => {
$crate::macros::paste::paste! {
+ // `#[no_mangle]` is required so the symbol is preserved in a
+ // `cdylib` and matches the `__tvm_ffi_<name>` naming convention
+ // that `ffi.Module.load_from_file.<format>` looks up via
+ // `GetSymbolWithSymbolPrefix`. Without it, the linker strips the
+ // function from the output `.so`.
+ //
+ // The path-qualified `$crate::tvm_ffi_sys::…` reference (rather
+ // than a bare `tvm_ffi_sys::…`) lets downstream crates use the
+ // macro without having to add `tvm-ffi-sys` to their own
+ // `[dependencies]`.
+ #[unsafe(no_mangle)]
Review Comment:

The `#[unsafe(no_mangle)]` attribute is a relatively new feature introduced
in Rust 1.82.0. Using it will cause compilation errors for any users or
downstream crates using an older version of the Rust compiler (e.g., 1.81 or
earlier). Unless this project has a strict requirement to bump its Minimum
Supported Rust Version (MSRV) to 1.82, it is safer to use the standard
`#[no_mangle]` attribute, which is compatible with all Rust versions and
remains perfectly valid.
```suggestion
#[no_mangle]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]