Add and use stability helper methods
This avoids an ambiguity (when reading) where `.level.is_stable()` is not immediately clear whether it is general stability or const stability.
This commit is contained in:
@@ -2791,7 +2791,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
pub fn is_const_fn(self, def_id: DefId) -> bool {
|
||||
if self.is_const_fn_raw(def_id) {
|
||||
match self.lookup_const_stability(def_id) {
|
||||
Some(stability) if stability.level.is_unstable() => {
|
||||
Some(stability) if stability.is_const_unstable() => {
|
||||
// has a `rustc_const_unstable` attribute, check whether the user enabled the
|
||||
// corresponding feature gate.
|
||||
self.features()
|
||||
|
||||
Reference in New Issue
Block a user