File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11use rustc_middle:: ty:: TyCtxt ;
2- use rustc_span:: Symbol ;
32
43use crate :: clean;
54use crate :: config:: RenderOptions ;
@@ -68,7 +67,6 @@ pub(crate) fn run_format<'tcx, T: FormatRenderer<'tcx>>(
6867 // Render the crate documentation
6968 let mut work = vec ! [ ( format_renderer. make_child_renderer( ) , krate. module) ] ;
7069
71- let unknown = Symbol :: intern ( "<unknown item>" ) ;
7270 while let Some ( ( mut cx, item) ) = work. pop ( ) {
7371 if item. is_mod ( ) && T :: RUN_ON_MODULE {
7472 // 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>>(
9088 cx. mod_item_out ( ) ?;
9189 // FIXME: checking `item.name.is_some()` is very implicit and leads to lots of special
9290 // 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 ( ) )
9595 . run ( || cx. item ( item) ) ?;
9696 }
9797 }
You can’t perform that action at this time.
0 commit comments