File tree Expand file tree Collapse file tree 3 files changed +89
-0
lines changed Expand file tree Collapse file tree 3 files changed +89
-0
lines changed Original file line number Diff line number Diff line change 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 anchor issue...
27+ pub fn foo ( ) { }
28+
29+ /// Empty.
30+ ///
31+ /// Another anchor error: [hello#people#!].
32+ //~^ ERROR `[hello#people#!]` has an anchor issue...
33+ pub fn bar ( ) { }
34+
35+ /// Empty?
36+ ///
37+ /// Damn enum's variants: [Enum::A#whatever].
38+ //~^ ERROR `[Enum::A#whatever]` has an anchor issue...
39+ pub fn enum_link ( ) { }
40+
41+ /// Primitives?
42+ ///
43+ /// [u32#hello]
44+ //~^ ERROR `[u32#hello]` has an anchor issue...
45+ pub fn x ( ) { }
Original file line number Diff line number Diff line change 1+ error: `[Foo::f#hola]` has an anchor issue...
2+ --> $DIR/intra-links-anchors.rs:25:15
3+ |
4+ LL | /// Or maybe [Foo::f#hola].
5+ | ^^^^^^^^^^^ struct fields cannot be followed by anchors
6+ |
7+ note: lint level defined here
8+ --> $DIR/intra-links-anchors.rs:1:9
9+ |
10+ LL | #![deny(intra_doc_link_resolution_failure)]
11+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
13+ error: `[hello#people#!]` has an anchor issue...
14+ --> $DIR/intra-links-anchors.rs:31:28
15+ |
16+ LL | /// Another anchor error: [hello#people#!].
17+ | ^^^^^^^^^^^^^^ only one `#` is allowed in a link
18+
19+ error: `[Enum::A#whatever]` has an anchor issue...
20+ --> $DIR/intra-links-anchors.rs:37:28
21+ |
22+ LL | /// Damn enum's variants: [Enum::A#whatever].
23+ | ^^^^^^^^^^^^^^^^ variants cannot be followed by anchors
24+
25+ error: `[u32#hello]` has an anchor issue...
26+ --> $DIR/intra-links-anchors.rs:43:6
27+ |
28+ LL | /// [u32#hello]
29+ | ^^^^^^^^^ primitive types cannot be followed by anchors
30+
31+ error: aborting due to 4 previous errors
32+
Original file line number Diff line number Diff line change 1+ /// I want...
2+ ///
3+ /// # Anchor!
4+ pub struct Something ;
5+
6+ // @has intra_links_anchors/struct.SomeOtherType.html
7+ // @has - '//a/@href' '../intra_links_anchors/struct.Something.html#Anchor!'
8+
9+ /// I want...
10+ ///
11+ /// To link to [Something#Anchor!]
12+ pub struct SomeOtherType ;
You can’t perform that action at this time.
0 commit comments