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 beabc56 commit 15d07fbCopy full SHA for 15d07fb
tests/codegen/issues/issue-111508-vec-tryinto-array.rs
@@ -0,0 +1,22 @@
1
+//@ compile-flags: -O
2
+// This regress since Rust version 1.72.
3
+//@ min-llvm-version: 18.1.4
4
+
5
+#![crate_type = "lib"]
6
7
+use std::convert::TryInto;
8
9
+const N: usize = 24;
10
11
+#[no_mangle]
12
+// CHECK-LABEL: @example
13
+// CHECK-NOT: unwrap_failed
14
+pub fn example(a: Vec<u8>) -> u8 {
15
+ if a.len() != 32 {
16
+ return 0;
17
+ }
18
19
+ let a: [u8; 32] = a.try_into().unwrap();
20
21
+ a[15] + a[N]
22
+}
0 commit comments