Skip to content

Commit

Permalink
update comment to explain the importance of this check more clearly
Browse files Browse the repository at this point in the history
  • Loading branch information
lqd committed Dec 5, 2019
1 parent 4a760c6 commit 2d83b76
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc_mir/transform/check_consts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ impl ConstKind {

// 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,

Expand Down

0 comments on commit 2d83b76

Please sign in to comment.