diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2022-02-08 04:52:11 -0500 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-05-19 12:21:45 +0000 |
| commit | a9dd4cfa6b5398b945d3ad39e01bedb5d861ed60 (patch) | |
| tree | 32f0ae3100e71fb9a980dd1db74aaabf2be00fbd /compiler/rustc_const_eval/src/const_eval | |
| parent | f53fc41cfcb49bb47dab47962e045dd007f9ba9f (diff) | |
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.
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/fn_queries.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/fn_queries.rs b/compiler/rustc_const_eval/src/const_eval/fn_queries.rs index 777f4393458..d6f62062d1f 100644 --- a/compiler/rustc_const_eval/src/const_eval/fn_queries.rs +++ b/compiler/rustc_const_eval/src/const_eval/fn_queries.rs @@ -9,7 +9,7 @@ use rustc_span::symbol::Symbol; pub fn is_unstable_const_fn(tcx: TyCtxt<'_>, def_id: DefId) -> Option<Symbol> { if tcx.is_const_fn_raw(def_id) { let const_stab = tcx.lookup_const_stability(def_id)?; - if const_stab.level.is_unstable() { Some(const_stab.feature) } else { None } + if const_stab.is_const_unstable() { Some(const_stab.feature) } else { None } } else { None } |
