Skip to content

Commit 27ca250

Browse files
committed
Allow creation of src-links for device files
1 parent 37c6f28 commit 27ca250

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustdoc/html/render.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,9 +1489,11 @@ impl<'a> Item<'a> {
14891489
true, |component| {
14901490
path.push(component.to_string());
14911491
});
1492+
14921493
// If the span points into an external macro the
14931494
// source-file will be bogus, i.e `<foo macros>`
1494-
if Path::new(&self.item.source.filename).is_file() {
1495+
let filename = &self.item.source.filename;
1496+
if !(filename.starts_with("<") && filename.ends_with("macros>")) {
14951497
Some(format!("{root}src/{krate}/{path}.html#{href}",
14961498
root = self.cx.root_path,
14971499
krate = self.cx.layout.krate,

0 commit comments

Comments
 (0)