]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/manual_unwrap_or.rs
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / manual_unwrap_or.rs
index 95d585ad18a96c1f093e573d081fe6dd677fcb7e..b937fe6f977e5b7393d3423b9573ab5b903f89ea 100644 (file)
@@ -95,14 +95,14 @@ fn result_unwrap_or() {
         Err(_) => 42,
     };
 
-    // int case, suggestion must surround Result expr with parenthesis
+    // int case, suggestion must surround Result expr with parentheses
     match Ok(1) as Result<i32, &str> {
         Ok(i) => i,
         Err(_) => 42,
     };
 
-    // method call case, suggestion must not surround Result expr `s.method()` with parenthesis
-    struct S {}
+    // method call case, suggestion must not surround Result expr `s.method()` with parentheses
+    struct S;
     impl S {
         fn method(self) -> Option<i32> {
             Some(42)
@@ -213,4 +213,11 @@ fn format_name(name: Option<&Rc<str>>) -> &str {
     }
 }
 
+fn implicit_deref_ref() {
+    let _: &str = match Some(&"bye") {
+        None => "hi",
+        Some(s) => s,
+    };
+}
+
 fn main() {}