]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-ui/intra-link-errors.rs
Pass on the DefId so rustdoc can name it in suggestions
[rust.git] / src / test / rustdoc-ui / intra-link-errors.rs
1 #![deny(broken_intra_doc_links)]
2 //~^ NOTE lint level is defined
3
4 //! [std::io::oops]
5 //! [std::io::oops::not::here]
6
7 // FIXME: this should say that it was skipped (maybe an allowed by default lint?)
8 /// [<invalid syntax>]
9
10 // FIXME: this could say which path was the first to not be found (in this case, `path`)
11 /// [path::to::nonexistent::module]
12 //~^ ERROR unresolved link
13 //~| NOTE no item named `path::to::nonexistent` is in scope
14 //~| HELP to escape
15
16 // TODO: why does this say `f` and not `f::A`??
17 /// [f::A]
18 //~^ ERROR unresolved link
19 //~| NOTE no item named `f` is in scope
20 //~| HELP to escape
21
22 /// [S::A]
23 //~^ ERROR unresolved link
24 //~| NOTE this link partially resolves
25 //~| NOTE `S` has no field
26
27 /// [S::fmt]
28 //~^ ERROR unresolved link
29 //~| NOTE this link partially resolves
30 //~| NOTE `S` has no field
31
32 /// [E::D]
33 //~^ ERROR unresolved link
34 //~| NOTE this link partially resolves
35 //~| NOTE `E` has no field
36
37 /// [u8::not_found]
38 //~^ ERROR unresolved link
39 //~| NOTE the builtin type `u8` does not have an associated item named `not_found`
40
41 /// [S!]
42 //~^ ERROR unresolved link
43 //~| HELP to link to the unit struct, use its disambiguator
44 //~| NOTE this link resolves to the unit struct `S`
45 pub fn f() {}
46 #[derive(Debug)]
47 pub struct S;
48
49 pub enum E { A, B, C }
50
51 /// [type@S::h]
52 //~^ ERROR unresolved link
53 //~| HELP to link to the associated function
54 //~| NOTE not in the type namespace
55 impl S {
56     pub fn h() {}
57 }
58
59 /// [type@T::g]
60 //~^ ERROR unresolved link
61 //~| HELP to link to the associated function
62 //~| NOTE not in the type namespace
63
64 /// [T::h!]
65 pub trait T {
66     fn g() {}
67 }