]> git.lizzy.rs Git - rust.git/blob - tests/ui/crashes/ice-5579.rs
Auto merge of #6298 - JohnTitor:fix-example, r=llogiq
[rust.git] / tests / ui / crashes / ice-5579.rs
1 trait IsErr {
2     fn is_err(&self, err: &str) -> bool;
3 }
4
5 impl<T> IsErr for Option<T> {
6     fn is_err(&self, _err: &str) -> bool {
7         true
8     }
9 }
10
11 fn main() {
12     let t = Some(1);
13
14     if t.is_err("") {
15         t.unwrap();
16     }
17 }