about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2018-01-01 14:22:28 +0530
committerManish Goregaokar <manishsmail@gmail.com>2018-01-22 15:24:29 +0530
commit191e5b0b78eae71ed9d59d03f2292501dd6d488a (patch)
treef8a563a4dccdb2c1a09320c70063cec285f700ff
parent4f10f676d9e39940bf54ebfc7017f1505837532f (diff)
Exit early for non-linky things
-rw-r--r--src/librustdoc/clean/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index 7daf8a7ae6d..dcf12ed8180 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -854,6 +854,13 @@ impl Clean<Attributes> for [ast::Attribute] {
                         link.trim()
                     };
 
+                    // avoid resolving things (i.e. regular links) which aren't like paths
+                    // FIXME(Manishearth) given that most links have slashes in them might be worth
+                    // doing a check for slashes first
+                    if path_str.contains(|ch: char| !(ch.is_alphanumeric() || ch == ':' || ch == '_')) {
+                        continue;
+                    }
+
                     let resolve = |is_val| {
                         // In case we're in a module, try to resolve the relative
                         // path