-use rustc_attr as attr;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_middle::mir::*;
// However, we cannot allow stable `const fn`s to use unstable features without an explicit
// opt-in via `allow_internal_unstable`.
- attr::allow_internal_unstable(&tcx.sess, &tcx.get_attrs(def_id))
- .map_or(false, |mut features| features.any(|name| name == feature_gate))
+ super::check_consts::allow_internal_unstable(tcx, def_id, feature_gate)
}
/// Returns `true` if the given library feature gate is allowed within the function with the given `DefId`.
// However, we cannot allow stable `const fn`s to use unstable features without an explicit
// opt-in via `allow_internal_unstable`.
- attr::allow_internal_unstable(&tcx.sess, &tcx.get_attrs(def_id))
- .map_or(false, |mut features| features.any(|name| name == feature_gate))
+ super::check_consts::allow_internal_unstable(tcx, def_id, feature_gate)
}
fn check_terminator(