if is_lang_panic_fn(self.tcx, def_id) {
self.check_op(ops::Panic);
} else if let Some(feature) = is_unstable_const_fn(self.tcx, def_id) {
- // Exempt unstable const fns inside of macros with
+ // Exempt unstable const fns inside of macros or functions with
// `#[allow_internal_unstable]`.
- if !self.span.allows_unstable(feature) {
+ use crate::transform::qualify_min_const_fn::lib_feature_allowed;
+ if !self.span.allows_unstable(feature)
+ && !lib_feature_allowed(self.tcx, self.def_id, feature)
+ {
self.check_op(ops::FnCallUnstable(def_id, feature));
}
} else {