summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/crashes/ice-5579.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/crashes/ice-5579.rs')
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-5579.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/crashes/ice-5579.rs b/src/tools/clippy/tests/ui/crashes/ice-5579.rs
new file mode 100644
index 000000000..e1842c73f
--- /dev/null
+++ b/src/tools/clippy/tests/ui/crashes/ice-5579.rs
@@ -0,0 +1,17 @@
+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();
+ }
+}