File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
use rustc_middle:: ty:: TyCtxt ;
2
- use rustc_span:: Symbol ;
3
2
4
3
use crate :: clean;
5
4
use crate :: config:: RenderOptions ;
@@ -68,7 +67,6 @@ pub(crate) fn run_format<'tcx, T: FormatRenderer<'tcx>>(
68
67
// Render the crate documentation
69
68
let mut work = vec ! [ ( format_renderer. make_child_renderer( ) , krate. module) ] ;
70
69
71
- let unknown = Symbol :: intern ( "<unknown item>" ) ;
72
70
while let Some ( ( mut cx, item) ) = work. pop ( ) {
73
71
if item. is_mod ( ) && T :: RUN_ON_MODULE {
74
72
// modules are special because they add a namespace. We also need to
@@ -90,8 +88,10 @@ pub(crate) fn run_format<'tcx, T: FormatRenderer<'tcx>>(
90
88
cx. mod_item_out ( ) ?;
91
89
// FIXME: checking `item.name.is_some()` is very implicit and leads to lots of special
92
90
// cases. Use an explicit match instead.
93
- } else if item. name . is_some ( ) && !item. is_extern_crate ( ) {
94
- prof. generic_activity_with_arg ( "render_item" , item. name . unwrap_or ( unknown) . as_str ( ) )
91
+ } else if let Some ( item_name) = item. name
92
+ && !item. is_extern_crate ( )
93
+ {
94
+ prof. generic_activity_with_arg ( "render_item" , item_name. as_str ( ) )
95
95
. run ( || cx. item ( item) ) ?;
96
96
}
97
97
}
You can’t perform that action at this time.
0 commit comments