File tree 3 files changed +33
-1
lines changed
compiler/rustc_lint_defs/src
3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -446,6 +446,7 @@ macro_rules! declare_lint {
446
446
macro_rules! declare_tool_lint {
447
447
(
448
448
$( #[ $attr: meta] ) * $vis: vis $tool: ident :: $NAME: ident, $Level: ident, $desc: expr
449
+ $( , @future_incompatible = FutureIncompatibleInfo { $( $field: ident : $val: expr) ,* $( , ) * } ; ) ?
449
450
) => (
450
451
$crate:: declare_tool_lint!{ $( #[ $attr] ) * $vis $tool:: $NAME, $Level, $desc, false }
451
452
) ;
Original file line number Diff line number Diff line change @@ -331,3 +331,15 @@ warning: this URL is not a hyperlink
331
331
3 | /// [http://example.net]
332
332
| ^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://example.net>`
333
333
```
334
+
335
+ ## external_doc
336
+
337
+ This lint is ** nightly-only** and ** warns by default** . It detects when
338
+ ` #![feature(external_doc)] ` is used. This feature is scheduled for removal and will give a hard
339
+ error in a future release.
340
+
341
+ ``` rust
342
+ #![feature(external_doc)]
343
+ #[doc(include = " README.md" )]
344
+ pub fn foo () {}
345
+ ```
Original file line number Diff line number Diff line change 64
64
}
65
65
66
66
macro_rules! declare_rustdoc_lint {
67
- ( $( #[ $attr: meta] ) * $name: ident, $level: ident, $descr: literal $( , ) ?) => {
67
+ ( $( #[ $attr: meta] ) * $name: ident, $level: ident, $descr: literal
68
+ $( , @future_incompatible = FutureIncompatibleInfo { $( $field: ident : $val: expr) ,* $( , ) * } ; ) ?
69
+ $( , ) ?) => {
68
70
declare_tool_lint! {
69
71
$( #[ $attr] ) * pub rustdoc:: $name, $level, $descr
72
+ $( , @future_incompatible = FutureIncompatibleInfo { $( $field : $val) ,* } ; ) ?
70
73
}
71
74
}
72
75
}
@@ -158,6 +161,22 @@ declare_rustdoc_lint! {
158
161
"detects URLs that could be written using only angle brackets"
159
162
}
160
163
164
+ declare_rustdoc_lint ! {
165
+ /// The `doc_include` lint detects when `#[doc(include = ...)]` is used.
166
+ /// This feature is scheduled for removal and will give a hard error in a future release.
167
+ ///
168
+ /// This is a `rustdoc` only lint, see the documentation in the [rustdoc book].
169
+ ///
170
+ /// [rustdoc book]: ../../../rustdoc/lints.html#non_autolinks
171
+ DOC_INCLUDE ,
172
+ Warn ,
173
+ "detects using `#[doc(include = ...)]`" ,
174
+ @future_incompatible = FutureIncompatibleInfo {
175
+ reference: "issue #44732 <https://github.com/rust-lang/rust/issues/44732>" ,
176
+ edition: None ,
177
+ } ;
178
+ }
179
+
161
180
crate static RUSTDOC_LINTS : Lazy < Vec < & ' static Lint > > = Lazy :: new ( || {
162
181
vec ! [
163
182
BROKEN_INTRA_DOC_LINKS ,
You can’t perform that action at this time.
0 commit comments