I want to do something like #[target_feature(enable = ${ concat($($feat),*) })], which should just concatenate all $feats and pass it to target_feature. But it fails due to macros being lazy. Is there some workaround (nightly-only is fine)? Thanks
Edit: an even simpler example would be sth like #[target_feature(enable = stringify!($a))]
this is not possible with declarative macros. the target_feature attribute only accepts string literals, you cannot use other expressions like concat!(...) or stringify!(...) for it.
note, you don't need concat!() to begin with, target_feature can have multiple enable parameters, and you can also apply #[target_feature] multiple times. e.g. all these are the same:
however, you cannot use the ident fragment to capture the feature name, you still need to use string literals. at the end of day, why do you even do this? to me, replacing an attribute with a macro make little sense. it's not shorter, it's not easier to read.