diff options
| author | Ralf Jung <post@ralfj.de> | 2024-11-24 12:22:01 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-12-14 08:24:18 +0100 |
| commit | eb2e928250066df9e40291fb9fb97308df16046e (patch) | |
| tree | a2736abcdefe9c575309ac6f281ef6511f9654e1 /compiler/rustc_codegen_ssa/src | |
| parent | a1740a9c3568e856f6aa12d83e008d38c9749d4b (diff) | |
| download | rust-eb2e928250066df9e40291fb9fb97308df16046e.tar.gz rust-eb2e928250066df9e40291fb9fb97308df16046e.zip | |
target_features: control separately whether enabling and disabling a target feature is allowed
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/target_features.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs index fa600ec7166..f4d4a9db1d8 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs @@ -65,7 +65,7 @@ pub(crate) fn from_target_feature_attr( // Only allow target features whose feature gates have been enabled // and which are permitted to be toggled. - if let Err(reason) = stability.allow_toggle() { + if let Err(reason) = stability.toggle_allowed(/*enable*/ true) { tcx.dcx().emit_err(errors::ForbiddenTargetFeatureAttr { span: item.span(), feature, @@ -160,7 +160,7 @@ pub(crate) fn provide(providers: &mut Providers) { .target .rust_target_features() .iter() - .map(|&(a, b, _)| (a.to_string(), b.compute_toggleability(target))) + .map(|(a, b, _)| (a.to_string(), b.compute_toggleability(target))) .collect() } }, |
