Skip to content

Commit 3036b0e

Browse files
committed
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
2 parents cecaca3 + f533b98 commit 3036b0e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clippy_lints/src/replace_consts.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ use rustc_errors::Applicability;
88
use rustc_session::declare_tool_lint;
99

1010
declare_clippy_lint! {
11-
/// **What it does:** Checks for usage of `ATOMIC_X_INIT`, `ONCE_INIT`, and
12-
/// `uX/iX::MIN/MAX`.
11+
/// **What it does:** Checks for usage of standard library
12+
/// `const`s that could be replaced by `const fn`s.
1313
///
1414
/// **Why is this bad?** `const fn`s exist
1515
///
1616
/// **Known problems:** None.
1717
///
1818
/// **Example:**
1919
/// ```rust
20-
/// # use core::sync::atomic::{ATOMIC_ISIZE_INIT, AtomicIsize};
21-
/// static FOO: AtomicIsize = ATOMIC_ISIZE_INIT;
20+
/// let x = std::u32::MIN;
21+
/// let y = std::u32::MAX;
2222
/// ```
2323
///
2424
/// Could be written:
2525
///
2626
/// ```rust
27-
/// # use core::sync::atomic::AtomicIsize;
28-
/// static FOO: AtomicIsize = AtomicIsize::new(0);
27+
/// let x = u32::min_value();
28+
/// let y = u32::max_value();
2929
/// ```
3030
pub REPLACE_CONSTS,
3131
pedantic,

0 commit comments

Comments
 (0)