mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Rollup merge of #38264 - ollie27:rustdoc_src_macro, r=brson
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:
commit
e3363f2772
@ -1468,6 +1468,13 @@ impl<'a> Item<'a> {
|
||||
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))) => {
|
||||
|
Loading…
Reference in New Issue
Block a user