提交 0f12711d 编写于 作者: R Remy Rakic

make const-qualif look at more `const fn`s

the unstables ones in libcore, with the unstable feature disabled, were not checked
上级 d825e35e
......@@ -77,7 +77,11 @@ pub fn for_item(tcx: TyCtxt<'tcx>, def_id: DefId) -> Option<Self> {
let mode = match tcx.hir().body_owner_kind(hir_id) {
HirKind::Closure => return None,
HirKind::Fn if tcx.is_const_fn(def_id) => ConstKind::ConstFn,
// Note: this is deliberately checking for `is_const_fn_raw`, as the `is_const_fn`
// checks take into account the `rustc_const_unstable` attribute combined with enabled
// feature gates. An unstable `const fn` could otherwise be considered "not const"
// by const qualification. See issue #67053 for more details.
HirKind::Fn if tcx.is_const_fn_raw(def_id) => ConstKind::ConstFn,
HirKind::Fn => return None,
HirKind::Const => ConstKind::Const,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册