]> git.lizzy.rs Git - rust.git/commitdiff
save-analysis: fix ICE on partially resolved path
authorNick Cameron <ncameron@mozilla.com>
Mon, 21 Nov 2016 05:11:36 +0000 (18:11 +1300)
committerNick Cameron <ncameron@mozilla.com>
Thu, 22 Dec 2016 02:17:04 +0000 (15:17 +1300)
Occurs when we produce save-analysis before type checking is complete (due to errors).

src/librustc_save_analysis/lib.rs

index 862345fd46eb6ce743ab50bfa07f398b993adaeb..68836d8823ed521f2a7eb60ba1d5ce405a861159 100644 (file)
@@ -545,7 +545,11 @@ pub fn get_path_def(&self, id: NodeId) -> Def {
     }
 
     pub fn get_path_data(&self, id: NodeId, path: &ast::Path) -> Option<Data> {
+<<<<<<< HEAD
         let def = self.get_path_def(id);
+=======
+        let def = option_try!(self.tcx.expect_resolution(id).maybe_full_def());
+>>>>>>> save-analysis: fix ICE on partially resolved path
         let sub_span = self.span_utils.span_for_last_ident(path.span);
         filter!(self.span_utils, sub_span, path.span, None);
         match def {