rust/tests/rustdoc/sidebar/sidebar-link-generation.rs
Michael Howell 1aebff96ad Add Top TOC support to rustdoc
This commit adds the headers for the top level documentation to
rustdoc's existing table of contents, along with associated items.

It only show two levels of headers. Going further would require the
sidebar to be wider, and that seems unnecessary (the crates that
have manually-built TOCs usually don't need deeply nested headers).
2024-08-20 16:27:42 -07:00

14 lines
305 B
Rust

#![crate_name = "foo"]
//@ has foo/struct.SomeStruct.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.some_fn-1"]' \
// "some_fn"
pub struct SomeStruct<T> { _inner: T }
impl SomeStruct<()> {
pub fn some_fn(&self) {}
}
impl SomeStruct<usize> {
pub fn some_fn(&self) {}
}