Ok sorry for the strange title at first, that was my search query entered in a wrong text box. So I'm trying to use a macro to use a string and prefix it for usage in a build tag. But the issue is quite well summed up in this code snippet: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=9905252de14993fa6a31b3c73c5d0a01 The result is `prefix_ doe`. Note the space. Seems to be related to https://github.com/rust-lang/rust/issues/55658. But in his example he does some much more complex things.
Activity
[-]stringify space[/-][+]stringify! space adds strange space before :tt symbol[/+]ExpHP commentedon Oct 29, 2019
Yes. You stringified two identifiers, so the output deliberately contains a space to ensure it contains two identifiers.
If you need to concatenate identifiers, look at the
paste
crate.Alternatively, since you're already stringifying:
concat!("prefix_", stringify!($symbol))