about summary refs log tree commit diff
path: root/compiler/rustc_mir_build
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-06-27 16:16:11 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-07-15 15:56:16 +0000
commit12457f814cffc05ece8ad588d83aa87b69d78296 (patch)
tree053755d583ddcc58226de2f273c195fa46adfb32 /compiler/rustc_mir_build
parent0c6918fe210ebed9639c2f1b1fbfac4eb0fef38a (diff)
downloadrust-12457f814cffc05ece8ad588d83aa87b69d78296.tar.gz
rust-12457f814cffc05ece8ad588d83aa87b69d78296.zip
Some tracing helpers
Diffstat (limited to 'compiler/rustc_mir_build')
-rw-r--r--compiler/rustc_mir_build/src/build/expr/as_place.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_mir_build/src/build/expr/as_place.rs b/compiler/rustc_mir_build/src/build/expr/as_place.rs
index 98502737dc5..4bd7ef943b9 100644
--- a/compiler/rustc_mir_build/src/build/expr/as_place.rs
+++ b/compiler/rustc_mir_build/src/build/expr/as_place.rs
@@ -202,6 +202,7 @@ fn find_capture_matching_projections<'a, 'tcx>(
 /// `PlaceBuilder` now starts from `PlaceBase::Local`.
 ///
 /// Returns a Result with the error being the PlaceBuilder (`from_builder`) that was not found.
+#[instrument(level = "trace", skip(cx))]
 fn to_upvars_resolved_place_builder<'tcx>(
     from_builder: PlaceBuilder<'tcx>,
     cx: &Builder<'_, 'tcx>,
@@ -270,12 +271,14 @@ fn to_upvars_resolved_place_builder<'tcx>(
 
             // We used some of the projections to build the capture itself,
             // now we apply the remaining to the upvar resolved place.
+            trace!(?capture.place, ?from_builder.projection);
             let remaining_projections = strip_prefix(
                 capture.place.base_ty,
                 from_builder.projection,
                 &capture.place.projections,
             );
             upvar_resolved_place_builder.projection.extend(remaining_projections);
+            trace!(?upvar_resolved_place_builder);
 
             Ok(upvar_resolved_place_builder)
         }