Skip to content

Commit

Permalink
Rollup merge of rust-lang#40057 - GuillaumeGomez:html-issue, r=frewsxcv
Browse files Browse the repository at this point in the history
Fix nightly-only experimental API display

Before:

<img width="1440" alt="screen shot 2017-02-23 at 12 53 09" src="https://cloud.githubusercontent.com/assets/3050060/23258119/0c9cf6f2-f9c7-11e6-9989-15b4346dade0.png">

After:

<img width="1440" alt="screen shot 2017-02-23 at 12 51 40" src="https://cloud.githubusercontent.com/assets/3050060/23258076/e6881118-f9c6-11e6-826c-442a73502b59.png">

r? @frewsxcv
  • Loading branch information
frewsxcv authored Feb 28, 2017
2 parents 2623d35 + 8c8eda8 commit 15cd43b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1878,7 +1878,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
&cx.shared.issue_tracker_base_url,
stab.issue) {
(true, &Some(ref tracker_url), Some(issue_no)) if issue_no > 0 =>
format!(" (<code>{}</code> <a href=\"{}{}\">#{}</a>)",
format!(" (<code>{} </code><a href=\"{}{}\">#{}</a>)",
Escape(&stab.feature), tracker_url, issue_no, issue_no),
(false, &Some(ref tracker_url), Some(issue_no)) if issue_no > 0 =>
format!(" (<a href=\"{}{}\">#{}</a>)", Escape(&tracker_url), issue_no,
Expand All @@ -1890,12 +1890,12 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
if stab.unstable_reason.is_empty() {
stability.push(format!("<div class='stab unstable'>\
<span class=microscope>πŸ”¬</span> \
This is a nightly-only experimental API. &nbsp;{}\
This is a nightly-only experimental API. {}\
</div>",
unstable_extra));
unstable_extra));
} else {
let text = format!("<summary><span class=microscope>πŸ”¬</span> \
This is a nightly-only experimental API. &nbsp;{}\
This is a nightly-only experimental API. {}\
</summary>{}",
unstable_extra, MarkdownHtml(&stab.unstable_reason));
stability.push(format!("<div class='stab unstable'><details>{}</details></div>",
Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc/issue-27759.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
#![unstable(feature="test", issue="27759")]

// @has issue_27759/unstable/index.html
// @has - '<code>test</code>'
// @has - '<code>test </code>'
// @has - '<a href="http://issue_url/27759">#27759</a>'
#[unstable(feature="test", issue="27759")]
pub mod unstable {
// @has issue_27759/unstable/fn.issue.html
// @has - '<code>test_function</code>'
// @has - '<code>test_function </code>'
// @has - '<a href="http://issue_url/1234567890">#1234567890</a>'
#[unstable(feature="test_function", issue="1234567890")]
pub fn issue() {}
Expand Down
10 changes: 5 additions & 5 deletions src/test/rustdoc/issue-32374.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@

// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]' \
// 'Deprecated since 1.0.0: text'
// @has - '<code>test</code>'
// @has - '<code>test </code>'
// @has - '<a href="http://issue_url/32374">#32374</a>'
// @matches issue_32374/struct.T.html '//*[@class="stab unstable"]' \
// 'πŸ”¬ This is a nightly-only experimental API. \(test #32374\)$'
// 'πŸ”¬ This is a nightly-only experimental API. \(test #32374\)$'
#[rustc_deprecated(since = "1.0.0", reason = "text")]
#[unstable(feature = "test", issue = "32374")]
pub struct T;

// @has issue_32374/struct.U.html '//*[@class="stab deprecated"]' \
// 'Deprecated since 1.0.0: deprecated'
// @has issue_32374/struct.U.html '//*[@class="stab unstable"]' \
// 'πŸ”¬ This is a nightly-only experimental API. (test #32374)'
// 'πŸ”¬ This is a nightly-only experimental API. (test #32374)'
// @has issue_32374/struct.U.html '//details' \
// 'πŸ”¬ This is a nightly-only experimental API. (test #32374)'
// 'πŸ”¬ This is a nightly-only experimental API. (test #32374)'
// @has issue_32374/struct.U.html '//summary' \
// 'πŸ”¬ This is a nightly-only experimental API. (test #32374)'
// 'πŸ”¬ This is a nightly-only experimental API. (test #32374)'
// @has issue_32374/struct.U.html '//details/p' \
// 'unstable'
#[rustc_deprecated(since = "1.0.0", reason = "deprecated")]
Expand Down

0 comments on commit 15cd43b

Please sign in to comment.