about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduardo Broto <ebroto@tutanota.com>2020-05-13 20:47:44 +0200
committerEduardo Broto <ebroto@tutanota.com>2020-05-13 20:47:44 +0200
commit8d1029d3ca013687422b58d0e99084a4e3421089 (patch)
treebf86314c59f0e81862ff41751a856bc5af0f009a
parente4cd8e7961b553cac44671d63bc6dfc2223ea66b (diff)
downloadrust-8d1029d3ca013687422b58d0e99084a4e3421089.tar.gz
rust-8d1029d3ca013687422b58d0e99084a4e3421089.zip
Move test for issue 5579 under tests/ui/crashes
-rw-r--r--tests/ui/checked_unwrap/simple_conditionals.rs21
-rw-r--r--tests/ui/crashes/ice-5579.rs17
2 files changed, 17 insertions, 21 deletions
diff --git a/tests/ui/checked_unwrap/simple_conditionals.rs b/tests/ui/checked_unwrap/simple_conditionals.rs
index 49794e0c241..3e7b4b390ba 100644
--- a/tests/ui/checked_unwrap/simple_conditionals.rs
+++ b/tests/ui/checked_unwrap/simple_conditionals.rs
@@ -78,24 +78,3 @@ fn main() {
 
     assert!(x.is_ok(), "{:?}", x.unwrap_err()); // ok, it's a common test pattern
 }
-
-mod issue_5579 {
-    trait IsErr {
-        fn is_err(&self, err: &str) -> bool;
-    }
-
-    impl<T> IsErr for Option<T> {
-        fn is_err(&self, _err: &str) -> bool {
-            true
-        }
-    }
-
-    #[allow(unused)]
-    fn boom() {
-        let t = Some(1);
-
-        if t.is_err("") {
-            t.unwrap();
-        }
-    }
-}
diff --git a/tests/ui/crashes/ice-5579.rs b/tests/ui/crashes/ice-5579.rs
new file mode 100644
index 00000000000..e1842c73f0e
--- /dev/null
+++ b/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();
+    }
+}