rust-clippy/tests/ui-toml/ifs_same_cond/ifs_same_cond.rs
J-ZhengLi f4ccb06d69 extract is_interior_mutable_type from [mut_key] to clippy_utils::ty;
fix configuration of [`ifs_same_cond`];

add some style improvement for [`ifs_same_cond`];
2023-03-13 20:17:30 +08:00

18 lines
438 B
Rust

#![warn(clippy::ifs_same_cond)]
#![allow(clippy::if_same_then_else, clippy::comparison_chain)]
fn main() {}
fn issue10272() {
use std::cell::Cell;
// Because the `ignore-interior-mutability` configuration
// is set to ignore for `std::cell::Cell`, the following `get()` calls
// should trigger warning
let x = Cell::new(true);
if x.get() {
} else if !x.take() {
} else if x.get() {
} else {
}
}