about summary refs log tree commit diff
path: root/compiler/rustc_mir/src
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2020-09-18 09:17:13 -0700
committerDylan MacKenzie <ecstaticmorse@gmail.com>2020-09-22 10:05:58 -0700
commitd60e204e0adb899de3bc1e4a87a04a1cb56238b5 (patch)
treee647e80e16c122b623e8ff332da406f12cb0383c /compiler/rustc_mir/src
parent9be3d106c39b292af064cdd8998b34d6d1b9ab04 (diff)
downloadrust-d60e204e0adb899de3bc1e4a87a04a1cb56238b5.tar.gz
rust-d60e204e0adb899de3bc1e4a87a04a1cb56238b5.zip
Use the same name everywhere for `is_const_stable_const_fn`
Diffstat (limited to 'compiler/rustc_mir/src')
-rw-r--r--compiler/rustc_mir/src/transform/check_consts/mod.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_mir/src/transform/check_consts/mod.rs b/compiler/rustc_mir/src/transform/check_consts/mod.rs
index b49945f3f9d..8d4efd8ae80 100644
--- a/compiler/rustc_mir/src/transform/check_consts/mod.rs
+++ b/compiler/rustc_mir/src/transform/check_consts/mod.rs
@@ -55,7 +55,7 @@ impl ConstCx<'mir, 'tcx> {
     pub fn is_const_stable_const_fn(&self) -> bool {
         self.const_kind == Some(hir::ConstContext::ConstFn)
             && self.tcx.features().staged_api
-            && is_const_stable(self.tcx, self.def_id.to_def_id())
+            && is_const_stable_const_fn(self.tcx, self.def_id.to_def_id())
     }
 }
 
@@ -72,11 +72,13 @@ pub fn allow_internal_unstable(tcx: TyCtxt<'tcx>, def_id: DefId, feature_gate: S
 
 // Returns `true` if the given `const fn` is "const-stable".
 //
+// Panics if the given `DefId` does not refer to a `const fn`.
+//
 // Const-stability is only relevant for `const fn` within a `staged_api` crate. Only "const-stable"
 // functions can be called in a const-context by users of the stable compiler. "const-stable"
 // functions are subject to more stringent restrictions than "const-unstable" functions: They
 // cannot use unstable features and can only call other "const-stable" functions.
-pub fn is_const_stable(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool {
+pub fn is_const_stable_const_fn(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool {
     use attr::{ConstStability, Stability, StabilityLevel};
 
     // Const-stability is only relevant for `const fn`.