From 27ca2507defe13c5c989a9aa64d138645a7db65e Mon Sep 17 00:00:00 2001 From: mitaa Date: Wed, 24 Feb 2016 19:40:16 +0100 Subject: [PATCH] Allow creation of src-links for device files --- src/librustdoc/html/render.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 692d230446cd..267220891b98 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1489,9 +1489,11 @@ impl<'a> Item<'a> { true, |component| { path.push(component.to_string()); }); + // If the span points into an external macro the // source-file will be bogus, i.e `` - if Path::new(&self.item.source.filename).is_file() { + let filename = &self.item.source.filename; + if !(filename.starts_with("<") && filename.ends_with("macros>")) { Some(format!("{root}src/{krate}/{path}.html#{href}", root = self.cx.root_path, krate = self.cx.layout.krate,