Skip to content

Commit 1ff0558

Browse files
committed
target_features: control separately whether enabling and disabling a target feature is allowed
1 parent 90a7089 commit 1ff0558

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/gcc_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
9696
}
9797
Some((_, stability, _)) => {
9898
if let Err(reason) =
99-
stability.compute_toggleability(&sess.target).allow_toggle()
99+
stability.toggle_allowed(&sess.target, enable_disable == '+')
100100
{
101101
sess.dcx().emit_warn(ForbiddenCTargetFeature { feature, reason });
102102
} else if stability.requires_nightly().is_some() {

src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,9 @@ fn target_features_cfg(
483483
.rust_target_features()
484484
.iter()
485485
.filter(|(_, gate, _)| gate.in_cfg())
486-
.filter_map(|&(feature, gate, _)| {
486+
.filter_map(|(feature, gate, _)| {
487487
if sess.is_nightly_build() || allow_unstable || gate.requires_nightly().is_none() {
488-
Some(feature)
488+
Some(*feature)
489489
} else {
490490
None
491491
}

0 commit comments

Comments
 (0)