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