summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/crashes/ice-5579.rs
blob: 8ab36bbf93cbff2677ef7142513362399abebd0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#![allow(clippy::unnecessary_literal_unwrap)]

trait IsErr {
    fn is_err(&self, err: &str) -> bool;
}

impl<T> IsErr for Option<T> {
    fn is_err(&self, _err: &str) -> bool {
        true
    }
}

fn main() {
    let t = Some(1);

    if t.is_err("") {
        t.unwrap();
    }
}