summaryrefslogtreecommitdiffstats
path: root/tests/ui/let-else/let-else-allow-unused.rs
blob: bbb1c7beaf8d367279d5fad326fd0cffcd33e98b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// issue #89807



#[deny(unused_variables)]

fn main() {
    let value = Some(String::new());
    #[allow(unused)]
    let banana = 1;
    #[allow(unused)]
    let Some(chaenomeles) = value.clone() else { return }; // OK

    let Some(chaenomeles) = value else { return }; //~ ERROR unused variable: `chaenomeles`
}