Rollup merge of #57954 - euclio:rustdoc-stability, r=QuietMisdreavus
rustdoc: remove blank unstable spans Rustdoc generates blank unstable spans for unstable struct fields:  This PR removes them:  r? @QuietMisdreavus
This commit is contained in:
commit
bb9d66d3ba
2 changed files with 12 additions and 4 deletions
|
@ -3484,10 +3484,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)?;
|
||||
}
|
||||
}
|
||||
|
|
12
src/test/rustdoc/stability.rs
Normal file
12
src/test/rustdoc/stability.rs
Normal file
|
@ -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,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue