diff options
| author | Florian Warzecha <liketechnik@disroot.org> | 2020-10-23 17:11:08 +0200 |
|---|---|---|
| committer | Florian Warzecha <liketechnik@disroot.org> | 2020-10-23 17:14:57 +0200 |
| commit | 13b481b247fe472ccf75b4fb13f3a46ac8f9ecaf (patch) | |
| tree | 6447c615d1e24d5444ac9b62ac9fdbf8658bb1c2 | |
| parent | 83fbdddc99f5fc4f76e144c6d86184dd09169287 (diff) | |
| download | rust-13b481b247fe472ccf75b4fb13f3a46ac8f9ecaf.tar.gz rust-13b481b247fe472ccf75b4fb13f3a46ac8f9ecaf.zip | |
rename allow_internal_unstable() to rustc_allow_const_fn_unstable() in rustc_mir
Followup rename from 05f4a9a42abbbdb64d3ec4ed0ae6883c10c66e3f, which introduced `#[rustc_allow_const_fn_unstable]` for `const fn`s.
| -rw-r--r-- | compiler/rustc_mir/src/transform/check_consts/mod.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_mir/src/transform/check_consts/validation.rs | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/compiler/rustc_mir/src/transform/check_consts/mod.rs b/compiler/rustc_mir/src/transform/check_consts/mod.rs index 11e389cbe44..1eb06c0ef65 100644 --- a/compiler/rustc_mir/src/transform/check_consts/mod.rs +++ b/compiler/rustc_mir/src/transform/check_consts/mod.rs @@ -77,7 +77,11 @@ pub fn is_lang_panic_fn(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool { Some(def_id) == tcx.lang_items().panic_fn() || Some(def_id) == tcx.lang_items().begin_panic_fn() } -pub fn allow_internal_unstable(tcx: TyCtxt<'tcx>, def_id: DefId, feature_gate: Symbol) -> bool { +pub fn rustc_allow_const_fn_unstable( + tcx: TyCtxt<'tcx>, + def_id: DefId, + feature_gate: Symbol, +) -> bool { let attrs = tcx.get_attrs(def_id); attr::rustc_allow_const_fn_unstable(&tcx.sess, attrs) .map_or(false, |mut features| features.any(|name| name == feature_gate)) diff --git a/compiler/rustc_mir/src/transform/check_consts/validation.rs b/compiler/rustc_mir/src/transform/check_consts/validation.rs index e23fb453c5a..30e1d0d8adc 100644 --- a/compiler/rustc_mir/src/transform/check_consts/validation.rs +++ b/compiler/rustc_mir/src/transform/check_consts/validation.rs @@ -292,7 +292,11 @@ impl Validator<'mir, 'tcx> { Status::Unstable(gate) if self.tcx.features().enabled(gate) => { let unstable_in_stable = self.ccx.is_const_stable_const_fn() - && !super::allow_internal_unstable(self.tcx, self.def_id().to_def_id(), gate); + && !super::rustc_allow_const_fn_unstable( + self.tcx, + self.def_id().to_def_id(), + gate, + ); if unstable_in_stable { emit_unstable_in_stable_error(self.ccx, span, gate); } @@ -819,7 +823,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> { // Otherwise, we are something const-stable calling a const-unstable fn. - if super::allow_internal_unstable(tcx, caller, gate) { + if super::rustc_allow_const_fn_unstable(tcx, caller, gate) { return; } |
