]> git.lizzy.rs Git - rust.git/commit
Auto merge of #7948 - 5225225:castlosslessbool, r=llogiq
authorbors <bors@rust-lang.org>
Fri, 12 Nov 2021 18:17:18 +0000 (18:17 +0000)
committerbors <bors@rust-lang.org>
Fri, 12 Nov 2021 18:17:18 +0000 (18:17 +0000)
commit4f82dd83dfd6f64708b4f0d572c567dfeb7b2092
treeee8fcd725965b4b674500aefbe2eaea058fe2ec9
parent610b381966fd984e801272ab790eb4194b1c93de
parentd4c8cb63a474c2365664a68e35153adef3cdd9b9
Auto merge of #7948 - 5225225:castlosslessbool, r=llogiq

Lint for bool to integer casts in `cast_lossless`

The lint description says

> Checks for casts between *numerical* types that may be replaced by safe conversion functions.

Which is strictly speaking being violated here, but it seems within the spirit of the lint. I think it is still a useful lint to have, and having a different lint for just this feels excessive. Thoughts?

Fixes #7947

changelog: Lint for bool to integer casts in [`cast_lossless`]
clippy_lints/src/bool_assert_comparison.rs
clippy_lints/src/casts/mod.rs
clippy_utils/src/msrvs.rs