3 ms·
The micro-syntax in attributes could have been avoided. There isn't any technical reason why: #[cfg(all(feature = "a", target = "b"))] couldn't look more
by pornel 4y ago
The micro-syntax in attributes could have been avoided. There isn't any technical reason why:
#[cfg(all(feature = "a", target = "b"))]
couldn't look more like the rest of Rust:
#{ has_feature("a") && is_target("b") }
I'm not sure if declarative macros would have been better without a custom syntax. Procedural macros are just regular Rust, and they're verbose and hard to follow. In this case languages that aren't LISP just have to accept some trade-offs.
In case of safe Rust vs unsafe Rust vs compile-time Rust, I think they're fine. They're still using the same language with the same syntax. The specifics of what is allowed in safe/unsafe/const are different, but that's the point of these features.