summary refs log tree commit diff
path: root/src/librustc/traits/select.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-11-07 03:21:02 +0000
committerbors <bors@rust-lang.org>2018-11-07 03:21:02 +0000
commit1433507eba7d1a114e4c6f27ae0e1a74f60f20de (patch)
treebdefceb804ebe06423a47711fd1132f3b2219818 /src/librustc/traits/select.rs
parentda5f414c2c0bfe5198934493f04c676e2b23ff2e (diff)
parent59e6ce4b19a8c2b9ec9a1fbf51ed232b040b177b (diff)
downloadrust-1.30.1.tar.gz
rust-1.30.1.zip
Auto merge of #55738 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum 1.30.1
1.30.1 stable release

I believe this includes all of the relevant pieces from https://github.com/rust-lang/rust/issues/55594. Backports all proceeded smoothly.

cc @rust-lang/release
Diffstat (limited to 'src/librustc/traits/select.rs')
-rw-r--r--src/librustc/traits/select.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs
index 232ef108537..706d038812e 100644
--- a/src/librustc/traits/select.rs
+++ b/src/librustc/traits/select.rs
@@ -1376,7 +1376,10 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
         let tcx = self.tcx();
         let trait_ref = cache_fresh_trait_pred.skip_binder().trait_ref;
         if self.can_use_global_caches(param_env) {
-            if let Some(trait_ref) = tcx.lift_to_global(&trait_ref) {
+            if let Err(Overflow) = candidate {
+                // Don't cache overflow globally; we only produce this
+                // in certain modes.
+            } else if let Some(trait_ref) = tcx.lift_to_global(&trait_ref) {
                 if let Some(candidate) = tcx.lift_to_global(&candidate) {
                     debug!(
                         "insert_candidate_cache(trait_ref={:?}, candidate={:?}) global",