]> git.proxmox.com Git - rustc.git/blame - src/test/rustdoc-ui/intra-doc/errors.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / rustdoc-ui / intra-doc / errors.rs
CommitLineData
6a06907d 1#![deny(rustdoc::broken_intra_doc_links)]
1b1a35ee
XL
2//~^ NOTE lint level is defined
3
4// FIXME: this should say that it was skipped (maybe an allowed by default lint?)
29967ef6 5/// [invalid intra-doc syntax!!]
1b1a35ee
XL
6
7/// [path::to::nonexistent::module]
8//~^ ERROR unresolved link
29967ef6 9//~| NOTE no item named `path` in scope
1b1a35ee
XL
10
11/// [path::to::nonexistent::macro!]
12//~^ ERROR unresolved link
29967ef6 13//~| NOTE no item named `path` in scope
1b1a35ee
XL
14
15/// [type@path::to::nonexistent::type]
16//~^ ERROR unresolved link
29967ef6 17//~| NOTE no item named `path` in scope
1b1a35ee
XL
18
19/// [std::io::not::here]
20//~^ ERROR unresolved link
29967ef6 21//~| NOTE no item named `not` in module `io`
1b1a35ee
XL
22
23/// [type@std::io::not::here]
24//~^ ERROR unresolved link
29967ef6 25//~| NOTE no item named `not` in module `io`
1b1a35ee
XL
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`
72pub fn f() {}
73#[derive(Debug)]
74pub struct S;
75
76pub 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
82impl S {
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`
94pub trait T {
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]
103macro_rules! m {
104 () => {};
105}