Why does concat! demand literals?
Does anyone know why the following doesn't build?
const GREETING: &'static str = "Hello";
const PLACE: &'static str = "World";
const DOESNT_BUILD: &'static str = concat!(GREETING, ", ", PLACE);
I mean, yes, it's because concat only works for literals, but why should that be the case?
Posted Feb 21, 2020, 11:44 PM UTC
https://github.com/Vurich/const-concat/blob/master/README.md
Here’s is a great write up and shows how terrible the work around is.
Well
const_concat!seems like a great macro. Can the hack result in UB somehow?Author here, I saw this post and was immediately like my time has come, I'm happy to see that someone beat me to it