Specify diagnostic path.

This commit is contained in:
Camille GILLOT
2023-11-01 18:36:38 +00:00
parent 0f8f77fcc2
commit 224e29030a
3 changed files with 13 additions and 6 deletions

View File

@@ -99,7 +99,7 @@ pub(crate) fn try_destructure_mir_constant_for_user_output<'tcx>(
let fields_iter = (0..field_count)
.map(|i| {
let field_op = ecx.project_field(&down, i).ok()?;
let val = op_to_const(&ecx, &field_op);
let val = op_to_const(&ecx, &field_op, /* for diagnostics */ true);
Some((val, field_op.layout.ty))
})
.collect::<Option<Vec<_>>>()?;