Comment for_diagnostics
flag.
This commit is contained in:
parent
224e29030a
commit
f512f91258
1 changed files with 5 additions and 0 deletions
|
@ -106,6 +106,11 @@ pub(crate) fn mk_eval_cx<'mir, 'tcx>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This function converts an interpreter value into a MIR constant.
|
/// 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")]
|
#[instrument(skip(ecx), level = "debug")]
|
||||||
pub(super) fn op_to_const<'tcx>(
|
pub(super) fn op_to_const<'tcx>(
|
||||||
ecx: &CompileTimeEvalContext<'_, 'tcx>,
|
ecx: &CompileTimeEvalContext<'_, 'tcx>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue