mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
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.
This commit is contained in:
@@ -1468,6 +1468,13 @@ fn src_href(&self) -> Option<String> {
|
||||
return None;
|
||||
}
|
||||
} else {
|
||||
// Macros from other libraries get special filenames which we can
|
||||
// safely ignore.
|
||||
if self.item.source.filename.starts_with("<") &&
|
||||
self.item.source.filename.ends_with("macros>") {
|
||||
return None;
|
||||
}
|
||||
|
||||
let (krate, src_root) = match cache.extern_locations.get(&self.item.def_id.krate) {
|
||||
Some(&(ref name, ref src, Local)) => (name, src),
|
||||
Some(&(ref name, ref src, Remote(ref s))) => {
|
||||
|
||||
Reference in New Issue
Block a user