rust/tests/rustdoc/sidebar/sidebar-all-page.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

35 lines
900 B
Rust

#![crate_name = "foo"]
#![feature(rustc_attrs)]
//@ has 'foo/all.html'
//@ has - '//*[@class="sidebar-elems"]//li' 'Structs'
//@ has - '//*[@class="sidebar-elems"]//li' 'Enums'
//@ has - '//*[@class="sidebar-elems"]//li' 'Unions'
//@ has - '//*[@class="sidebar-elems"]//li' 'Functions'
//@ has - '//*[@class="sidebar-elems"]//li' 'Traits'
//@ has - '//*[@class="sidebar-elems"]//li' 'Macros'
//@ has - '//*[@class="sidebar-elems"]//li' 'Type Aliases'
//@ has - '//*[@class="sidebar-elems"]//li' 'Constants'
//@ has - '//*[@class="sidebar-elems"]//li' 'Statics'
//@ has - '//*[@class="sidebar-elems"]//li' 'Primitive Types'
pub struct Foo;
pub enum Enum {
A,
}
pub union Bar {
a: u8,
b: u16,
}
pub fn foo() {}
pub trait Trait {}
#[macro_export]
macro_rules! foo {
() => {};
}
pub type Type = u8;
pub const FOO: u8 = 0;
pub static BAR: u8 = 0;
#[rustc_doc_primitive = "u8"]
mod u8 {}