File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -1501,11 +1501,17 @@ impl<'a> Item<'a> {
1501
1501
true , |component| {
1502
1502
path. push ( component. to_string ( ) ) ;
1503
1503
} ) ;
1504
- Some ( format ! ( "{root}src/{krate}/{path}.html#{href}" ,
1505
- root = self . cx. root_path,
1506
- krate = self . cx. layout. krate,
1507
- path = path. join( "/" ) ,
1508
- href = href) )
1504
+ // If the span points into an external macro the
1505
+ // source-file will be bogus, i.e `<foo macros>`
1506
+ if Path :: new ( & self . item . source . filename ) . is_file ( ) {
1507
+ Some ( format ! ( "{root}src/{krate}/{path}.html#{href}" ,
1508
+ root = self . cx. root_path,
1509
+ krate = self . cx. layout. krate,
1510
+ path = path. join( "/" ) ,
1511
+ href = href) )
1512
+ } else {
1513
+ None
1514
+ }
1509
1515
1510
1516
// If this item is not part of the local crate, then things get a little
1511
1517
// trickier. We don't actually know the span of the external item, but
You can’t perform that action at this time.
0 commit comments