diff options
| author | Serial <69764315+Serial-ATA@users.noreply.github.com> | 2022-06-24 14:11:24 -0400 |
|---|---|---|
| committer | Serial <69764315+Serial-ATA@users.noreply.github.com> | 2022-06-24 14:11:24 -0400 |
| commit | aec465cabdeb9a126446ccf791a9cf5ae045c185 (patch) | |
| tree | 0ee7582ec3a75ddd0f44a9c10e50235e36984b56 /clippy_lints/src | |
| parent | ebf77f6d7ecfb2cc60dfb39116d889af76d932cf (diff) | |
Add test for [`default_deprecation_reason`]
Diffstat (limited to 'clippy_lints/src')
| -rw-r--r-- | clippy_lints/src/deprecated_lints.rs | 5 | ||||
| -rw-r--r-- | clippy_lints/src/lib.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/utils/internal_lints.rs | 3 |
3 files changed, 4 insertions, 6 deletions
diff --git a/clippy_lints/src/deprecated_lints.rs b/clippy_lints/src/deprecated_lints.rs index d7a4b6f5c88..9aa5af3190f 100644 --- a/clippy_lints/src/deprecated_lints.rs +++ b/clippy_lints/src/deprecated_lints.rs @@ -4,17 +4,16 @@ /// enables the simple extraction of the metadata without changing the current deprecation /// declaration. pub struct ClippyDeprecatedLint { - #[cfg(feature = "internal")] #[allow(dead_code)] - desc: &'static str, + pub desc: &'static str, } +#[macro_export] macro_rules! declare_deprecated_lint { { $(#[$attr:meta])* pub $name: ident, $reason: literal} => { $(#[$attr])* #[allow(dead_code)] pub static $name: ClippyDeprecatedLint = ClippyDeprecatedLint { - #[cfg(feature = "internal")] desc: $reason }; } diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index dcee11cc28c..8eb75a0a548 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -159,7 +159,7 @@ macro_rules! declare_clippy_lint { } #[cfg(feature = "internal")] -mod deprecated_lints; +pub mod deprecated_lints; #[cfg_attr(feature = "internal", allow(clippy::missing_clippy_version_attribute))] mod utils; diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index c5380662566..b8e704b983b 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -348,7 +348,6 @@ declare_clippy_lint! { /// Indicates that the documentation is incomplete. /// /// ### Example - /// Bad: /// ```rust,ignore /// declare_deprecated_lint! { /// /// ### What it does @@ -362,7 +361,7 @@ declare_clippy_lint! { /// } /// ``` /// - /// Good: + /// Use instead: /// ```rust,ignore /// declare_deprecated_lint! { /// /// ### What it does |
