rust/tests/rustdoc/titles.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
2.3 KiB
Rust
Raw Normal View History

#![crate_name = "foo"]
2023-03-21 10:44:06 -05:00
#![feature(rustc_attrs)]
//@ matches 'foo/index.html' '//h1' 'Crate foo'
//@ matches 'foo/index.html' '//div[@class="sidebar-crate"]/h2/a' 'foo'
//@ count 'foo/index.html' '//h2[@class="location"]' 0
//@ matches 'foo/foo_mod/index.html' '//h1' 'Module foo_mod'
2024-09-11 00:03:54 -05:00
//@ matches - '//*[@class="rustdoc-breadcrumbs"]' 'foo'
//@ matches - '//h2[@class="location"]' 'Module foo_mod'
pub mod foo_mod {
pub struct __Thing {}
}
2020-09-01 16:12:52 -05:00
extern "C" {
//@ matches 'foo/fn.foo_ffn.html' '//h1' 'Function foo_ffn'
2024-09-11 00:03:54 -05:00
//@ matches - '//*[@class="rustdoc-breadcrumbs"]' 'foo'
pub fn foo_ffn();
}
//@ matches 'foo/fn.foo_fn.html' '//h1' 'Function foo_fn'
2024-09-11 00:03:54 -05:00
//@ matches - '//*[@class="rustdoc-breadcrumbs"]' 'foo'
pub fn foo_fn() {}
//@ matches 'foo/trait.FooTrait.html' '//h1' 'Trait FooTrait'
2024-09-11 00:03:54 -05:00
//@ matches - '//*[@class="rustdoc-breadcrumbs"]' 'foo'
//@ matches - '//h2[@class="location"]' 'FooTrait'
pub trait FooTrait {}
//@ matches 'foo/struct.FooStruct.html' '//h1' 'Struct FooStruct'
2024-09-11 00:03:54 -05:00
//@ matches - '//*[@class="rustdoc-breadcrumbs"]' 'foo'
//@ matches - '//h2[@class="location"]' 'FooStruct'
pub struct FooStruct;
//@ matches 'foo/enum.FooEnum.html' '//h1' 'Enum FooEnum'
2024-09-11 00:03:54 -05:00
//@ matches - '//*[@class="rustdoc-breadcrumbs"]' 'foo'
//@ matches - '//h2[@class="location"]' 'FooEnum'
pub enum FooEnum {}
//@ matches 'foo/type.FooType.html' '//h1' 'Type Alias FooType'
2024-09-11 00:03:54 -05:00
//@ matches - '//*[@class="rustdoc-breadcrumbs"]' 'foo'
//@ matches - '//h2[@class="location"]' 'FooType'
pub type FooType = FooStruct;
//@ matches 'foo/macro.foo_macro.html' '//h1' 'Macro foo_macro'
2024-09-11 00:03:54 -05:00
//@ matches - '//*[@class="rustdoc-breadcrumbs"]' 'foo'
#[macro_export]
macro_rules! foo_macro {
2020-09-01 16:12:52 -05:00
() => {};
}
//@ matches 'foo/primitive.bool.html' '//h1' 'Primitive Type bool'
//@ count - '//*[@class="rustdoc-breadcrumbs"]' 0
2023-03-21 10:44:06 -05:00
#[rustc_doc_primitive = "bool"]
mod bool {}
//@ matches 'foo/static.FOO_STATIC.html' '//h1' 'Static FOO_STATIC'
2024-09-11 00:03:54 -05:00
//@ matches - '//*[@class="rustdoc-breadcrumbs"]' 'foo'
pub static FOO_STATIC: FooStruct = FooStruct;
2020-09-01 16:12:52 -05:00
extern "C" {
//@ matches 'foo/static.FOO_FSTATIC.html' '//h1' 'Static FOO_FSTATIC'
2024-09-11 00:03:54 -05:00
//@ matches - '//*[@class="rustdoc-breadcrumbs"]' 'foo'
pub static FOO_FSTATIC: FooStruct;
}
//@ matches 'foo/constant.FOO_CONSTANT.html' '//h1' 'Constant FOO_CONSTANT'
2024-09-11 00:03:54 -05:00
//@ matches - '//*[@class="rustdoc-breadcrumbs"]' 'foo'
pub const FOO_CONSTANT: FooStruct = FooStruct;