]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/expect_fun_call.fixed
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / tests / ui / expect_fun_call.fixed
index 1f74f6b8cf14be08ef0b6c2887a8191478552586..f3d8a941a92bc1171cd7545818ce604bc394b48d 100644 (file)
@@ -81,4 +81,14 @@ fn main() {
         Some("foo").unwrap_or_else(|| { panic!(get_static_str()) });
         Some("foo").unwrap_or_else(|| { panic!(get_non_static_str(&0).to_string()) });
     }
+
+    //Issue #3839
+    Some(true).unwrap_or_else(|| panic!("key {}, {}", 1, 2));
+
+    //Issue #4912 - the receiver is a &Option
+    {
+        let opt = Some(1);
+        let opt_ref = &opt;
+        opt_ref.unwrap_or_else(|| panic!("{:?}", opt_ref));
+    }
 }