We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf17818 commit 5f527ebCopy full SHA for 5f527eb
tests/codegen/issues/issue-68667-unwrap-combinators.rs
@@ -0,0 +1,17 @@
1
+#![crate_type = "lib"]
2
+
3
+//@ compile-flags: -O
4
5
+// MIR inlining now optimizes this code.
6
7
+// CHECK-LABEL: @unwrap_combinators
8
+// CHECK: icmp
9
+// CHECK-NEXT: icmp
10
+// CHECK-NEXT: select i1
11
+// CHECK-NEXT: ret i1
12
+#[no_mangle]
13
+pub fn unwrap_combinators(a: Option<i32>, b: i32) -> bool {
14
+ a.map(|t| t >= b)
15
+ .unwrap_or(false)
16
+}
17
0 commit comments