We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
for_diagnostics
1 parent 224e290 commit f512f91Copy full SHA for f512f91
compiler/rustc_const_eval/src/const_eval/eval_queries.rs
@@ -106,6 +106,11 @@ pub(crate) fn mk_eval_cx<'mir, 'tcx>(
106
}
107
108
/// This function converts an interpreter value into a MIR constant.
109
+///
110
+/// The `for_diagnostics` flag turns the usual rules for returning `ConstValue::Scalar` into a
111
+/// best-effort attempt. This is not okay for use in const-eval sine it breaks invariants rustc
112
+/// relies on, but it is okay for diagnostics which will just give up gracefully when they
113
+/// encounter an `Indirect` they cannot handle.
114
#[instrument(skip(ecx), level = "debug")]
115
pub(super) fn op_to_const<'tcx>(
116
ecx: &CompileTimeEvalContext<'_, 'tcx>,
0 commit comments