]> git.lizzy.rs Git - rust.git/commitdiff
save-analysis: cope with lack of method data after a type error
authorNick Cameron <ncameron@mozilla.com>
Wed, 8 Mar 2017 02:06:53 +0000 (15:06 +1300)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 10 Mar 2017 16:20:00 +0000 (08:20 -0800)
Fixes #39957

src/librustc_save_analysis/lib.rs

index b1e435dcc751c40b1bdff58ed027eb1f212f1a84..4298024e12d7ee6810f97a911106b83cd0bc5b36 100644 (file)
@@ -387,7 +387,10 @@ pub fn get_method_data(&self, id: ast::NodeId,
                     }
                 }
                 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;
                 }
             },
         };