diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-05 19:43:35 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-16 08:17:23 +1100 |
| commit | d284c8a2d7a2de918a966bee9c9069d7b5bf06bf (patch) | |
| tree | 0a25ff76c1863aa37269ba5d8cd2ea817078c2ef /compiler/rustc_passes | |
| parent | 41b689948736cc79f35b6002c040513291dcd7c2 (diff) | |
| download | rust-d284c8a2d7a2de918a966bee9c9069d7b5bf06bf.tar.gz rust-d284c8a2d7a2de918a966bee9c9069d7b5bf06bf.zip | |
Rename `ACTIVE_FEATURES` as `UNSTABLE_FEATURES`.
It's a better name, and lets "active features" refer to the features that are active in a particular program, due to being declared or enabled by the edition. The commit also renames `Features::enabled` as `Features::active` to match this; I changed my mind and have decided that "active" is a little better thatn "enabled" for this, particularly because a number of pre-existing comments use "active" in this way. Finally, the commit renames `Status::Stable` as `Status::Accepted`, to match `ACCEPTED_FEATURES`.
Diffstat (limited to 'compiler/rustc_passes')
| -rw-r--r-- | compiler/rustc_passes/src/check_const.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_passes/src/check_const.rs b/compiler/rustc_passes/src/check_const.rs index 6d176af8098..7188c177feb 100644 --- a/compiler/rustc_passes/src/check_const.rs +++ b/compiler/rustc_passes/src/check_const.rs @@ -86,7 +86,7 @@ impl<'tcx> CheckConstVisitor<'tcx> { let is_feature_allowed = |feature_gate| { // All features require that the corresponding gate be enabled, // even if the function has `#[rustc_allow_const_fn_unstable(the_gate)]`. - if !tcx.features().enabled(feature_gate) { + if !tcx.features().active(feature_gate) { return false; } @@ -134,7 +134,7 @@ impl<'tcx> CheckConstVisitor<'tcx> { let required_gates = required_gates.unwrap_or(&[]); let missing_gates: Vec<_> = - required_gates.iter().copied().filter(|&g| !features.enabled(g)).collect(); + required_gates.iter().copied().filter(|&g| !features.active(g)).collect(); match missing_gates.as_slice() { [] => { |
