diff options
| author | kennytm <kennytm@gmail.com> | 2018-06-28 06:15:39 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-28 06:15:39 +0800 |
| commit | 1ebd9adef4e65deb6f34d99b516c592cb9a06b38 (patch) | |
| tree | ef2eeb1da4c7b91ea8093ecbb8fa46d12a45e22f | |
| parent | 63531f515d74e20806454961fd5d05a7f1cce354 (diff) | |
| parent | a693c9206bd8c6bb69979de7082977444b9309d0 (diff) | |
| download | rust-1ebd9adef4e65deb6f34d99b516c592cb9a06b38.tar.gz rust-1ebd9adef4e65deb6f34d99b516c592cb9a06b38.zip | |
Rollup merge of #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?
| -rw-r--r-- | src/librustc/traits/query/normalize.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/traits/query/normalize.rs b/src/librustc/traits/query/normalize.rs index d0ae0bdac8c..6d2df4c2018 100644 --- a/src/librustc/traits/query/normalize.rs +++ b/src/librustc/traits/query/normalize.rs @@ -124,10 +124,10 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for QueryNormalizer<'cx, 'gcx, 'tcx let concrete_ty = generic_ty.subst(self.tcx(), substs); self.anon_depth += 1; if concrete_ty == ty { - println!("generic_ty: {:#?}", generic_ty); - println!("substs {:#?}", substs); + bug!("infinite recursion generic_ty: {:#?}, substs: {:#?}, \ + concrete_ty: {:#?}, ty: {:#?}", generic_ty, substs, concrete_ty, + ty); } - assert_ne!(concrete_ty, ty, "infinite recursion"); let folded_ty = self.fold_ty(concrete_ty); self.anon_depth -= 1; folded_ty |
