]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/manual_unwrap_or.rs
Fix type checks for `manual_str_repeat`
[rust.git] / tests / ui / manual_unwrap_or.rs
index c9eee25a5b1538d96a38e36d8922f44ea1bae6ff..989adde1f5bbb7518e8c41a22e24df5fa0cbe82b 100644 (file)
@@ -190,4 +190,34 @@ const fn const_fn_result_unwrap_or() {
     };
 }
 
+mod issue6965 {
+    macro_rules! some_macro {
+        () => {
+            if 1 > 2 { Some(1) } else { None }
+        };
+    }
+
+    fn test() {
+        let _ = match some_macro!() {
+            Some(val) => val,
+            None => 0,
+        };
+    }
+}
+
+use std::rc::Rc;
+fn format_name(name: Option<&Rc<str>>) -> &str {
+    match name {
+        None => "<anon>",
+        Some(name) => name,
+    }
+}
+
+fn implicit_deref_ref() {
+    let _: &str = match Some(&"bye") {
+        None => "hi",
+        Some(s) => s,
+    };
+}
+
 fn main() {}