by lzutao · 6y ago · 0 comments
Can we use `pub` to make it public and not to be removed ?
The only thing that worked was adding a linker argumment: "-C", "link_args=--undefined=<name_of_function>"
That will force the linker to assume it's referenced.
There's also an `#[used]`[1] attribute, but only for static items. If your use case is special, consider open a feature request in Rust repo.
[1]: https://doc.rust-lang.org/nightly/reference/abi.html#the-use...