Skip to content

Commit

Permalink
Rollup merge of rust-lang#37144 - eulerdisk:fix_37126, r=nrc
Browse files Browse the repository at this point in the history
save_analysis: Dump data only if get_path_data doesn't fail to resolve a path.

Solves rust-lang#37126

Dump data only if `get_path_data` doesn't fail to resolve a path.
`get_path_data` returns `None` when it have to deals with `Def::Err`, which is used as placeholder for a failed resolution.

Tell me if this is good enough, maybe I have to add some tests ?

r? @nrc
  • Loading branch information
Manishearth authored Oct 26, 2016
2 parents 586a988 + 88b031e commit 1802610
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/librustc_save_analysis/dump_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
let path_data = match path_data {
Some(pd) => pd,
None => {
span_bug!(path.span,
"Unexpected def kind while looking up path in `{}`",
self.span.snippet(path.span))
return;
}
};

Expand Down

0 comments on commit 1802610

Please sign in to comment.