rustdoc: Add Associated Constants section
Section only visible if there are assoc. consts. present.
This commit is contained in:
@@ -1862,6 +1862,17 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
|
|||||||
try!(write!(w, "</div>"));
|
try!(write!(w, "</div>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !consts.is_empty() {
|
||||||
|
try!(write!(w, "
|
||||||
|
<h2 id='associated-const'>Associated Constants</h2>
|
||||||
|
<div class='methods'>
|
||||||
|
"));
|
||||||
|
for t in &consts {
|
||||||
|
try!(trait_item(w, *t));
|
||||||
|
}
|
||||||
|
try!(write!(w, "</div>"));
|
||||||
|
}
|
||||||
|
|
||||||
// Output the documentation for each function individually
|
// Output the documentation for each function individually
|
||||||
if !required.is_empty() {
|
if !required.is_empty() {
|
||||||
try!(write!(w, "
|
try!(write!(w, "
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
pub trait Foo {
|
pub trait Foo {
|
||||||
// @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \
|
// @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \
|
||||||
// 'const FOO: usize;'
|
// 'const FOO: usize;'
|
||||||
|
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO'
|
||||||
const FOO: usize;
|
const FOO: usize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user