diff options
| author | bors <bors@rust-lang.org> | 2019-12-30 17:28:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-12-30 17:28:57 +0000 |
| commit | 3036b0e6d548f2cf3340f636a807854db191017b (patch) | |
| tree | 8802f8478089fb3a4bb28c77e6c48405accbd117 | |
| parent | cecaca3382f233deddfa9cb1f12710d144448f16 (diff) | |
| parent | f533b98121e6f10f35b1dcf8a93c364f7c5bb48c (diff) | |
| download | rust-3036b0e6d548f2cf3340f636a807854db191017b.tar.gz rust-3036b0e6d548f2cf3340f636a807854db191017b.zip | |
Auto merge of #4970 - krishna-veerareddy:fix-replace-consts-documentation, r=flip1995
Fix `replace_consts` lint documentation
`replace_consts` lint no longer lints for the usage of
`ATOMIC_{SIZE}_INIT` and `ONCE_INIT` so removing any
occurences of them in the documentation.
changelog: Update `replace_consts` lint documentation
| -rw-r--r-- | clippy_lints/src/replace_consts.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clippy_lints/src/replace_consts.rs b/clippy_lints/src/replace_consts.rs index b1224eaa7a4..782d5f1c813 100644 --- a/clippy_lints/src/replace_consts.rs +++ b/clippy_lints/src/replace_consts.rs @@ -8,8 +8,8 @@ use rustc_errors::Applicability; use rustc_session::declare_tool_lint; declare_clippy_lint! { - /// **What it does:** Checks for usage of `ATOMIC_X_INIT`, `ONCE_INIT`, and - /// `uX/iX::MIN/MAX`. + /// **What it does:** Checks for usage of standard library + /// `const`s that could be replaced by `const fn`s. /// /// **Why is this bad?** `const fn`s exist /// @@ -17,15 +17,15 @@ declare_clippy_lint! { /// /// **Example:** /// ```rust - /// # use core::sync::atomic::{ATOMIC_ISIZE_INIT, AtomicIsize}; - /// static FOO: AtomicIsize = ATOMIC_ISIZE_INIT; + /// let x = std::u32::MIN; + /// let y = std::u32::MAX; /// ``` /// /// Could be written: /// /// ```rust - /// # use core::sync::atomic::AtomicIsize; - /// static FOO: AtomicIsize = AtomicIsize::new(0); + /// let x = u32::min_value(); + /// let y = u32::max_value(); /// ``` pub REPLACE_CONSTS, pedantic, |
