RFC: `target_feature`

Since cfg_target_feature has been available on nightly for a while I'd like to give the RFC: target_feature some more exposure.

The main major breaking change for those using cfg_target_feature on nightly is that one will need to enable a feature macro for each target feature you are using doing something like: #![allow(target_feature_avx2)]. The RFC proposes a grace period of one full release cycle in which not doing this only triggers a warning on nightly, but this warning will turn into a hard error afterwards. Please let us know if this grace period is no long enough.

The RFC changes the semantics of the #[target_feature] attribute quite a bit, but since it is fairly recent, hopefully the number of people affected will be much smaller.

The RFC also changes/specifies the semantics of -C --target-feature= on all release channels (this is already available on stable) for new features, and proposes introducing a warning for unstable features. If this is unacceptable for you please let us know.

2 Likes