Skip to content

Commit

Permalink
Rollup merge of rust-lang#60982 - estebank:fix-60976, r=petrochenkov
Browse files Browse the repository at this point in the history
Do not fail on child without DefId

Addresses rust-lang#60976, leaving open to come up with a repro case.
  • Loading branch information
Centril authored May 22, 2019
2 parents 3e23201 + d320c7c commit 8041c3c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/librustc_metadata/cstore_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,20 +355,20 @@ pub fn provide<'tcx>(providers: &mut Providers<'tcx>) {
return;
}

let child = child.res.def_id();

match visible_parent_map.entry(child) {
Entry::Occupied(mut entry) => {
// If `child` is defined in crate `cnum`, ensure
// that it is mapped to a parent in `cnum`.
if child.krate == cnum && entry.get().krate != cnum {
if let Some(child) = child.res.opt_def_id() {
match visible_parent_map.entry(child) {
Entry::Occupied(mut entry) => {
// If `child` is defined in crate `cnum`, ensure
// that it is mapped to a parent in `cnum`.
if child.krate == cnum && entry.get().krate != cnum {
entry.insert(parent);
}
}
Entry::Vacant(entry) => {
entry.insert(parent);
bfs_queue.push_back(child);
}
}
Entry::Vacant(entry) => {
entry.insert(parent);
bfs_queue.push_back(child);
}
}
};

Expand Down

0 comments on commit 8041c3c

Please sign in to comment.