2021-02-21 00:38:41 +00:00
|
|
|
#![crate_name = "foo"]
|
2023-06-30 17:20:33 +00:00
|
|
|
#![allow(rustdoc::redundant_explicit_links)]
|
2021-02-21 00:38:41 +00:00
|
|
|
//! # Description test crate
|
|
|
|
//!
|
2021-02-21 00:50:01 +00:00
|
|
|
//! This is the contents of the test crate docstring.
|
|
|
|
//! It should not show up in the description.
|
2021-02-21 00:38:41 +00:00
|
|
|
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has 'foo/index.html' '//meta[@name="description"]/@content' \
|
2021-02-21 00:50:01 +00:00
|
|
|
// 'Description test crate'
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ !has - '//meta[@name="description"]/@content' 'should not show up'
|
2021-02-21 00:38:41 +00:00
|
|
|
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has 'foo/foo_mod/index.html' '//meta[@name="description"]/@content' \
|
2021-02-21 00:50:01 +00:00
|
|
|
// 'First paragraph description.'
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ !has - '//meta[@name="description"]/@content' 'Second paragraph'
|
2021-02-21 00:38:41 +00:00
|
|
|
/// First paragraph description.
|
|
|
|
///
|
|
|
|
/// Second paragraph should not show up.
|
|
|
|
pub mod foo_mod {
|
|
|
|
pub struct __Thing {}
|
|
|
|
}
|
|
|
|
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has 'foo/fn.foo_fn.html' '//meta[@name="description"]/@content' \
|
2021-02-21 00:50:01 +00:00
|
|
|
// 'Only paragraph.'
|
2021-02-21 00:38:41 +00:00
|
|
|
/// Only paragraph.
|
|
|
|
pub fn foo_fn() {}
|
2023-02-11 19:36:55 +00:00
|
|
|
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has 'foo/fn.bar_fn.html' '//meta[@name="description"]/@content' \
|
2023-02-11 19:36:55 +00:00
|
|
|
// 'Description with intra-doc link to foo_fn and [nonexistent_item] and foo_fn.'
|
|
|
|
#[allow(rustdoc::broken_intra_doc_links)]
|
2023-06-30 17:20:33 +00:00
|
|
|
/// Description with intra-doc link to [foo_fn] and [nonexistent_item] and [foo_fn](self::foo_fn).
|
2023-02-11 19:36:55 +00:00
|
|
|
pub fn bar_fn() {}
|