]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-ui/intra-link-errors.rs
8904828b047cab3e5fd20392b75d1cf837001e96
[rust.git] / src / test / rustdoc-ui / intra-link-errors.rs
1 #![allow(invalid_html_tags)]
2 #![deny(broken_intra_doc_links)]
3 //~^ NOTE lint level is defined
4
5 // FIXME: this should say that it was skipped (maybe an allowed by default lint?)
6 /// [<invalid syntax>]
7
8 /// [path::to::nonexistent::module]
9 //~^ ERROR unresolved link
10 //~| NOTE `intra_link_errors` contains no item named `path`
11
12 /// [path::to::nonexistent::macro!]
13 //~^ ERROR unresolved link
14 //~| NOTE `intra_link_errors` contains no item named `path`
15
16 /// [type@path::to::nonexistent::type]
17 //~^ ERROR unresolved link
18 //~| NOTE `intra_link_errors` contains no item named `path`
19
20 /// [std::io::not::here]
21 //~^ ERROR unresolved link
22 //~| NOTE `io` contains no item named `not`
23
24 /// [type@std::io::not::here]
25 //~^ ERROR unresolved link
26 //~| NOTE `io` contains no item named `not`
27
28 /// [std::io::Error::x]
29 //~^ ERROR unresolved link
30 //~| NOTE the struct `Error` has no field
31
32 /// [std::io::ErrorKind::x]
33 //~^ ERROR unresolved link
34 //~| NOTE the enum `ErrorKind` has no variant
35
36 /// [f::A]
37 //~^ ERROR unresolved link
38 //~| NOTE `f` is a function, not a module
39
40 /// [f::A!]
41 //~^ ERROR unresolved link
42 //~| NOTE `f` is a function, not a module
43
44 /// [S::A]
45 //~^ ERROR unresolved link
46 //~| NOTE struct `S` has no field or associated item
47
48 /// [S::fmt]
49 //~^ ERROR unresolved link
50 //~| NOTE struct `S` has no field or associated item
51
52 /// [E::D]
53 //~^ ERROR unresolved link
54 //~| NOTE enum `E` has no variant or associated item
55
56 /// [u8::not_found]
57 //~^ ERROR unresolved link
58 //~| NOTE the builtin type `u8` has no associated item named `not_found`
59
60 /// [std::primitive::u8::not_found]
61 //~^ ERROR unresolved link
62 //~| NOTE the builtin type `u8` has no associated item named `not_found`
63
64 /// [type@Vec::into_iter]
65 //~^ ERROR unresolved link
66 //~| HELP to link to the associated function, add parentheses
67 //~| NOTE this link resolves to the associated function `into_iter`
68
69 /// [S!]
70 //~^ ERROR unresolved link
71 //~| HELP to link to the struct, prefix with `struct@`
72 //~| NOTE this link resolves to the struct `S`
73 pub fn f() {}
74 #[derive(Debug)]
75 pub struct S;
76
77 pub enum E { A, B, C }
78
79 /// [type@S::h]
80 //~^ ERROR unresolved link
81 //~| HELP to link to the associated function
82 //~| NOTE not in the type namespace
83 impl S {
84     pub fn h() {}
85 }
86
87 /// [type@T::g]
88 //~^ ERROR unresolved link
89 //~| HELP to link to the associated function
90 //~| NOTE not in the type namespace
91
92 /// [T::h!]
93 //~^ ERROR unresolved link
94 //~| NOTE `T` has no macro named `h`
95 pub trait T {
96     fn g() {}
97 }
98
99 /// [m()]
100 //~^ ERROR unresolved link
101 //~| HELP to link to the macro
102 //~| NOTE not in the value namespace
103 #[macro_export]
104 macro_rules! m {
105     () => {};
106 }