How to prefix/suffix identifiers within a macro? [duplicate]

Currently this is not supported in stable.


However there is a feature in nightly called concat_idents:

concat_idents!(my_test_, $id)

See

  • Rust docs
  • Issue

Update: it seems there aren't near-term plans to add this into stable releases, see issue.


[...] is it possible to add a prefix to the function?

No. Really, really no. Super totally not at all even in the slightest.

I would like to have use a common prefix.

Put them all in a mod instead.