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 f37c576 commit beabc56Copy full SHA for beabc56
tests/codegen/issues/issue-112509-slice-get-andthen-get.rs
@@ -0,0 +1,17 @@
1
+//@ compile-flags: -O
2
+//@ min-llvm-version: 17
3
+#![crate_type = "lib"]
4
+
5
+// CHECK-LABEL: @write_u8_variant_a
6
+// CHECK: getelementptr
7
+// CHECK-NEXT: icmp ugt
8
+#[no_mangle]
9
+pub fn write_u8_variant_a(
10
+ bytes: &mut [u8],
11
+ buf: u8,
12
+ offset: usize,
13
+) -> Option<&mut [u8]> {
14
+ let buf = buf.to_le_bytes();
15
+ bytes
16
+ .get_mut(offset..).and_then(|bytes| bytes.get_mut(..buf.len()))
17
+}
0 commit comments