From 2d83b7608070d6ad250e8cd6d9d5a7d4be628dc4 Mon Sep 17 00:00:00 2001 From: Remy Rakic Date: Thu, 5 Dec 2019 17:41:25 +0100 Subject: [PATCH] update comment to explain the importance of this check more clearly --- src/librustc_mir/transform/check_consts/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/librustc_mir/transform/check_consts/mod.rs b/src/librustc_mir/transform/check_consts/mod.rs index abad6222890..82ffafbedf8 100644 --- a/src/librustc_mir/transform/check_consts/mod.rs +++ b/src/librustc_mir/transform/check_consts/mod.rs @@ -79,8 +79,9 @@ pub fn for_item(tcx: TyCtxt<'tcx>, def_id: DefId) -> Option { // 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. + // feature gates. Otherwise, const qualification would _not check_ whether this + // function body follows the `const fn` rules, as an unstable `const fn` would + // be considered "not const". More details are available in issue #67053. HirKind::Fn if tcx.is_const_fn_raw(def_id) => ConstKind::ConstFn, HirKind::Fn => return None,