rust/tests/rustdoc-ui/intra-doc/anchors.rs

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

40 lines
647 B
Rust
Raw Normal View History

#![deny(rustdoc::broken_intra_doc_links)]
2019-11-23 17:45:55 +00:00
// A few tests on anchors.
/// Hello people.
///
/// You can anchors? Here's one!
///
/// # hola
///
/// Isn't it amazing?
pub struct Foo {
pub f: u8,
}
pub enum Enum {
A,
B,
}
/// Have you heard about stuff?
///
/// Like [Foo#hola].
///
/// Or maybe [Foo::f#hola].
//~^ ERROR `Foo::f#hola` contains an anchor
2019-11-23 17:45:55 +00:00
pub fn foo() {}
/// Empty.
///
/// Another anchor error: [hello#people#!].
//~^ ERROR `hello#people#!` contains multiple anchors
2019-11-23 17:45:55 +00:00
pub fn bar() {}
/// Empty?
///
/// Damn enum's variants: [Enum::A#whatever].
//~^ ERROR `Enum::A#whatever` contains an anchor
2019-11-23 17:45:55 +00:00
pub fn enum_link() {}