Skip to content

Commit

Permalink
auto merge of #12277 : alexcrichton/rust/fix-rustdoc-render, r=huonw
Browse files Browse the repository at this point in the history
The std macros used to be injected with a filename of "<std-macros>", but macros
are now injected with a filename of "<{} macros>" where `{}` is filled in with
the crate name. This updates rustdoc to understand this new system so it'll
render source more frequently.
  • Loading branch information
bors committed Feb 15, 2014
2 parents d365c3a + 1bf1eea commit 9b173ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,10 @@ impl<'a> SourceCollector<'a> {
// can't have the source to it anyway.
let contents = match File::open(&p).read_to_end() {
Ok(r) => r,
// eew macro hacks
Err(..) if filename == "<std-macros>" => return Ok(()),
// macros from other libraries get special filenames which we can
// safely ignore
Err(..) if filename.starts_with("<") &&
filename.ends_with("macros>") => return Ok(()),
Err(e) => return Err(e)
};
let contents = str::from_utf8_owned(contents).unwrap();
Expand Down

0 comments on commit 9b173ed

Please sign in to comment.