Skip to content

Commit 353f8e1

Browse files
committed
ensure that all publicly reachable const fn have const stability info
1 parent c21c781 commit 353f8e1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Diff for: clippy_utils/src/qualify_min_const_fn.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,8 @@ fn is_stable_const_fn(tcx: TyCtxt<'_>, def_id: DefId, msrv: &Msrv) -> bool {
393393

394394
msrv.meets(const_stab_rust_version)
395395
} else {
396-
// Unstable const fn, check if the feature is enabled. We need both the regular stability
397-
// feature and (if set) the const stability feature to const-call this function.
398-
let stab = tcx.lookup_stability(def_id);
399-
let is_enabled = stab.is_some_and(|s| s.is_stable() || tcx.features().enabled(s.feature))
400-
&& const_stab.feature.is_none_or(|f| tcx.features().enabled(f));
401-
is_enabled && msrv.current().is_none()
396+
// Unstable const fn, check if the feature is enabled.
397+
tcx.features().enabled(const_stab.feature) && msrv.current().is_none()
402398
}
403399
})
404400
}

0 commit comments

Comments
 (0)