@@ -206,7 +206,7 @@ fn lookup_const_stability(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<ConstSt
206206 let parent_stab = tcx. lookup_stability ( parent) ?;
207207 if parent_stab. is_unstable ( )
208208 && let Some ( fn_sig) = tcx. hir_node_by_def_id ( def_id) . fn_sig ( )
209- && fn_sig. header . is_const ( )
209+ && matches ! ( fn_sig. header. constness , Constness :: Const { .. } )
210210 {
211211 let const_stable_indirect = find_attr ! ( tcx, def_id, RustcConstStableIndirect ) ;
212212 return Some ( ConstStability :: unmarked ( const_stable_indirect, parent_stab) ) ;
@@ -228,7 +228,7 @@ fn lookup_const_stability(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<ConstSt
228228 // If this is a const fn but not annotated with stability markers, see if we can inherit
229229 // regular stability.
230230 if let Some ( fn_sig) = tcx. hir_node_by_def_id ( def_id) . fn_sig ( )
231- && fn_sig. header . is_const ( )
231+ && matches ! ( fn_sig. header. constness , Constness :: Const { .. } )
232232 && const_stab. is_none ( )
233233 // We only ever inherit unstable features.
234234 && let Some ( inherit_regular_stab) = tcx. lookup_stability ( def_id)
@@ -384,7 +384,7 @@ impl<'tcx> MissingStabilityAnnotations<'tcx> {
384384 // implied), check if the function/method is const or the parent impl block is const.
385385 let fn_sig = self . tcx . hir_node_by_def_id ( def_id) . fn_sig ( ) ;
386386 if let Some ( fn_sig) = fn_sig
387- && !fn_sig. header . is_const ( )
387+ && !matches ! ( fn_sig. header. constness , Constness :: Const { .. } )
388388 && const_stab. is_some ( )
389389 && find_attr_span ! ( RustcConstStability ) . is_some ( )
390390 {
0 commit comments