@@ -63,78 +63,86 @@ where
63
63
( lint_opts, lint_caps)
64
64
}
65
65
66
- declare_tool_lint ! {
66
+ macro_rules! declare_rustdoc_lint {
67
+ ( $( #[ $attr: meta] ) * $name: ident, $level: ident, $descr: literal $( , ) ?) => {
68
+ declare_tool_lint! {
69
+ $( #[ $attr] ) * pub rustdoc:: $name, $level, $descr
70
+ }
71
+ }
72
+ }
73
+
74
+ declare_rustdoc_lint ! {
67
75
/// The `broken_intra_doc_links` lint detects failures in resolving
68
76
/// intra-doc link targets. This is a `rustdoc` only lint, see the
69
77
/// documentation in the [rustdoc book].
70
78
///
71
79
/// [rustdoc book]: ../../../rustdoc/lints.html#broken_intra_doc_links
72
- pub rustdoc :: BROKEN_INTRA_DOC_LINKS ,
80
+ BROKEN_INTRA_DOC_LINKS ,
73
81
Warn ,
74
82
"failures in resolving intra-doc link targets"
75
83
}
76
84
77
- declare_tool_lint ! {
85
+ declare_rustdoc_lint ! {
78
86
/// This is a subset of `broken_intra_doc_links` that warns when linking from
79
87
/// a public item to a private one. This is a `rustdoc` only lint, see the
80
88
/// documentation in the [rustdoc book].
81
89
///
82
90
/// [rustdoc book]: ../../../rustdoc/lints.html#private_intra_doc_links
83
- pub rustdoc :: PRIVATE_INTRA_DOC_LINKS ,
91
+ PRIVATE_INTRA_DOC_LINKS ,
84
92
Warn ,
85
93
"linking from a public item to a private one"
86
94
}
87
95
88
- declare_tool_lint ! {
96
+ declare_rustdoc_lint ! {
89
97
/// The `invalid_codeblock_attributes` lint detects code block attributes
90
98
/// in documentation examples that have potentially mis-typed values. This
91
99
/// is a `rustdoc` only lint, see the documentation in the [rustdoc book].
92
100
///
93
101
/// [rustdoc book]: ../../../rustdoc/lints.html#invalid_codeblock_attributes
94
- pub rustdoc :: INVALID_CODEBLOCK_ATTRIBUTES ,
102
+ INVALID_CODEBLOCK_ATTRIBUTES ,
95
103
Warn ,
96
104
"codeblock attribute looks a lot like a known one"
97
105
}
98
106
99
- declare_tool_lint ! {
107
+ declare_rustdoc_lint ! {
100
108
/// The `missing_doc_code_examples` lint detects publicly-exported items
101
109
/// without code samples in their documentation. This is a `rustdoc` only
102
110
/// lint, see the documentation in the [rustdoc book].
103
111
///
104
112
/// [rustdoc book]: ../../../rustdoc/lints.html#missing_doc_code_examples
105
- pub rustdoc :: MISSING_DOC_CODE_EXAMPLES ,
113
+ MISSING_DOC_CODE_EXAMPLES ,
106
114
Allow ,
107
115
"detects publicly-exported items without code samples in their documentation"
108
116
}
109
117
110
- declare_tool_lint ! {
118
+ declare_rustdoc_lint ! {
111
119
/// The `private_doc_tests` lint detects code samples in docs of private
112
120
/// items not documented by `rustdoc`. This is a `rustdoc` only lint, see
113
121
/// the documentation in the [rustdoc book].
114
122
///
115
123
/// [rustdoc book]: ../../../rustdoc/lints.html#private_doc_tests
116
- pub rustdoc :: PRIVATE_DOC_TESTS ,
124
+ PRIVATE_DOC_TESTS ,
117
125
Allow ,
118
126
"detects code samples in docs of private items not documented by rustdoc"
119
127
}
120
128
121
- declare_tool_lint ! {
129
+ declare_rustdoc_lint ! {
122
130
/// The `invalid_html_tags` lint detects invalid HTML tags. This is a
123
131
/// `rustdoc` only lint, see the documentation in the [rustdoc book].
124
132
///
125
133
/// [rustdoc book]: ../../../rustdoc/lints.html#invalid_html_tags
126
- pub rustdoc :: INVALID_HTML_TAGS ,
134
+ INVALID_HTML_TAGS ,
127
135
Allow ,
128
136
"detects invalid HTML tags in doc comments"
129
137
}
130
138
131
- declare_tool_lint ! {
139
+ declare_rustdoc_lint ! {
132
140
/// The `non_autolinks` lint detects when a URL could be written using
133
141
/// only angle brackets. This is a `rustdoc` only lint, see the
134
142
/// documentation in the [rustdoc book].
135
143
///
136
144
/// [rustdoc book]: ../../../rustdoc/lints.html#non_autolinks
137
- pub rustdoc :: NON_AUTOLINKS ,
145
+ NON_AUTOLINKS ,
138
146
Warn ,
139
147
"detects URLs that could be written using only angle brackets"
140
148
}
0 commit comments