about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2017-03-08 15:06:53 +1300
committerAlex Crichton <alex@alexcrichton.com>2017-03-10 08:20:00 -0800
commite5d1b9ca3927ea5cdfadd43c86a9f5d24671fb93 (patch)
treec0e1ba44e8adbd81327a2e4b629eab4ebaa059be
parentf573db4f80c75f156df8a743f456bf087ec81dc2 (diff)
downloadrust-e5d1b9ca3927ea5cdfadd43c86a9f5d24671fb93.tar.gz
rust-e5d1b9ca3927ea5cdfadd43c86a9f5d24671fb93.zip
save-analysis: cope with lack of method data after a type error
Fixes #39957
-rw-r--r--src/librustc_save_analysis/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs
index b1e435dcc75..4298024e12d 100644
--- a/src/librustc_save_analysis/lib.rs
+++ b/src/librustc_save_analysis/lib.rs
@@ -387,7 +387,10 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
                     }
                 }
                 None => {
-                    span_bug!(span, "Could not find container for method {}", id);
+                    debug!("Could not find container for method {} at {:?}", id, span);
+                    // This is not necessarily a bug, if there was a compilation error, the tables
+                    // we need might not exist.
+                    return None;
                 }
             },
         };