From 191e5b0b78eae71ed9d59d03f2292501dd6d488a Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Mon, 1 Jan 2018 14:22:28 +0530 Subject: [PATCH] Exit early for non-linky things --- src/librustdoc/clean/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 7daf8a7ae6d1..dcf12ed8180e 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -854,6 +854,13 @@ impl Clean 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