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