Skip to content

Commit e58eeb8

Browse files
committed
useful debugging
1 parent c654671 commit e58eeb8

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

compiler/rustc_mir_build/src/builder/matches/match_pair.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,18 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
6060
let elem_ty = prefix[0].ty;
6161
let prefix_valtree = self.simplify_const_pattern_slice_into_valtree(prefix);
6262

63+
let project = PlaceElem::Subslice {
64+
from: 0 as u64,
65+
to: prefix.len() as u64,
66+
from_end: false,
67+
}; // or use a projection??
68+
6369
let match_pair = self.valtree_to_match_pair(
6470
src_path.ty,
6571
src_path.span,
6672
prefix.len() as u64,
6773
prefix_valtree,
68-
place.clone(),
74+
place.clone_project(project),
6975
elem_ty,
7076
);
7177

compiler/rustc_mir_build/src/builder/matches/test.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
468468
_ => span_bug!(source_info.span, "invalid type for non-scalar compare: {}", ty),
469469
};
470470

471+
tracing::warn!("compare_ty: {:?}", compare_ty);
472+
471473
let eq_def_id =
472474
self.tcx.require_lang_item(LangItem::MatchLoweredCmp, Some(source_info.span));
473475
let method = trait_method(self.tcx, eq_def_id, sym::do_match, [compare_ty, compare_ty]);

0 commit comments

Comments
 (0)