Don't render [src] link on dummy spans
This commit is contained in:
parent
e7c23ab933
commit
3071685505
@ -1852,6 +1852,10 @@ impl Span {
|
||||
self.0
|
||||
}
|
||||
|
||||
crate fn is_dummy(&self) -> bool {
|
||||
self.0.is_dummy()
|
||||
}
|
||||
|
||||
crate fn filename(&self, sess: &Session) -> FileName {
|
||||
sess.source_map().span_to_filename(self.0)
|
||||
}
|
||||
|
@ -1638,6 +1638,9 @@ impl Context<'_> {
|
||||
/// may happen, for example, with externally inlined items where the source
|
||||
/// of their crate documentation isn't known.
|
||||
fn src_href(&self, item: &clean::Item) -> Option<String> {
|
||||
if item.source.is_dummy() {
|
||||
return None;
|
||||
}
|
||||
let mut root = self.root_path();
|
||||
let mut path = String::new();
|
||||
let cnum = item.source.cnum(self.sess());
|
||||
|
Loading…
Reference in New Issue
Block a user