2023-03-24 08:04:35 -05:00
|
|
|
#![warn(clippy::ifs_same_cond)]
|
2023-06-02 04:41:57 -05:00
|
|
|
#![allow(clippy::if_same_then_else, clippy::comparison_chain, clippy::needless_else)]
|
2023-03-24 08:04:35 -05:00
|
|
|
|
|
|
|
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 {
|
|
|
|
}
|
|
|
|
}
|