Skip to content

Commit d60e204

Browse files
Use the same name everywhere for is_const_stable_const_fn
1 parent 9be3d10 commit d60e204

File tree

1 file changed

+4
-2
lines changed
  • compiler/rustc_mir/src/transform/check_consts

1 file changed

+4
-2
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl ConstCx<'mir, 'tcx> {
5555
pub fn is_const_stable_const_fn(&self) -> bool {
5656
self.const_kind == Some(hir::ConstContext::ConstFn)
5757
&& self.tcx.features().staged_api
58-
&& is_const_stable(self.tcx, self.def_id.to_def_id())
58+
&& is_const_stable_const_fn(self.tcx, self.def_id.to_def_id())
5959
}
6060
}
6161

@@ -72,11 +72,13 @@ pub fn allow_internal_unstable(tcx: TyCtxt<'tcx>, def_id: DefId, feature_gate: S
7272

7373
// Returns `true` if the given `const fn` is "const-stable".
7474
//
75+
// Panics if the given `DefId` does not refer to a `const fn`.
76+
//
7577
// Const-stability is only relevant for `const fn` within a `staged_api` crate. Only "const-stable"
7678
// functions can be called in a const-context by users of the stable compiler. "const-stable"
7779
// functions are subject to more stringent restrictions than "const-unstable" functions: They
7880
// cannot use unstable features and can only call other "const-stable" functions.
79-
pub fn is_const_stable(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool {
81+
pub fn is_const_stable_const_fn(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool {
8082
use attr::{ConstStability, Stability, StabilityLevel};
8183

8284
// Const-stability is only relevant for `const fn`.

0 commit comments

Comments
 (0)