You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suggested this in rust-lang/rust#42202, to address an issue mentioned there (namely, symbol names that are not valid identifiers in Rust), but there are other uses for such a feature. Certainly it would be helpful if symbols need to be exposed to another language with some sort of mangling but also called from Rust with less ugly names. I also seem to vaguely recall wanting such a feature for some other reason, but I can't recall exactly why.
There are several possible syntaxes:
#[symbol="some_symbol_name"]
#[no_mangle="some_symbol_name"]
Something else
I can't think of any major disadvantages, other than the ones that are already present by allowing no_mangle. And of course the general disadvantage of adding a relatively obscure feature.
The text was updated successfully, but these errors were encountered:
link_name - the name of the symbol that this function or static should be imported as. export_name - on statics and functions, this determines the name of the exported symbol. https://doc.rust-lang.org/stable/reference/attributes.html
It looks to me like these do similar things, the fist when importing a function, the second when exporting a function. Is that wrong? The documentation is somewhat sparse here (these are, after all, fairly obscure and rarely needed features).
I suggested this in rust-lang/rust#42202, to address an issue mentioned there (namely, symbol names that are not valid identifiers in Rust), but there are other uses for such a feature. Certainly it would be helpful if symbols need to be exposed to another language with some sort of mangling but also called from Rust with less ugly names. I also seem to vaguely recall wanting such a feature for some other reason, but I can't recall exactly why.
There are several possible syntaxes:
#[symbol="some_symbol_name"]
#[no_mangle="some_symbol_name"]
I can't think of any major disadvantages, other than the ones that are already present by allowing
no_mangle
. And of course the general disadvantage of adding a relatively obscure feature.The text was updated successfully, but these errors were encountered: