#[cfg(none)] for disabling code

By that logic you couldn't add any new syntax or functions. Maybe they want the error about the missing symbol when calling std::tjdjtkdjr...

Really this seems extremely far fetched.

3 Likes

I've opened an RFC for this feature.

3 Likes

But there is compile_error! for that, which people should use I guess?

1 Like

Obligatory xkcd:

12 Likes

That XKCD remains the funniest demonstration of Hyrum's Law I've seen yet.

1 Like

I wonder if we could have an easier syntax. #[cfg((target_os = "linux" && feature = "magic") || !test)] This is a bit more intuitive for rust users than any and all predicate.

1 Like

Why any/all were used is fairly simple to note: originally, the attribute $:meta syntax was limited to well-nested meta list trees whereas today allows "list" meta to have arbitrary contents (links to the syn syntax tree enum representation).

That this doesn't look like a standard boolean test expression is also helpful, though, in nudging people to remember that cfg values can be multivalued, e.g. key = "a" and key = "b" are independent config.

This is mostly off topic to the OP topic of a blessed always-off config key though.

3 Likes