]> 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 06d12fb5f49352f99caf0048737fdce488dac716..60bbaa89d42825819edae4191b6d3a3cccaa35fe 100644 (file)
@@ -1,6 +1,5 @@
 // run-rustfix
 
-#![allow(clippy::unused_self)]
 #![warn(clippy::expect_fun_call)]
 
 /// Checks implementation of the `EXPECT_FUN_CALL` lint
@@ -85,4 +84,11 @@ fn get_non_static_str(_: &u32) -> &str {
 
     //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));
+    }
 }