Skip to content

Commit

Permalink
Auto merge of #106731 - flip1995:clippy_backport, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
[beta] Clippy: Move manual_clamp to nursery

There was a lot of discussion about this lint in rust-lang/rust-clippy#9484 (comment)

We decided to move the lint to `nursery`. But since this lint broke code of many popular projects, we don't want to wait another release cycle until this move gets into stable. So we'd like to backport this commit to `beta`.

cc `@rust-lang/clippy` for approval from the Clippy side.
  • Loading branch information
bors committed Jan 14, 2023
2 parents 275123c + e74700c commit 7a9ae0c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tools/clippy/clippy_lints/src/manual_clamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ declare_clippy_lint! {
/// Some may consider panicking in these situations to be desirable, but it also may
/// introduce panicking where there wasn't any before.
///
/// See also [the discussion in the
/// PR](https://github.com/rust-lang/rust-clippy/pull/9484#issuecomment-1278922613).
///
/// ### Examples
/// ```rust
/// # let (input, min, max) = (0, -2, 1);
Expand Down Expand Up @@ -78,7 +81,7 @@ declare_clippy_lint! {
/// ```
#[clippy::version = "1.66.0"]
pub MANUAL_CLAMP,
complexity,
nursery,
"using a clamp pattern instead of the clamp function"
}
impl_lint_pass!(ManualClamp => [MANUAL_CLAMP]);
Expand Down

0 comments on commit 7a9ae0c

Please sign in to comment.