about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-10 12:29:15 +0000
committerbors <bors@rust-lang.org>2022-10-10 12:29:15 +0000
commitcf72565a12c982f577ca4394c3b80edb89f6c6d3 (patch)
treecef7d8e4cfe94942ac48d50e68df597eb2c35374 /tests
parent272bbfb857650e0d3d05dd83a5ce1a522c94b4bd (diff)
parent39a7d000b640523772ea709bc85d2c9460cf07bf (diff)
downloadrust-cf72565a12c982f577ca4394c3b80edb89f6c6d3.tar.gz
rust-cf72565a12c982f577ca4394c3b80edb89f6c6d3.zip
Auto merge of #9610 - Jarcho:fix-9608, r=Alexendoo
Don't suggest moving tuple structs with a significant drop to late evaluation

fixes #9608

changelog: Don't suggest moving tuple structs with a significant drop to late evaluation
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/or_fun_call.fixed11
-rw-r--r--tests/ui/or_fun_call.rs11
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/or_fun_call.fixed b/tests/ui/or_fun_call.fixed
index 896430780ea..23b1aa8bebd 100644
--- a/tests/ui/or_fun_call.fixed
+++ b/tests/ui/or_fun_call.fixed
@@ -225,4 +225,15 @@ mod issue8239 {
     }
 }
 
+mod issue9608 {
+    fn sig_drop() {
+        enum X {
+            X(std::fs::File),
+            Y(u32),
+        }
+
+        let _ = None.unwrap_or(X::Y(0));
+    }
+}
+
 fn main() {}
diff --git a/tests/ui/or_fun_call.rs b/tests/ui/or_fun_call.rs
index 2473163d4fd..039998f22dd 100644
--- a/tests/ui/or_fun_call.rs
+++ b/tests/ui/or_fun_call.rs
@@ -225,4 +225,15 @@ mod issue8239 {
     }
 }
 
+mod issue9608 {
+    fn sig_drop() {
+        enum X {
+            X(std::fs::File),
+            Y(u32),
+        }
+
+        let _ = None.unwrap_or(X::Y(0));
+    }
+}
+
 fn main() {}