Skip to content

Commit 757380e

Browse files
committed
Add tracing to (const_)validate_operand
1 parent 625f8ee commit 757380e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

compiler/rustc_const_eval/src/interpret/validity.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ use super::{
3535
Machine, MemPlaceMeta, PlaceTy, Pointer, Projectable, Scalar, ValueVisitor, err_ub,
3636
format_interp_error,
3737
};
38+
use crate::enter_trace_span;
3839

3940
// for the validation errors
4041
#[rustfmt::skip]
@@ -1382,6 +1383,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
13821383
ref_tracking: &mut RefTracking<MPlaceTy<'tcx, M::Provenance>, Vec<PathElem>>,
13831384
ctfe_mode: CtfeValidationMode,
13841385
) -> InterpResult<'tcx> {
1386+
let _span = enter_trace_span!(M, "const_validate_operand", "path={path:?}, val={val:?}");
1387+
13851388
self.validate_operand_internal(
13861389
val,
13871390
path,
@@ -1401,6 +1404,12 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
14011404
recursive: bool,
14021405
reset_provenance_and_padding: bool,
14031406
) -> InterpResult<'tcx> {
1407+
let _span = enter_trace_span!(
1408+
M,
1409+
"validate_operand",
1410+
"recursive={recursive}, reset_provenance_and_padding={reset_provenance_and_padding}, val={val:?}"
1411+
);
1412+
14041413
// Note that we *could* actually be in CTFE here with `-Zextra-const-ub-checks`, but it's
14051414
// still correct to not use `ctfe_mode`: that mode is for validation of the final constant
14061415
// value, it rules out things like `UnsafeCell` in awkward places.

0 commit comments

Comments
 (0)