2021-10-13 18:08:43 +11:00
|
|
|
// issue #89807
|
|
|
|
|
2022-02-27 07:08:31 +01:00
|
|
|
|
2021-10-13 18:08:43 +11:00
|
|
|
|
|
|
|
#[deny(unused_variables)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let value = Some(String::new());
|
|
|
|
#[allow(unused)]
|
|
|
|
let banana = 1;
|
|
|
|
#[allow(unused)]
|
2022-02-21 04:38:39 +01:00
|
|
|
let Some(chaenomeles) = value.clone() else { return }; // OK
|
|
|
|
|
|
|
|
let Some(chaenomeles) = value else { return }; //~ ERROR unused variable: `chaenomeles`
|
2021-10-13 18:08:43 +11:00
|
|
|
}
|