Skip to content

Commit

Permalink
Allow creation of src-links for device files
Browse files Browse the repository at this point in the history
  • Loading branch information
mitaa committed Feb 24, 2016
1 parent 37c6f28 commit 27ca250
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<foo macros>`
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,
Expand Down

0 comments on commit 27ca250

Please sign in to comment.