Skip to content

Commit bb9d66d

Browse files
Rollup merge of rust-lang#57954 - euclio:rustdoc-stability, r=QuietMisdreavus
rustdoc: remove blank unstable spans Rustdoc generates blank unstable spans for unstable struct fields: ![screen shot 2019-01-28 at 1 05 04 pm](https://user-images.githubusercontent.com/1372438/51856295-5e8ed500-22fd-11e9-8074-025eddb4ef65.png) This PR removes them: ![screen shot 2019-01-28 at 1 07 22 pm](https://user-images.githubusercontent.com/1372438/51856424-aada1500-22fd-11e9-86f0-34e2aa78b8b1.png) r? @QuietMisdreavus
2 parents 4c62d7e + 30b1c35 commit bb9d66d

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/librustdoc/html/render.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3484,10 +3484,6 @@ fn item_struct(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
34843484
ns_id = ns_id,
34853485
name = field.name.as_ref().unwrap(),
34863486
ty = ty)?;
3487-
if let Some(stability_class) = field.stability_class() {
3488-
write!(w, "<span class='stab {stab}'></span>",
3489-
stab = stability_class)?;
3490-
}
34913487
document(w, cx, field)?;
34923488
}
34933489
}

src/test/rustdoc/stability.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![feature(staged_api)]
2+
3+
#![unstable(feature = "test", issue = "0")]
4+
5+
pub struct Unstable {
6+
// @has stability/struct.Unstable.html \
7+
// '//div[@class="stability"]//div[@class="stab unstable"]' \
8+
// 'This is a nightly-only experimental API'
9+
// @count stability/struct.Unstable.html '//span[@class="stab unstable"]' 0
10+
pub foo: u32,
11+
pub bar: u32,
12+
}

0 commit comments

Comments
 (0)