@@ -23,7 +23,7 @@ use rustc_middle::middle::stability;
23
23
use rustc_middle:: ty:: fold:: TypeFolder ;
24
24
use rustc_middle:: ty:: subst:: InternalSubsts ;
25
25
use rustc_middle:: ty:: { self , AdtKind , Lift , Ty , TyCtxt } ;
26
- use rustc_mir:: const_eval:: is_min_const_fn;
26
+ use rustc_mir:: const_eval:: { is_min_const_fn, is_unstable_const_fn } ;
27
27
use rustc_span:: hygiene:: MacroKind ;
28
28
use rustc_span:: symbol:: { kw, sym, Ident , Symbol } ;
29
29
use rustc_span:: { self , Pos } ;
@@ -900,7 +900,7 @@ impl Clean<Item> for doctree::Function<'_> {
900
900
enter_impl_trait ( cx, || ( self . generics . clean ( cx) , ( self . decl , self . body ) . clean ( cx) ) ) ;
901
901
902
902
let did = cx. tcx . hir ( ) . local_def_id ( self . id ) ;
903
- let constness = if is_min_const_fn ( cx. tcx , did. to_def_id ( ) ) {
903
+ let constness = if ! is_unstable_const_fn ( cx. tcx , did. to_def_id ( ) ) . is_some ( ) {
904
904
hir:: Constness :: Const
905
905
} else {
906
906
hir:: Constness :: NotConst
@@ -1108,7 +1108,7 @@ impl Clean<Item> for hir::TraitItem<'_> {
1108
1108
hir:: TraitItemKind :: Fn ( ref sig, hir:: TraitFn :: Provided ( body) ) => {
1109
1109
let mut m = ( sig, & self . generics , body, None ) . clean ( cx) ;
1110
1110
if m. header . constness == hir:: Constness :: Const
1111
- && ! is_min_const_fn ( cx. tcx , local_did. to_def_id ( ) )
1111
+ && is_unstable_const_fn ( cx. tcx , local_did. to_def_id ( ) ) . is_some ( )
1112
1112
{
1113
1113
m. header . constness = hir:: Constness :: NotConst ;
1114
1114
}
@@ -1121,7 +1121,7 @@ impl Clean<Item> for hir::TraitItem<'_> {
1121
1121
let ( all_types, ret_types) = get_all_types ( & generics, & decl, cx) ;
1122
1122
let mut t = TyMethod { header : sig. header , decl, generics, all_types, ret_types } ;
1123
1123
if t. header . constness == hir:: Constness :: Const
1124
- && ! is_min_const_fn ( cx. tcx , local_did. to_def_id ( ) )
1124
+ && is_unstable_const_fn ( cx. tcx , local_did. to_def_id ( ) ) . is_some ( )
1125
1125
{
1126
1126
t. header . constness = hir:: Constness :: NotConst ;
1127
1127
}
@@ -1154,7 +1154,7 @@ impl Clean<Item> for hir::ImplItem<'_> {
1154
1154
hir:: ImplItemKind :: Fn ( ref sig, body) => {
1155
1155
let mut m = ( sig, & self . generics , body, Some ( self . defaultness ) ) . clean ( cx) ;
1156
1156
if m. header . constness == hir:: Constness :: Const
1157
- && ! is_min_const_fn ( cx. tcx , local_did. to_def_id ( ) )
1157
+ && is_unstable_const_fn ( cx. tcx , local_did. to_def_id ( ) ) . is_some ( )
1158
1158
{
1159
1159
m. header . constness = hir:: Constness :: NotConst ;
1160
1160
}
0 commit comments