Skip to content

Commit

Permalink
Comment for_diagnostics flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Nov 1, 2023
1 parent 224e290 commit f512f91
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/rustc_const_eval/src/const_eval/eval_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ pub(crate) fn mk_eval_cx<'mir, 'tcx>(
}

/// This function converts an interpreter value into a MIR constant.
///
/// The `for_diagnostics` flag turns the usual rules for returning `ConstValue::Scalar` into a
/// best-effort attempt. This is not okay for use in const-eval sine it breaks invariants rustc
/// relies on, but it is okay for diagnostics which will just give up gracefully when they
/// encounter an `Indirect` they cannot handle.
#[instrument(skip(ecx), level = "debug")]
pub(super) fn op_to_const<'tcx>(
ecx: &CompileTimeEvalContext<'_, 'tcx>,
Expand Down

0 comments on commit f512f91

Please sign in to comment.