]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/clone_on_copy.fixed
add paren before '?' when suggesting deref
[rust.git] / tests / ui / clone_on_copy.fixed
index dc062762604e063a4d1dac5f9554a7276898e65e..43849121b04330d7212ca3ba76713f414c91c18f 100644 (file)
@@ -21,7 +21,7 @@ fn is_ascii(ch: char) -> bool {
     ch.is_ascii()
 }
 
-fn clone_on_copy() {
+fn clone_on_copy() -> Option<(i32)> {
     42;
 
     vec![1].clone(); // ok, not a Copy type
@@ -71,4 +71,8 @@ fn clone_on_copy() {
     // Issue #5436
     let mut vec = Vec::new();
     vec.push(42);
+
+    let opt: &Option<i32> = &None;
+    let value = (*opt)?;
+    None
 }