Skip to content

Commit 894499b

Browse files
committed
Use opt_def_id when pretty-printing types
This fixes an ICE for items without a `DefId`
1 parent d5a367d commit 894499b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc/ty/print/pretty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ pub trait PrettyPrinter<'tcx>:
383383
.tcx()
384384
.item_children(visible_parent)
385385
.iter()
386-
.find(|child| child.res.def_id() == def_id)
386+
.find(|child| child.res.opt_def_id() == Some(def_id))
387387
.map(|child| child.ident.name);
388388
if let Some(reexport) = reexport {
389389
*name = reexport;

0 commit comments

Comments
 (0)