diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-02-20 20:37:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-20 20:37:04 +0100 |
| commit | fc0cb5d5eb58135cde86f28895e8c282bb2e77d3 (patch) | |
| tree | d9ffe6f6cc3d3aa18d273ba97df396afe93e98a8 /src/librustdoc/html | |
| parent | 77b6f96054b34ce5b608cf0b4ba479fd3837d5dd (diff) | |
| parent | 0c511c9115cc4f8eff7ad50878af032427076c4c (diff) | |
| download | rust-fc0cb5d5eb58135cde86f28895e8c282bb2e77d3.tar.gz rust-fc0cb5d5eb58135cde86f28895e8c282bb2e77d3.zip | |
Rollup merge of #82332 - GuillaumeGomez:no-src-link-on-dummy-spans, r=jyn514
Don't generate src link on dummy spans Just realized that the "auto trait impls" had `[src]` links were leading to the crate root because they were dummy spans. This PR fixes this issue. cc `@jyn514` r? `@camelid`
Diffstat (limited to 'src/librustdoc/html')
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index f5eb92c1bb5..7ca355ed11c 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -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()); |
