Skip to content

Commit 1ebd9ad

Browse files
authored
Rollup merge of rust-lang#51658 - oli-obk:unregress_perf, r=nikomatsakis
Only do sanity check with debug assertions on r? @nnethercote I'm slighty confused. These changes address code that the `unused-warnings` benchmark doesn't go through, yet I see a 5% improvement to nightly on the `check` run, and no improvement on the other runs. Maybe this change allows unrelated code in the same function to be better optimized?
2 parents 63531f5 + a693c92 commit 1ebd9ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc/traits/query/normalize.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for QueryNormalizer<'cx, 'gcx, 'tcx
124124
let concrete_ty = generic_ty.subst(self.tcx(), substs);
125125
self.anon_depth += 1;
126126
if concrete_ty == ty {
127-
println!("generic_ty: {:#?}", generic_ty);
128-
println!("substs {:#?}", substs);
127+
bug!("infinite recursion generic_ty: {:#?}, substs: {:#?}, \
128+
concrete_ty: {:#?}, ty: {:#?}", generic_ty, substs, concrete_ty,
129+
ty);
129130
}
130-
assert_ne!(concrete_ty, ty, "infinite recursion");
131131
let folded_ty = self.fold_ty(concrete_ty);
132132
self.anon_depth -= 1;
133133
folded_ty

0 commit comments

Comments
 (0)