Skip to content

Commit 13b481b

Browse files
committed
rename allow_internal_unstable() to rustc_allow_const_fn_unstable() in rustc_mir
Followup rename from 05f4a9a, which introduced `#[rustc_allow_const_fn_unstable]` for `const fn`s.
1 parent 83fbddd commit 13b481b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

compiler/rustc_mir/src/transform/check_consts/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ pub fn is_lang_panic_fn(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool {
7777
Some(def_id) == tcx.lang_items().panic_fn() || Some(def_id) == tcx.lang_items().begin_panic_fn()
7878
}
7979

80-
pub fn allow_internal_unstable(tcx: TyCtxt<'tcx>, def_id: DefId, feature_gate: Symbol) -> bool {
80+
pub fn rustc_allow_const_fn_unstable(
81+
tcx: TyCtxt<'tcx>,
82+
def_id: DefId,
83+
feature_gate: Symbol,
84+
) -> bool {
8185
let attrs = tcx.get_attrs(def_id);
8286
attr::rustc_allow_const_fn_unstable(&tcx.sess, attrs)
8387
.map_or(false, |mut features| features.any(|name| name == feature_gate))

compiler/rustc_mir/src/transform/check_consts/validation.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,11 @@ impl Validator<'mir, 'tcx> {
292292

293293
Status::Unstable(gate) if self.tcx.features().enabled(gate) => {
294294
let unstable_in_stable = self.ccx.is_const_stable_const_fn()
295-
&& !super::allow_internal_unstable(self.tcx, self.def_id().to_def_id(), gate);
295+
&& !super::rustc_allow_const_fn_unstable(
296+
self.tcx,
297+
self.def_id().to_def_id(),
298+
gate,
299+
);
296300
if unstable_in_stable {
297301
emit_unstable_in_stable_error(self.ccx, span, gate);
298302
}
@@ -819,7 +823,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
819823

820824
// Otherwise, we are something const-stable calling a const-unstable fn.
821825

822-
if super::allow_internal_unstable(tcx, caller, gate) {
826+
if super::rustc_allow_const_fn_unstable(tcx, caller, gate) {
823827
return;
824828
}
825829

0 commit comments

Comments
 (0)