summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemy Rakic <remy.rakic@gmail.com>2019-12-05 17:41:25 +0100
committerRemy Rakic <remy.rakic@gmail.com>2019-12-05 17:41:25 +0100
commit2d83b7608070d6ad250e8cd6d9d5a7d4be628dc4 (patch)
treeb673bd31a20af2b2aef0a3fab16da616900d6fe7
parentadd regression test for issue 67053 (diff)
downloadrust-2d83b7608070d6ad250e8cd6d9d5a7d4be628dc4.tar.gz
rust-2d83b7608070d6ad250e8cd6d9d5a7d4be628dc4.tar.bz2
rust-2d83b7608070d6ad250e8cd6d9d5a7d4be628dc4.tar.xz
update comment to explain the importance of this check more clearly
-rw-r--r--src/librustc_mir/transform/check_consts/mod.rs5
1 files 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 abad622..82ffafb 100644
--- a/src/librustc_mir/transform/check_consts/mod.rs
+++ b/src/librustc_mir/transform/check_consts/mod.rs
@@ -79,8 +79,9 @@ impl ConstKind {
79 79
80 // Note: this is deliberately checking for `is_const_fn_raw`, as the `is_const_fn` 80 // Note: this is deliberately checking for `is_const_fn_raw`, as the `is_const_fn`
81 // checks take into account the `rustc_const_unstable` attribute combined with enabled 81 // checks take into account the `rustc_const_unstable` attribute combined with enabled
82 // feature gates. An unstable `const fn` could otherwise be considered "not const" 82 // feature gates. Otherwise, const qualification would _not check_ whether this
83 // by const qualification. See issue #67053 for more details. 83 // function body follows the `const fn` rules, as an unstable `const fn` would
84 // be considered "not const". More details are available in issue #67053.
84 HirKind::Fn if tcx.is_const_fn_raw(def_id) => ConstKind::ConstFn, 85 HirKind::Fn if tcx.is_const_fn_raw(def_id) => ConstKind::ConstFn,
85 HirKind::Fn => return None, 86 HirKind::Fn => return None,
86 87