We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f527eb commit 95740fbCopy full SHA for 95740fb
tests/codegen/issues/issue-36010-some-box-is_some.rs
@@ -0,0 +1,29 @@
1
+#![crate_type = "lib"]
2
+
3
+//@ compile-flags: -O
4
5
+use std::mem;
6
7
+fn foo<T>(a: &mut T, b: T) -> bool {
8
+ let b = Some(mem::replace(a, b));
9
+ let ret = b.is_some();
10
+ mem::forget(b);
11
+ return ret
12
+}
13
14
+// CHECK-LABEL: @foo_u32
15
+// CHECK: store i32
16
+// CHECK-NEXT: ret i1
17
+#[no_mangle]
18
+pub fn foo_u32(a: &mut u32, b: u32) -> bool {
19
+ foo(a, b)
20
21
22
+// CHECK-LABEL: @foo_box
23
+// CHECK: store ptr
24
25
26
+pub fn foo_box(a: &mut Box<u32>, b: Box<u32>) -> bool {
27
28
29
0 commit comments