Implement cfg_os_version_min by madsmtm · Pull Request #136867 · rust-lang/rust (original) (raw)

Implement the cfg_os_version_min feature that is being RFC'd in rust-lang/rfcs#3750, tracking issue #136866. This implementation only handles Apple targets, but it should be fairly easy to add support for other targets after this.

The RFC is not finalized, and as such things may change (especially the syntax). Regardless, I think it makes sense to start experimenting with it; even if the feature is ultimately rejected, it is necessary for the standard library (an example is that it would allow us to ship #122408 without a dangerous fallback).

Using this in the standard library is done in a draft PR.

CC @ChrisDenton @BlackHoleFox
@rustbot label O-apple
r? rust-lang/compiler