2023-02-23 20:46:07 -06:00
|
|
|
#![warn(clippy::ifs_same_cond)]
|
2023-05-22 02:38:16 -05:00
|
|
|
#![allow(clippy::if_same_then_else, clippy::comparison_chain, clippy::needless_else)]
|
2023-02-23 20:46:07 -06:00
|
|
|
|
|
|
|
fn main() {}
|
|
|
|
|
|
|
|
fn issue10272() {
|
|
|
|
use std::cell::Cell;
|
|
|
|
|
2023-03-13 07:17:30 -05:00
|
|
|
// Because the `ignore-interior-mutability` configuration
|
|
|
|
// is set to ignore for `std::cell::Cell`, the following `get()` calls
|
|
|
|
// should trigger warning
|
2023-02-23 20:46:07 -06:00
|
|
|
let x = Cell::new(true);
|
|
|
|
if x.get() {
|
|
|
|
} else if !x.take() {
|
|
|
|
} else if x.get() {
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
}
|