File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,8 @@ pub(crate) enum HrefError {
368368 Private ,
369369 // Not in external cache, href link should be in same page
370370 NotInExternalCache ,
371+ /// Refers to an unnamable item, such as one defined within a function or const block.
372+ UnnamableItem ,
371373}
372374
373375/// This function is to get the external macro path because they are not in the cache used in
@@ -498,7 +500,13 @@ fn url_parts(
498500 builder. extend ( module_fqp. iter ( ) . copied ( ) ) ;
499501 Ok ( builder)
500502 }
501- ExternalLocation :: Local => Ok ( href_relative_parts ( module_fqp, relative_to) ) ,
503+ ExternalLocation :: Local => {
504+ if module_fqp. iter ( ) . any ( |sym| sym. as_str ( ) == "_" ) {
505+ Err ( HrefError :: UnnamableItem )
506+ } else {
507+ Ok ( href_relative_parts ( module_fqp, relative_to) )
508+ }
509+ }
502510 ExternalLocation :: Unknown => Err ( HrefError :: DocumentationNotBuilt ) ,
503511 }
504512}
You can’t perform that action at this time.
0 commit comments