Skip to content

Commit

Permalink
rustdoc: get back missing crate-name when --playground-url is used
Browse files Browse the repository at this point in the history
follow up PR #37763
  • Loading branch information
liigo committed Nov 30, 2016
1 parent b30022a commit c1a6f17
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/librustdoc/html/render.rs
Expand Up @@ -451,6 +451,14 @@ pub fn run(mut krate: clean::Crate,
css_file_extension: css_file_extension.clone(),
};

// If user passed in `--playground-url` arg, we fill in crate name here
markdown::PLAYGROUND.with(|slot| {
if slot.borrow().is_some() {
let url = slot.borrow().as_ref().unwrap().1.clone();
*slot.borrow_mut() = Some((Some(krate.name.clone()), url));
}
});

// Crawl the crate attributes looking for attributes which control how we're
// going to emit HTML
if let Some(attrs) = krate.module.as_ref().map(|m| &m.attrs) {
Expand Down

0 comments on commit c1a6f17

Please sign in to comment.