Skip to content

Commit 6c372c1

Browse files
committed
Move validation into eval_body_using_ecx
1 parent 3e1addf commit 6c372c1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

compiler/rustc_const_eval/src/const_eval/eval_queries.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ fn eval_body_using_ecx<'mir, 'tcx>(
8484
// Intern the result
8585
intern_const_alloc_recursive(ecx, intern_kind, &ret)?;
8686

87+
// Since evaluation had no errors, validate the resulting constant.
88+
const_validate_mplace(&ecx, &ret, cid)?;
89+
8790
Ok(ret)
8891
}
8992

@@ -379,12 +382,7 @@ fn eval_in_interpreter<'tcx, R: InterpretationResult<'tcx>>(
379382
},
380383
))
381384
}
382-
Ok(mplace) => {
383-
// Since evaluation had no errors, validate the resulting constant.
384-
const_validate_mplace(&ecx, &mplace, cid)?;
385-
386-
Ok(R::make_result(mplace, ecx))
387-
}
385+
Ok(mplace) => Ok(R::make_result(mplace, ecx)),
388386
}
389387
}
390388

0 commit comments

Comments
 (0)