Skip to content

Commit 12457f8

Browse files
committed
Some tracing helpers
1 parent 0c6918f commit 12457f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_mir_build/src/build/expr/as_place.rs

+3
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ fn find_capture_matching_projections<'a, 'tcx>(
202202
/// `PlaceBuilder` now starts from `PlaceBase::Local`.
203203
///
204204
/// Returns a Result with the error being the PlaceBuilder (`from_builder`) that was not found.
205+
#[instrument(level = "trace", skip(cx))]
205206
fn to_upvars_resolved_place_builder<'tcx>(
206207
from_builder: PlaceBuilder<'tcx>,
207208
cx: &Builder<'_, 'tcx>,
@@ -270,12 +271,14 @@ fn to_upvars_resolved_place_builder<'tcx>(
270271

271272
// We used some of the projections to build the capture itself,
272273
// now we apply the remaining to the upvar resolved place.
274+
trace!(?capture.place, ?from_builder.projection);
273275
let remaining_projections = strip_prefix(
274276
capture.place.base_ty,
275277
from_builder.projection,
276278
&capture.place.projections,
277279
);
278280
upvar_resolved_place_builder.projection.extend(remaining_projections);
281+
trace!(?upvar_resolved_place_builder);
279282

280283
Ok(upvar_resolved_place_builder)
281284
}

0 commit comments

Comments
 (0)