Skip to content

Add attribute to specify symbol name, as an alternative to no_mangle #2007

Closed
@ids1024

Description

@ids1024

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions