]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-ui/intra-links-anchors.rs
Rollup merge of #68881 - eddyb:always-preserve-dbg-vars, r=nagisa
[rust.git] / src / test / rustdoc-ui / intra-links-anchors.rs
1 #![deny(intra_doc_link_resolution_failure)]
2
3 // A few tests on anchors.
4
5 /// Hello people.
6 ///
7 /// You can anchors? Here's one!
8 ///
9 /// # hola
10 ///
11 /// Isn't it amazing?
12 pub struct Foo {
13     pub f: u8,
14 }
15
16 pub enum Enum {
17     A,
18     B,
19 }
20
21 /// Have you heard about stuff?
22 ///
23 /// Like [Foo#hola].
24 ///
25 /// Or maybe [Foo::f#hola].
26 //~^ ERROR `[Foo::f#hola]` has an issue with the link anchor.
27 pub fn foo() {}
28
29 /// Empty.
30 ///
31 /// Another anchor error: [hello#people#!].
32 //~^ ERROR `[hello#people#!]` has an issue with the link anchor.
33 pub fn bar() {}
34
35 /// Empty?
36 ///
37 /// Damn enum's variants: [Enum::A#whatever].
38 //~^ ERROR `[Enum::A#whatever]` has an issue with the link anchor.
39 pub fn enum_link() {}
40
41 /// Primitives?
42 ///
43 /// [u32#hello]
44 //~^ ERROR `[u32#hello]` has an issue with the link anchor.
45 pub fn x() {}