Skip to content

Commit

Permalink
Auto merge of #4970 - krishna-veerareddy:fix-replace-consts-documenta…
Browse files Browse the repository at this point in the history
…tion, 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
  • Loading branch information
bors committed Dec 30, 2019
2 parents cecaca3 + f533b98 commit 3036b0e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions clippy_lints/src/replace_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ 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
///
/// **Known problems:** None.
///
/// **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,
Expand Down

0 comments on commit 3036b0e

Please sign in to comment.