Skip to content

Commit

Permalink
Use opt_def_id when pretty-printing types
Browse files Browse the repository at this point in the history
This fixes an ICE for items without a `DefId`
  • Loading branch information
Aaron1011 committed Mar 12, 2020
1 parent d5a367d commit 894499b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ pub trait PrettyPrinter<'tcx>:
.tcx()
.item_children(visible_parent)
.iter()
.find(|child| child.res.def_id() == def_id)
.find(|child| child.res.opt_def_id() == Some(def_id))
.map(|child| child.ident.name);
if let Some(reexport) = reexport {
*name = reexport;
Expand Down

0 comments on commit 894499b

Please sign in to comment.