-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Deprecate doc(include)
#82539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate doc(include)
#82539
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,9 +64,12 @@ where | |
} | ||
|
||
macro_rules! declare_rustdoc_lint { | ||
($(#[$attr:meta])* $name: ident, $level: ident, $descr: literal $(,)?) => { | ||
($(#[$attr:meta])* $name: ident, $level: ident, $descr: literal | ||
$(, @future_incompatible = FutureIncompatibleInfo { $($field:ident : $val:expr),* $(,)* }; )? | ||
$(,)?) => { | ||
declare_tool_lint! { | ||
$(#[$attr])* pub rustdoc::$name, $level, $descr | ||
$(, @future_incompatible = FutureIncompatibleInfo { $($field : $val),* };)? | ||
} | ||
} | ||
} | ||
|
@@ -158,6 +161,22 @@ declare_rustdoc_lint! { | |
"detects URLs that could be written using only angle brackets" | ||
} | ||
|
||
declare_rustdoc_lint! { | ||
/// The `doc_include` lint detects when `#[doc(include = ...)]` is used. | ||
/// This feature is scheduled for removal and will give a hard error in a future release. | ||
/// | ||
/// This is a `rustdoc` only lint, see the documentation in the [rustdoc book]. | ||
/// | ||
/// [rustdoc book]: ../../../rustdoc/lints.html#non_autolinks | ||
DOC_INCLUDE, | ||
Warn, | ||
"detects using `#[doc(include = ...)]`", | ||
@future_incompatible = FutureIncompatibleInfo { | ||
reference: "issue #44732 <https://github.com/rust-lang/rust/issues/44732>", | ||
edition: None, | ||
}; | ||
} | ||
|
||
|
||
crate static RUSTDOC_LINTS: Lazy<Vec<&'static Lint>> = Lazy::new(|| { | ||
vec![ | ||
BROKEN_INTRA_DOC_LINKS, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#![crate_name = "inner"] | ||
#![feature(external_doc)] | ||
#[doc(include = "docs.md")] | ||
pub struct HasDocInclude {} | ||
pub struct NoDocs {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Here have some docs |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// aux-build:doc-include-deprecated.rs | ||
// check-pass | ||
#![feature(external_doc)] | ||
#![doc(include = "auxiliary/docs.md")] | ||
//~^ WARNING deprecated | ||
//~| WARNING hard error in a future release | ||
|
||
extern crate inner; | ||
|
||
pub use inner::HasDocInclude; | ||
|
||
#[doc(include = "auxiliary/docs.md")] | ||
//~^ WARNING deprecated | ||
//~| WARNING hard error in a future release | ||
pub use inner::HasDocInclude as _; | ||
|
||
#[doc(include = "auxiliary/docs.md")] | ||
//~^ WARNING deprecated | ||
//~| WARNING hard error in a future release | ||
pub use inner::NoDocs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is incorrect: