target_features: control separately whether enabling and disabling a target feature is allowed
This commit is contained in:
parent
a1740a9c35
commit
eb2e928250
5 changed files with 64 additions and 31 deletions
|
@ -483,9 +483,9 @@ fn target_features_cfg(
|
|||
.rust_target_features()
|
||||
.iter()
|
||||
.filter(|(_, gate, _)| gate.in_cfg())
|
||||
.filter_map(|&(feature, gate, _)| {
|
||||
.filter_map(|(feature, gate, _)| {
|
||||
if sess.is_nightly_build() || allow_unstable || gate.requires_nightly().is_none() {
|
||||
Some(feature)
|
||||
Some(*feature)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue