Skip to content

Commit

Permalink
rustdoc: remove blank unstable spans
Browse files Browse the repository at this point in the history
  • Loading branch information
euclio committed Jan 28, 2019
1 parent da6ab95 commit 30b1c35
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/librustdoc/html/render.rs
Expand Up @@ -3483,10 +3483,6 @@ fn item_struct(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
ns_id = ns_id,
name = field.name.as_ref().unwrap(),
ty = ty)?;
if let Some(stability_class) = field.stability_class() {
write!(w, "<span class='stab {stab}'></span>",
stab = stability_class)?;
}
document(w, cx, field)?;
}
}
Expand Down
12 changes: 12 additions & 0 deletions src/test/rustdoc/stability.rs
@@ -0,0 +1,12 @@
#![feature(staged_api)]

#![unstable(feature = "test", issue = "0")]

pub struct Unstable {
// @has stability/struct.Unstable.html \
// '//div[@class="stability"]//div[@class="stab unstable"]' \
// 'This is a nightly-only experimental API'
// @count stability/struct.Unstable.html '//span[@class="stab unstable"]' 0
pub foo: u32,
pub bar: u32,
}

0 comments on commit 30b1c35

Please sign in to comment.