Skip to content

Commit 012e306

Browse files
committed
Explain why clippy's HIR const eval exists
1 parent 12ca363 commit 012e306

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clippy_utils/src/consts.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
//! A simple const eval API, for use on arbitrary HIR expressions.
2+
//!
3+
//! This cannot use rustc's const eval, aka miri, as arbitrary HIR expressions cannot be lowered to
4+
//! executable MIR bodies, so we have to do this instead.
15
#![allow(clippy::float_cmp)]
26

37
use crate::macros::HirNode;
@@ -379,6 +383,8 @@ impl Ord for FullInt {
379383
/// The context required to evaluate a constant expression.
380384
///
381385
/// This is currently limited to constant folding and reading the value of named constants.
386+
///
387+
/// See the module level documentation for some context.
382388
pub struct ConstEvalCtxt<'tcx> {
383389
tcx: TyCtxt<'tcx>,
384390
param_env: ParamEnv<'tcx>,

0 commit comments

Comments
 (0)