]> git.lizzy.rs Git - rust.git/commitdiff
Exit early for non-linky things
authorManish Goregaokar <manishsmail@gmail.com>
Mon, 1 Jan 2018 08:52:28 +0000 (14:22 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Mon, 22 Jan 2018 09:54:29 +0000 (15:24 +0530)
src/librustdoc/clean/mod.rs

index 7daf8a7ae6d13e499a4cdeaee0d0581e050a6ad6..dcf12ed8180e84a0db01554810d97c53e0dbf3ff 100644 (file)
@@ -854,6 +854,13 @@ fn clean(&self, cx: &DocContext) -> Attributes {
                         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