Skip to content

Commit c6c3a27

Browse files
committed
rustdoc: Remove broken src links from reexported items from macros
When an item is defined in an external macro it doesn't get a real filename so we need to filter out these when generating src links for reexported items.
1 parent d9aae63 commit c6c3a27

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: src/librustdoc/html/render.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,13 @@ impl<'a> Item<'a> {
14681468
return None;
14691469
}
14701470
} else {
1471+
// Macros from other libraries get special filenames which we can
1472+
// safely ignore.
1473+
if self.item.source.filename.starts_with("<") &&
1474+
self.item.source.filename.ends_with("macros>") {
1475+
return None;
1476+
}
1477+
14711478
let (krate, src_root) = match cache.extern_locations.get(&self.item.def_id.krate) {
14721479
Some(&(ref name, ref src, Local)) => (name, src),
14731480
Some(&(ref name, ref src, Remote(ref s))) => {

0 commit comments

Comments
 (0)