2024-02-06 11:22:24 -06:00
|
|
|
#![crate_name = "foo"]
|
|
|
|
#![feature(lazy_type_alias)]
|
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
//! # Structs
|
|
|
|
//!
|
|
|
|
//! This header has the same name as a built-in header,
|
|
|
|
//! and we need to make sure they're disambiguated with
|
|
|
|
//! suffixes.
|
|
|
|
//!
|
|
|
|
//! Module-like headers get derived from the internal ID map,
|
|
|
|
//! so the *internal* one gets a suffix here. To make sure it
|
|
|
|
//! works right, the one in the `top-toc` needs to match the one
|
|
|
|
//! in the `top-doc`, and the one that's not in the `top-doc`
|
|
|
|
//! needs to match the one that isn't in the `top-toc`.
|
|
|
|
|
2024-07-22 14:59:34 -05:00
|
|
|
//@ has foo/index.html
|
2024-02-06 11:22:24 -06:00
|
|
|
// User header
|
2024-07-24 15:16:08 -05:00
|
|
|
//@ has - '//section[@id="rustdoc-toc"]/ul[@class="block top-toc"]/li/a[@href="#structs"]' 'Structs'
|
2024-07-22 14:59:34 -05:00
|
|
|
//@ has - '//details[@class="toggle top-doc"]/div[@class="docblock"]/h2[@id="structs"]' 'Structs'
|
2024-02-06 11:22:24 -06:00
|
|
|
// Built-in header
|
2024-07-24 15:16:08 -05:00
|
|
|
//@ has - '//section[@id="rustdoc-toc"]/ul[@class="block"]/li/a[@href="#structs-1"]' 'Structs'
|
2024-07-22 14:59:34 -05:00
|
|
|
//@ has - '//section[@id="main-content"]/h2[@id="structs-1"]' 'Structs'
|
2024-02-06 11:22:24 -06:00
|
|
|
|
|
|
|
/// # Fields
|
|
|
|
/// ## Fields
|
|
|
|
/// ### Fields
|
|
|
|
///
|
|
|
|
/// The difference between struct-like headers and module-like headers
|
|
|
|
/// is strange, but not actually a problem as long as we're consistent.
|
|
|
|
|
2024-07-22 14:59:34 -05:00
|
|
|
//@ has foo/struct.MyStruct.html
|
2024-02-06 11:22:24 -06:00
|
|
|
// User header
|
2024-07-24 15:16:08 -05:00
|
|
|
//@ has - '//section[@id="rustdoc-toc"]/ul[@class="block top-toc"]/li/a[@href="#fields-1"]' 'Fields'
|
2024-07-22 14:59:34 -05:00
|
|
|
//@ has - '//details[@class="toggle top-doc"]/div[@class="docblock"]/h2[@id="fields-1"]' 'Fields'
|
2024-02-06 11:22:24 -06:00
|
|
|
// Only one level of nesting
|
2024-07-24 15:16:08 -05:00
|
|
|
//@ count - '//section[@id="rustdoc-toc"]/ul[@class="block top-toc"]//a' 2
|
2024-02-06 11:22:24 -06:00
|
|
|
// Built-in header
|
2024-07-24 15:16:08 -05:00
|
|
|
//@ has - '//section[@id="rustdoc-toc"]/h3/a[@href="#fields"]' 'Fields'
|
2024-07-22 14:59:34 -05:00
|
|
|
//@ has - '//section[@id="main-content"]/h2[@id="fields"]' 'Fields'
|
2024-02-06 11:22:24 -06:00
|
|
|
|
|
|
|
pub struct MyStruct {
|
|
|
|
pub fields: i32,
|
|
|
|
}
|